aws-sdk-cloudwatchlogs 0.25.1

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutLogEventsInput {
    /// <p>The name of the log group.</p>
    #[doc(hidden)]
    pub log_group_name: std::option::Option<std::string::String>,
    /// <p>The name of the log stream.</p>
    #[doc(hidden)]
    pub log_stream_name: std::option::Option<std::string::String>,
    /// <p>The log events.</p>
    #[doc(hidden)]
    pub log_events: std::option::Option<std::vec::Vec<crate::types::InputLogEvent>>,
    /// <p>The sequence token obtained from the response of the previous <code>PutLogEvents</code> call.</p> <important>
    /// <p>The <code>sequenceToken</code> parameter is now ignored in <code>PutLogEvents</code> actions. <code>PutLogEvents</code> actions are now accepted and never return <code>InvalidSequenceTokenException</code> or <code>DataAlreadyAcceptedException</code> even if the sequence token is not valid.</p>
    /// </important>
    #[doc(hidden)]
    pub sequence_token: std::option::Option<std::string::String>,
}
impl PutLogEventsInput {
    /// <p>The name of the log group.</p>
    pub fn log_group_name(&self) -> std::option::Option<&str> {
        self.log_group_name.as_deref()
    }
    /// <p>The name of the log stream.</p>
    pub fn log_stream_name(&self) -> std::option::Option<&str> {
        self.log_stream_name.as_deref()
    }
    /// <p>The log events.</p>
    pub fn log_events(&self) -> std::option::Option<&[crate::types::InputLogEvent]> {
        self.log_events.as_deref()
    }
    /// <p>The sequence token obtained from the response of the previous <code>PutLogEvents</code> call.</p> <important>
    /// <p>The <code>sequenceToken</code> parameter is now ignored in <code>PutLogEvents</code> actions. <code>PutLogEvents</code> actions are now accepted and never return <code>InvalidSequenceTokenException</code> or <code>DataAlreadyAcceptedException</code> even if the sequence token is not valid.</p>
    /// </important>
    pub fn sequence_token(&self) -> std::option::Option<&str> {
        self.sequence_token.as_deref()
    }
}
impl PutLogEventsInput {
    /// Creates a new builder-style object to manufacture [`PutLogEventsInput`](crate::operation::put_log_events::PutLogEventsInput).
    pub fn builder() -> crate::operation::put_log_events::builders::PutLogEventsInputBuilder {
        crate::operation::put_log_events::builders::PutLogEventsInputBuilder::default()
    }
}

/// A builder for [`PutLogEventsInput`](crate::operation::put_log_events::PutLogEventsInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct PutLogEventsInputBuilder {
    pub(crate) log_group_name: std::option::Option<std::string::String>,
    pub(crate) log_stream_name: std::option::Option<std::string::String>,
    pub(crate) log_events: std::option::Option<std::vec::Vec<crate::types::InputLogEvent>>,
    pub(crate) sequence_token: std::option::Option<std::string::String>,
}
impl PutLogEventsInputBuilder {
    /// <p>The name of the log group.</p>
    pub fn log_group_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.log_group_name = Some(input.into());
        self
    }
    /// <p>The name of the log group.</p>
    pub fn set_log_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.log_group_name = input;
        self
    }
    /// <p>The name of the log stream.</p>
    pub fn log_stream_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.log_stream_name = Some(input.into());
        self
    }
    /// <p>The name of the log stream.</p>
    pub fn set_log_stream_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.log_stream_name = input;
        self
    }
    /// Appends an item to `log_events`.
    ///
    /// To override the contents of this collection use [`set_log_events`](Self::set_log_events).
    ///
    /// <p>The log events.</p>
    pub fn log_events(mut self, input: crate::types::InputLogEvent) -> Self {
        let mut v = self.log_events.unwrap_or_default();
        v.push(input);
        self.log_events = Some(v);
        self
    }
    /// <p>The log events.</p>
    pub fn set_log_events(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::InputLogEvent>>,
    ) -> Self {
        self.log_events = input;
        self
    }
    /// <p>The sequence token obtained from the response of the previous <code>PutLogEvents</code> call.</p> <important>
    /// <p>The <code>sequenceToken</code> parameter is now ignored in <code>PutLogEvents</code> actions. <code>PutLogEvents</code> actions are now accepted and never return <code>InvalidSequenceTokenException</code> or <code>DataAlreadyAcceptedException</code> even if the sequence token is not valid.</p>
    /// </important>
    pub fn sequence_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.sequence_token = Some(input.into());
        self
    }
    /// <p>The sequence token obtained from the response of the previous <code>PutLogEvents</code> call.</p> <important>
    /// <p>The <code>sequenceToken</code> parameter is now ignored in <code>PutLogEvents</code> actions. <code>PutLogEvents</code> actions are now accepted and never return <code>InvalidSequenceTokenException</code> or <code>DataAlreadyAcceptedException</code> even if the sequence token is not valid.</p>
    /// </important>
    pub fn set_sequence_token(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.sequence_token = input;
        self
    }
    /// Consumes the builder and constructs a [`PutLogEventsInput`](crate::operation::put_log_events::PutLogEventsInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::put_log_events::PutLogEventsInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::put_log_events::PutLogEventsInput {
            log_group_name: self.log_group_name,
            log_stream_name: self.log_stream_name,
            log_events: self.log_events,
            sequence_token: self.sequence_token,
        })
    }
}