aws-sdk-ecs 1.128.0

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

/// <p>The current account setting for a resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Setting {
    /// <p>The Amazon ECS resource name.</p>
    pub name: ::std::option::Option<crate::types::SettingName>,
    /// <p>Determines whether the account setting is on or off for the specified resource.</p>
    pub value: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
    pub principal_arn: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
    /// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
    pub r#type: ::std::option::Option<crate::types::SettingType>,
}
impl Setting {
    /// <p>The Amazon ECS resource name.</p>
    pub fn name(&self) -> ::std::option::Option<&crate::types::SettingName> {
        self.name.as_ref()
    }
    /// <p>Determines whether the account setting is on or off for the specified resource.</p>
    pub fn value(&self) -> ::std::option::Option<&str> {
        self.value.as_deref()
    }
    /// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
    pub fn principal_arn(&self) -> ::std::option::Option<&str> {
        self.principal_arn.as_deref()
    }
    /// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
    /// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::SettingType> {
        self.r#type.as_ref()
    }
}
impl Setting {
    /// Creates a new builder-style object to manufacture [`Setting`](crate::types::Setting).
    pub fn builder() -> crate::types::builders::SettingBuilder {
        crate::types::builders::SettingBuilder::default()
    }
}

/// A builder for [`Setting`](crate::types::Setting).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SettingBuilder {
    pub(crate) name: ::std::option::Option<crate::types::SettingName>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
    pub(crate) principal_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::SettingType>,
}
impl SettingBuilder {
    /// <p>The Amazon ECS resource name.</p>
    pub fn name(mut self, input: crate::types::SettingName) -> Self {
        self.name = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon ECS resource name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<crate::types::SettingName>) -> Self {
        self.name = input;
        self
    }
    /// <p>The Amazon ECS resource name.</p>
    pub fn get_name(&self) -> &::std::option::Option<crate::types::SettingName> {
        &self.name
    }
    /// <p>Determines whether the account setting is on or off for the specified resource.</p>
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Determines whether the account setting is on or off for the specified resource.</p>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>Determines whether the account setting is on or off for the specified resource.</p>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
    pub fn principal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.principal_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
    pub fn set_principal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.principal_arn = input;
        self
    }
    /// <p>The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.</p>
    pub fn get_principal_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.principal_arn
    }
    /// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
    /// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
    pub fn r#type(mut self, input: crate::types::SettingType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
    /// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::SettingType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Indicates whether Amazon Web Services manages the account setting, or if the user manages it.</p>
    /// <p><code>aws_managed</code> account settings are read-only, as Amazon Web Services manages such on the customer's behalf. Currently, the <code>guardDutyActivate</code> account setting is the only one Amazon Web Services manages.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::SettingType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Setting`](crate::types::Setting).
    pub fn build(self) -> crate::types::Setting {
        crate::types::Setting {
            name: self.name,
            value: self.value,
            principal_arn: self.principal_arn,
            r#type: self.r#type,
        }
    }
}