aws-sdk-cloudwatchlogs 1.120.0

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The response from the GetLogObject operation.</p>
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct GetLogObjectOutput {
    /// <p>A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.</p>
    pub field_stream:
        crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError>,
    _request_id: Option<String>,
}
impl GetLogObjectOutput {
    /// <p>A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.</p>
    pub fn field_stream(
        &self,
    ) -> &crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError> {
        &self.field_stream
    }
}
impl ::aws_types::request_id::RequestId for GetLogObjectOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetLogObjectOutput {
    /// Creates a new builder-style object to manufacture [`GetLogObjectOutput`](crate::operation::get_log_object::GetLogObjectOutput).
    pub fn builder() -> crate::operation::get_log_object::builders::GetLogObjectOutputBuilder {
        crate::operation::get_log_object::builders::GetLogObjectOutputBuilder::default()
    }
    #[allow(unused)]
    pub(crate) fn into_builder(self) -> crate::operation::get_log_object::builders::GetLogObjectOutputBuilder {
        Self::builder().field_stream(self.field_stream)
    }
}

/// A builder for [`GetLogObjectOutput`](crate::operation::get_log_object::GetLogObjectOutput).
#[derive(::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetLogObjectOutputBuilder {
    pub(crate) field_stream: ::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError>,
    >,
    _request_id: Option<String>,
}
impl GetLogObjectOutputBuilder {
    /// <p>A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.</p>
    pub fn field_stream(
        mut self,
        input: crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError>,
    ) -> Self {
        self.field_stream = ::std::option::Option::Some(input);
        self
    }
    /// <p>A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.</p>
    pub fn set_field_stream(
        mut self,
        input: ::std::option::Option<
            crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError>,
        >,
    ) -> Self {
        self.field_stream = input;
        self
    }
    /// <p>A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.</p>
    pub fn get_field_stream(
        &self,
    ) -> &::std::option::Option<
        crate::event_receiver::EventReceiver<crate::types::GetLogObjectResponseStream, crate::types::error::GetLogObjectResponseStreamError>,
    > {
        &self.field_stream
    }
    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 [`GetLogObjectOutput`](crate::operation::get_log_object::GetLogObjectOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`field_stream`](crate::operation::get_log_object::builders::GetLogObjectOutputBuilder::field_stream)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_log_object::GetLogObjectOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_log_object::GetLogObjectOutput {
            field_stream: self.field_stream.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "field_stream",
                    "field_stream was not specified but it is required when building GetLogObjectOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}