aws-sdk-cloudwatchomni 1.2.0

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

/// The intelligence configuration for the calling account after the update.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutIntelligenceConfigurationOutput {
    /// The AWS account ID this configuration applies to.
    pub account_id: ::std::string::String,
    /// The currently active KMS key ARN for customer-managed encryption, if configured.
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
    /// ISO-8601 timestamp of the last update.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// ISO-8601 timestamp of initial creation.
    pub created_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl PutIntelligenceConfigurationOutput {
    /// The AWS account ID this configuration applies to.
    pub fn account_id(&self) -> &str {
        use std::ops::Deref;
        self.account_id.deref()
    }
    /// The currently active KMS key ARN for customer-managed encryption, if configured.
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
    /// ISO-8601 timestamp of the last update.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// ISO-8601 timestamp of initial creation.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
}
impl ::aws_types::request_id::RequestId for PutIntelligenceConfigurationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PutIntelligenceConfigurationOutput {
    /// Creates a new builder-style object to manufacture [`PutIntelligenceConfigurationOutput`](crate::operation::put_intelligence_configuration::PutIntelligenceConfigurationOutput).
    pub fn builder() -> crate::operation::put_intelligence_configuration::builders::PutIntelligenceConfigurationOutputBuilder {
        crate::operation::put_intelligence_configuration::builders::PutIntelligenceConfigurationOutputBuilder::default()
    }
}

/// A builder for [`PutIntelligenceConfigurationOutput`](crate::operation::put_intelligence_configuration::PutIntelligenceConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutIntelligenceConfigurationOutputBuilder {
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl PutIntelligenceConfigurationOutputBuilder {
    /// The AWS account ID this configuration applies to.
    /// This field is required.
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The AWS account ID this configuration applies to.
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// The AWS account ID this configuration applies to.
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// The currently active KMS key ARN for customer-managed encryption, if configured.
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The currently active KMS key ARN for customer-managed encryption, if configured.
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// The currently active KMS key ARN for customer-managed encryption, if configured.
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// ISO-8601 timestamp of the last update.
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// ISO-8601 timestamp of the last update.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// ISO-8601 timestamp of the last update.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// ISO-8601 timestamp of initial creation.
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// ISO-8601 timestamp of initial creation.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// ISO-8601 timestamp of initial creation.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    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 [`PutIntelligenceConfigurationOutput`](crate::operation::put_intelligence_configuration::PutIntelligenceConfigurationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`account_id`](crate::operation::put_intelligence_configuration::builders::PutIntelligenceConfigurationOutputBuilder::account_id)
    /// - [`updated_at`](crate::operation::put_intelligence_configuration::builders::PutIntelligenceConfigurationOutputBuilder::updated_at)
    /// - [`created_at`](crate::operation::put_intelligence_configuration::builders::PutIntelligenceConfigurationOutputBuilder::created_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::put_intelligence_configuration::PutIntelligenceConfigurationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::put_intelligence_configuration::PutIntelligenceConfigurationOutput {
            account_id: self.account_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "account_id",
                    "account_id was not specified but it is required when building PutIntelligenceConfigurationOutput",
                )
            })?,
            kms_key_arn: self.kms_key_arn,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building PutIntelligenceConfigurationOutput",
                )
            })?,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building PutIntelligenceConfigurationOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}