aws-sdk-computeoptimizerautomation 1.3.0

AWS SDK for Compute Optimizer Automation
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 GetEnrollmentConfigurationOutput {
    /// <p>The current enrollment status.</p>
    pub status: crate::types::EnrollmentStatus,
    /// <p>The reason for the current enrollment status.</p>
    pub status_reason: ::std::option::Option<::std::string::String>,
    /// <p>Specifies whether the management account can create Automation rules that implement optimization actions for this account.</p>
    pub organization_rule_mode: ::std::option::Option<crate::types::OrganizationRuleMode>,
    /// <p>The timestamp of the last update to the enrollment configuration.</p>
    pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEnrollmentConfigurationOutput {
    /// <p>The current enrollment status.</p>
    pub fn status(&self) -> &crate::types::EnrollmentStatus {
        &self.status
    }
    /// <p>The reason for the current enrollment status.</p>
    pub fn status_reason(&self) -> ::std::option::Option<&str> {
        self.status_reason.as_deref()
    }
    /// <p>Specifies whether the management account can create Automation rules that implement optimization actions for this account.</p>
    pub fn organization_rule_mode(&self) -> ::std::option::Option<&crate::types::OrganizationRuleMode> {
        self.organization_rule_mode.as_ref()
    }
    /// <p>The timestamp of the last update to the enrollment configuration.</p>
    pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_timestamp.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetEnrollmentConfigurationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetEnrollmentConfigurationOutput {
    /// Creates a new builder-style object to manufacture [`GetEnrollmentConfigurationOutput`](crate::operation::get_enrollment_configuration::GetEnrollmentConfigurationOutput).
    pub fn builder() -> crate::operation::get_enrollment_configuration::builders::GetEnrollmentConfigurationOutputBuilder {
        crate::operation::get_enrollment_configuration::builders::GetEnrollmentConfigurationOutputBuilder::default()
    }
}

/// A builder for [`GetEnrollmentConfigurationOutput`](crate::operation::get_enrollment_configuration::GetEnrollmentConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEnrollmentConfigurationOutputBuilder {
    pub(crate) status: ::std::option::Option<crate::types::EnrollmentStatus>,
    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
    pub(crate) organization_rule_mode: ::std::option::Option<crate::types::OrganizationRuleMode>,
    pub(crate) last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetEnrollmentConfigurationOutputBuilder {
    /// <p>The current enrollment status.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::EnrollmentStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current enrollment status.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::EnrollmentStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current enrollment status.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::EnrollmentStatus> {
        &self.status
    }
    /// <p>The reason for the current enrollment status.</p>
    pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason for the current enrollment status.</p>
    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_reason = input;
        self
    }
    /// <p>The reason for the current enrollment status.</p>
    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_reason
    }
    /// <p>Specifies whether the management account can create Automation rules that implement optimization actions for this account.</p>
    pub fn organization_rule_mode(mut self, input: crate::types::OrganizationRuleMode) -> Self {
        self.organization_rule_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether the management account can create Automation rules that implement optimization actions for this account.</p>
    pub fn set_organization_rule_mode(mut self, input: ::std::option::Option<crate::types::OrganizationRuleMode>) -> Self {
        self.organization_rule_mode = input;
        self
    }
    /// <p>Specifies whether the management account can create Automation rules that implement optimization actions for this account.</p>
    pub fn get_organization_rule_mode(&self) -> &::std::option::Option<crate::types::OrganizationRuleMode> {
        &self.organization_rule_mode
    }
    /// <p>The timestamp of the last update to the enrollment configuration.</p>
    pub fn last_updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp of the last update to the enrollment configuration.</p>
    pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_timestamp = input;
        self
    }
    /// <p>The timestamp of the last update to the enrollment configuration.</p>
    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_timestamp
    }
    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 [`GetEnrollmentConfigurationOutput`](crate::operation::get_enrollment_configuration::GetEnrollmentConfigurationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::operation::get_enrollment_configuration::builders::GetEnrollmentConfigurationOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_enrollment_configuration::GetEnrollmentConfigurationOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::get_enrollment_configuration::GetEnrollmentConfigurationOutput {
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetEnrollmentConfigurationOutput",
                )
            })?,
            status_reason: self.status_reason,
            organization_rule_mode: self.organization_rule_mode,
            last_updated_timestamp: self.last_updated_timestamp,
            _request_id: self._request_id,
        })
    }
}