aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
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 EnableAccessControlInput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::option::Option<::std::string::String>,
    /// <p>The scope that the access control configuration applies to.</p>
    pub scope: ::std::option::Option<crate::types::AccessControlScope>,
    /// <p>The rule that determines which users are granted access.</p>
    pub rule: ::std::option::Option<crate::types::AccessControlRule>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl EnableAccessControlInput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> ::std::option::Option<&str> {
        self.app_name.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> ::std::option::Option<&str> {
        self.environment_name.as_deref()
    }
    /// <p>The scope that the access control configuration applies to.</p>
    pub fn scope(&self) -> ::std::option::Option<&crate::types::AccessControlScope> {
        self.scope.as_ref()
    }
    /// <p>The rule that determines which users are granted access.</p>
    pub fn rule(&self) -> ::std::option::Option<&crate::types::AccessControlRule> {
        self.rule.as_ref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl EnableAccessControlInput {
    /// Creates a new builder-style object to manufacture [`EnableAccessControlInput`](crate::operation::enable_access_control::EnableAccessControlInput).
    pub fn builder() -> crate::operation::enable_access_control::builders::EnableAccessControlInputBuilder {
        crate::operation::enable_access_control::builders::EnableAccessControlInputBuilder::default()
    }
}

/// A builder for [`EnableAccessControlInput`](crate::operation::enable_access_control::EnableAccessControlInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnableAccessControlInputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) scope: ::std::option::Option<crate::types::AccessControlScope>,
    pub(crate) rule: ::std::option::Option<crate::types::AccessControlRule>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl EnableAccessControlInputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// <p>The scope that the access control configuration applies to.</p>
    pub fn scope(mut self, input: crate::types::AccessControlScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// <p>The scope that the access control configuration applies to.</p>
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::AccessControlScope>) -> Self {
        self.scope = input;
        self
    }
    /// <p>The scope that the access control configuration applies to.</p>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::AccessControlScope> {
        &self.scope
    }
    /// <p>The rule that determines which users are granted access.</p>
    pub fn rule(mut self, input: crate::types::AccessControlRule) -> Self {
        self.rule = ::std::option::Option::Some(input);
        self
    }
    /// <p>The rule that determines which users are granted access.</p>
    pub fn set_rule(mut self, input: ::std::option::Option<crate::types::AccessControlRule>) -> Self {
        self.rule = input;
        self
    }
    /// <p>The rule that determines which users are granted access.</p>
    pub fn get_rule(&self) -> &::std::option::Option<crate::types::AccessControlRule> {
        &self.rule
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`EnableAccessControlInput`](crate::operation::enable_access_control::EnableAccessControlInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::enable_access_control::EnableAccessControlInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::enable_access_control::EnableAccessControlInput {
            app_name: self.app_name,
            environment_name: self.environment_name,
            scope: self.scope,
            rule: self.rule,
            client_token: self.client_token,
        })
    }
}