aws-sdk-cloudwatchlogs 1.115.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 GetLogFieldsOutput {
    /// <p>The list of log fields for the specified data source, including field names and their data types.</p>
    pub log_fields: ::std::option::Option<::std::vec::Vec<crate::types::LogFieldsListItem>>,
    _request_id: Option<String>,
}
impl GetLogFieldsOutput {
    /// <p>The list of log fields for the specified data source, including field names and their data types.</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_fields.is_none()`.
    pub fn log_fields(&self) -> &[crate::types::LogFieldsListItem] {
        self.log_fields.as_deref().unwrap_or_default()
    }
}
impl ::aws_types::request_id::RequestId for GetLogFieldsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetLogFieldsOutput {
    /// Creates a new builder-style object to manufacture [`GetLogFieldsOutput`](crate::operation::get_log_fields::GetLogFieldsOutput).
    pub fn builder() -> crate::operation::get_log_fields::builders::GetLogFieldsOutputBuilder {
        crate::operation::get_log_fields::builders::GetLogFieldsOutputBuilder::default()
    }
}

/// A builder for [`GetLogFieldsOutput`](crate::operation::get_log_fields::GetLogFieldsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetLogFieldsOutputBuilder {
    pub(crate) log_fields: ::std::option::Option<::std::vec::Vec<crate::types::LogFieldsListItem>>,
    _request_id: Option<String>,
}
impl GetLogFieldsOutputBuilder {
    /// Appends an item to `log_fields`.
    ///
    /// To override the contents of this collection use [`set_log_fields`](Self::set_log_fields).
    ///
    /// <p>The list of log fields for the specified data source, including field names and their data types.</p>
    pub fn log_fields(mut self, input: crate::types::LogFieldsListItem) -> Self {
        let mut v = self.log_fields.unwrap_or_default();
        v.push(input);
        self.log_fields = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of log fields for the specified data source, including field names and their data types.</p>
    pub fn set_log_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogFieldsListItem>>) -> Self {
        self.log_fields = input;
        self
    }
    /// <p>The list of log fields for the specified data source, including field names and their data types.</p>
    pub fn get_log_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogFieldsListItem>> {
        &self.log_fields
    }
    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 [`GetLogFieldsOutput`](crate::operation::get_log_fields::GetLogFieldsOutput).
    pub fn build(self) -> crate::operation::get_log_fields::GetLogFieldsOutput {
        crate::operation::get_log_fields::GetLogFieldsOutput {
            log_fields: self.log_fields,
            _request_id: self._request_id,
        }
    }
}