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 GetAccessControlOutput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::string::String,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::string::String,
    /// <p>The type of identity provider.</p>
    pub provider_type: ::std::option::Option<crate::types::ProviderType>,
    /// <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>The status of the access control configuration.</p>
    pub status: crate::types::AccessControlStatus,
    /// <p>The reason for the status.</p>
    pub status_reason: ::std::option::Option<::std::string::String>,
    /// <p>The time at which access control was enabled for the environment.</p>
    pub enabled_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time at which the access control configuration was last updated. The value is in ISO-8601 format.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAccessControlOutput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> &str {
        use std::ops::Deref;
        self.app_name.deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> &str {
        use std::ops::Deref;
        self.environment_name.deref()
    }
    /// <p>The type of identity provider.</p>
    pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
        self.provider_type.as_ref()
    }
    /// <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>The status of the access control configuration.</p>
    pub fn status(&self) -> &crate::types::AccessControlStatus {
        &self.status
    }
    /// <p>The reason for the status.</p>
    pub fn status_reason(&self) -> ::std::option::Option<&str> {
        self.status_reason.as_deref()
    }
    /// <p>The time at which access control was enabled for the environment.</p>
    pub fn enabled_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.enabled_at.as_ref()
    }
    /// <p>The time at which the access control configuration was last updated. The value is in ISO-8601 format.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetAccessControlOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAccessControlOutput {
    /// Creates a new builder-style object to manufacture [`GetAccessControlOutput`](crate::operation::get_access_control::GetAccessControlOutput).
    pub fn builder() -> crate::operation::get_access_control::builders::GetAccessControlOutputBuilder {
        crate::operation::get_access_control::builders::GetAccessControlOutputBuilder::default()
    }
}

/// A builder for [`GetAccessControlOutput`](crate::operation::get_access_control::GetAccessControlOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAccessControlOutputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
    pub(crate) scope: ::std::option::Option<crate::types::AccessControlScope>,
    pub(crate) rule: ::std::option::Option<crate::types::AccessControlRule>,
    pub(crate) status: ::std::option::Option<crate::types::AccessControlStatus>,
    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
    pub(crate) enabled_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetAccessControlOutputBuilder {
    /// <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 type of identity provider.</p>
    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
        self.provider_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of identity provider.</p>
    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
        self.provider_type = input;
        self
    }
    /// <p>The type of identity provider.</p>
    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
        &self.provider_type
    }
    /// <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>The status of the access control configuration.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::AccessControlStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the access control configuration.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AccessControlStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the access control configuration.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::AccessControlStatus> {
        &self.status
    }
    /// <p>The reason for the 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 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 status.</p>
    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_reason
    }
    /// <p>The time at which access control was enabled for the environment.</p>
    pub fn enabled_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.enabled_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which access control was enabled for the environment.</p>
    pub fn set_enabled_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.enabled_at = input;
        self
    }
    /// <p>The time at which access control was enabled for the environment.</p>
    pub fn get_enabled_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.enabled_at
    }
    /// <p>The time at which the access control configuration was last updated. The value is in ISO-8601 format.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the access control configuration was last updated. The value is in ISO-8601 format.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The time at which the access control configuration was last updated. The value is in ISO-8601 format.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_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 [`GetAccessControlOutput`](crate::operation::get_access_control::GetAccessControlOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`app_name`](crate::operation::get_access_control::builders::GetAccessControlOutputBuilder::app_name)
    /// - [`environment_name`](crate::operation::get_access_control::builders::GetAccessControlOutputBuilder::environment_name)
    /// - [`status`](crate::operation::get_access_control::builders::GetAccessControlOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_access_control::GetAccessControlOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_access_control::GetAccessControlOutput {
            app_name: self.app_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_name",
                    "app_name was not specified but it is required when building GetAccessControlOutput",
                )
            })?,
            environment_name: self.environment_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "environment_name",
                    "environment_name was not specified but it is required when building GetAccessControlOutput",
                )
            })?,
            provider_type: self.provider_type,
            scope: self.scope,
            rule: self.rule,
            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 GetAccessControlOutput",
                )
            })?,
            status_reason: self.status_reason,
            enabled_at: self.enabled_at,
            updated_at: self.updated_at,
            _request_id: self._request_id,
        })
    }
}