aws-sdk-cloudwatchlogs 1.129.0

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>
    pub log_group_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the log stream.</p>
    pub log_stream_name: ::std::option::Option<::std::string::String>,
    /// <p>The log events.</p>
    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>
    pub sequence_token: ::std::option::Option<::std::string::String>,
    /// <p>The entity associated with the log events.</p>
    pub entity: ::std::option::Option<crate::types::Entity>,
}
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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_events.is_none()`.
    pub fn log_events(&self) -> &[crate::types::InputLogEvent] {
        self.log_events.as_deref().unwrap_or_default()
    }
    /// <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()
    }
    /// <p>The entity associated with the log events.</p>
    pub fn entity(&self) -> ::std::option::Option<&crate::types::Entity> {
        self.entity.as_ref()
    }
}
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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>,
    pub(crate) entity: ::std::option::Option<crate::types::Entity>,
}
impl PutLogEventsInputBuilder {
    /// <p>The name of the log group.</p>
    /// This field is required.
    pub fn log_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_group_name = ::std::option::Option::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 group.</p>
    pub fn get_log_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_group_name
    }
    /// <p>The name of the log stream.</p>
    /// This field is required.
    pub fn log_stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.log_stream_name = ::std::option::Option::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
    }
    /// <p>The name of the log stream.</p>
    pub fn get_log_stream_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.log_stream_name
    }
    /// 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 = ::std::option::Option::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 log events.</p>
    pub fn get_log_events(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InputLogEvent>> {
        &self.log_events
    }
    /// <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 ::std::convert::Into<::std::string::String>) -> Self {
        self.sequence_token = ::std::option::Option::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
    }
    /// <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 get_sequence_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.sequence_token
    }
    /// <p>The entity associated with the log events.</p>
    pub fn entity(mut self, input: crate::types::Entity) -> Self {
        self.entity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The entity associated with the log events.</p>
    pub fn set_entity(mut self, input: ::std::option::Option<crate::types::Entity>) -> Self {
        self.entity = input;
        self
    }
    /// <p>The entity associated with the log events.</p>
    pub fn get_entity(&self) -> &::std::option::Option<crate::types::Entity> {
        &self.entity
    }
    /// Consumes the builder and constructs a [`PutLogEventsInput`](crate::operation::put_log_events::PutLogEventsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_log_events::PutLogEventsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::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,
            entity: self.entity,
        })
    }
}