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 GetLogEventsOutput {
    /// <p>The events.</p>
    #[doc(hidden)]
    pub events: std::option::Option<std::vec::Vec<crate::types::OutputLogEvent>>,
    /// <p>The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.</p>
    #[doc(hidden)]
    pub next_forward_token: std::option::Option<std::string::String>,
    /// <p>The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.</p>
    #[doc(hidden)]
    pub next_backward_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl GetLogEventsOutput {
    /// <p>The events.</p>
    pub fn events(&self) -> std::option::Option<&[crate::types::OutputLogEvent]> {
        self.events.as_deref()
    }
    /// <p>The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn next_forward_token(&self) -> std::option::Option<&str> {
        self.next_forward_token.as_deref()
    }
    /// <p>The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn next_backward_token(&self) -> std::option::Option<&str> {
        self.next_backward_token.as_deref()
    }
}
impl aws_http::request_id::RequestId for GetLogEventsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetLogEventsOutput {
    /// Creates a new builder-style object to manufacture [`GetLogEventsOutput`](crate::operation::get_log_events::GetLogEventsOutput).
    pub fn builder() -> crate::operation::get_log_events::builders::GetLogEventsOutputBuilder {
        crate::operation::get_log_events::builders::GetLogEventsOutputBuilder::default()
    }
}

/// A builder for [`GetLogEventsOutput`](crate::operation::get_log_events::GetLogEventsOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct GetLogEventsOutputBuilder {
    pub(crate) events: std::option::Option<std::vec::Vec<crate::types::OutputLogEvent>>,
    pub(crate) next_forward_token: std::option::Option<std::string::String>,
    pub(crate) next_backward_token: std::option::Option<std::string::String>,
    _request_id: Option<String>,
}
impl GetLogEventsOutputBuilder {
    /// Appends an item to `events`.
    ///
    /// To override the contents of this collection use [`set_events`](Self::set_events).
    ///
    /// <p>The events.</p>
    pub fn events(mut self, input: crate::types::OutputLogEvent) -> Self {
        let mut v = self.events.unwrap_or_default();
        v.push(input);
        self.events = Some(v);
        self
    }
    /// <p>The events.</p>
    pub fn set_events(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::OutputLogEvent>>,
    ) -> Self {
        self.events = input;
        self
    }
    /// <p>The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn next_forward_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.next_forward_token = Some(input.into());
        self
    }
    /// <p>The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn set_next_forward_token(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.next_forward_token = input;
        self
    }
    /// <p>The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn next_backward_token(mut self, input: impl Into<std::string::String>) -> Self {
        self.next_backward_token = Some(input.into());
        self
    }
    /// <p>The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.</p>
    pub fn set_next_backward_token(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.next_backward_token = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetLogEventsOutput`](crate::operation::get_log_events::GetLogEventsOutput).
    pub fn build(self) -> crate::operation::get_log_events::GetLogEventsOutput {
        crate::operation::get_log_events::GetLogEventsOutput {
            events: self.events,
            next_forward_token: self.next_forward_token,
            next_backward_token: self.next_backward_token,
            _request_id: self._request_id,
        }
    }
}