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 UpdateEnvironmentInput {
    /// <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 Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub environment_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The permission mode for the environment's IAM role.</p>
    pub environment_role_permission_mode: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>,
    /// <p>The source configuration for the environment.</p>
    pub source_config: ::std::option::Option<crate::types::EnvironmentUpdateSourceConfigRequest>,
    /// <p>A list of the environment's AWS WAF log configurations.</p>
    pub waf_log_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfigRequest>>,
    /// <p>The gradual rollout settings.</p>
    pub gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    /// <p>The web hosting settings for the environment.</p>
    pub web: ::std::option::Option<crate::types::EnvironmentUpdateWebConfigRequest>,
    /// <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
    pub backend: ::std::option::Option<crate::types::EnvironmentUpdateBackendRequest>,
    /// <p>The VPC network configuration for the environment.</p>
    pub network_config: ::std::option::Option<crate::types::EnvironmentUpdateNetworkConfigRequest>,
}
impl UpdateEnvironmentInput {
    /// <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 Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn environment_role_arn(&self) -> ::std::option::Option<&str> {
        self.environment_role_arn.as_deref()
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn environment_role_permission_mode(&self) -> ::std::option::Option<&crate::types::EnvironmentRolePermissionMode> {
        self.environment_role_permission_mode.as_ref()
    }
    /// <p>The source configuration for the environment.</p>
    pub fn source_config(&self) -> ::std::option::Option<&crate::types::EnvironmentUpdateSourceConfigRequest> {
        self.source_config.as_ref()
    }
    /// <p>A list of the environment's AWS WAF log configurations.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.waf_log_configs.is_none()`.
    pub fn waf_log_configs(&self) -> &[crate::types::WafLogConfigRequest] {
        self.waf_log_configs.as_deref().unwrap_or_default()
    }
    /// <p>The gradual rollout settings.</p>
    pub fn gradual_rollout_config(&self) -> ::std::option::Option<&crate::types::GradualRolloutConfig> {
        self.gradual_rollout_config.as_ref()
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(&self) -> ::std::option::Option<&crate::types::EnvironmentUpdateWebConfigRequest> {
        self.web.as_ref()
    }
    /// <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
    pub fn backend(&self) -> ::std::option::Option<&crate::types::EnvironmentUpdateBackendRequest> {
        self.backend.as_ref()
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(&self) -> ::std::option::Option<&crate::types::EnvironmentUpdateNetworkConfigRequest> {
        self.network_config.as_ref()
    }
}
impl UpdateEnvironmentInput {
    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
        crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
    }
}

/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateEnvironmentInputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) environment_role_permission_mode: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>,
    pub(crate) source_config: ::std::option::Option<crate::types::EnvironmentUpdateSourceConfigRequest>,
    pub(crate) waf_log_configs: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfigRequest>>,
    pub(crate) gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    pub(crate) web: ::std::option::Option<crate::types::EnvironmentUpdateWebConfigRequest>,
    pub(crate) backend: ::std::option::Option<crate::types::EnvironmentUpdateBackendRequest>,
    pub(crate) network_config: ::std::option::Option<crate::types::EnvironmentUpdateNetworkConfigRequest>,
}
impl UpdateEnvironmentInputBuilder {
    /// <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 Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn environment_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn set_environment_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role for the environment.</p>
    pub fn get_environment_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_role_arn
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn environment_role_permission_mode(mut self, input: crate::types::EnvironmentRolePermissionMode) -> Self {
        self.environment_role_permission_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn set_environment_role_permission_mode(mut self, input: ::std::option::Option<crate::types::EnvironmentRolePermissionMode>) -> Self {
        self.environment_role_permission_mode = input;
        self
    }
    /// <p>The permission mode for the environment's IAM role.</p>
    pub fn get_environment_role_permission_mode(&self) -> &::std::option::Option<crate::types::EnvironmentRolePermissionMode> {
        &self.environment_role_permission_mode
    }
    /// <p>The source configuration for the environment.</p>
    pub fn source_config(mut self, input: crate::types::EnvironmentUpdateSourceConfigRequest) -> Self {
        self.source_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source configuration for the environment.</p>
    pub fn set_source_config(mut self, input: ::std::option::Option<crate::types::EnvironmentUpdateSourceConfigRequest>) -> Self {
        self.source_config = input;
        self
    }
    /// <p>The source configuration for the environment.</p>
    pub fn get_source_config(&self) -> &::std::option::Option<crate::types::EnvironmentUpdateSourceConfigRequest> {
        &self.source_config
    }
    /// Appends an item to `waf_log_configs`.
    ///
    /// To override the contents of this collection use [`set_waf_log_configs`](Self::set_waf_log_configs).
    ///
    /// <p>A list of the environment's AWS WAF log configurations.</p>
    pub fn waf_log_configs(mut self, input: crate::types::WafLogConfigRequest) -> Self {
        let mut v = self.waf_log_configs.unwrap_or_default();
        v.push(input);
        self.waf_log_configs = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of the environment's AWS WAF log configurations.</p>
    pub fn set_waf_log_configs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WafLogConfigRequest>>) -> Self {
        self.waf_log_configs = input;
        self
    }
    /// <p>A list of the environment's AWS WAF log configurations.</p>
    pub fn get_waf_log_configs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WafLogConfigRequest>> {
        &self.waf_log_configs
    }
    /// <p>The gradual rollout settings.</p>
    pub fn gradual_rollout_config(mut self, input: crate::types::GradualRolloutConfig) -> Self {
        self.gradual_rollout_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The gradual rollout settings.</p>
    pub fn set_gradual_rollout_config(mut self, input: ::std::option::Option<crate::types::GradualRolloutConfig>) -> Self {
        self.gradual_rollout_config = input;
        self
    }
    /// <p>The gradual rollout settings.</p>
    pub fn get_gradual_rollout_config(&self) -> &::std::option::Option<crate::types::GradualRolloutConfig> {
        &self.gradual_rollout_config
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(mut self, input: crate::types::EnvironmentUpdateWebConfigRequest) -> Self {
        self.web = ::std::option::Option::Some(input);
        self
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn set_web(mut self, input: ::std::option::Option<crate::types::EnvironmentUpdateWebConfigRequest>) -> Self {
        self.web = input;
        self
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn get_web(&self) -> &::std::option::Option<crate::types::EnvironmentUpdateWebConfigRequest> {
        &self.web
    }
    /// <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
    pub fn backend(mut self, input: crate::types::EnvironmentUpdateBackendRequest) -> Self {
        self.backend = ::std::option::Option::Some(input);
        self
    }
    /// <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::EnvironmentUpdateBackendRequest>) -> Self {
        self.backend = input;
        self
    }
    /// <p>The backend settings for the environment. You can specify Auth and Database only when the app has a backend. An app without a backend can specify this only to turn off backend log delivery. If you omit a member, that setting is unchanged.</p>
    pub fn get_backend(&self) -> &::std::option::Option<crate::types::EnvironmentUpdateBackendRequest> {
        &self.backend
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(mut self, input: crate::types::EnvironmentUpdateNetworkConfigRequest) -> Self {
        self.network_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn set_network_config(mut self, input: ::std::option::Option<crate::types::EnvironmentUpdateNetworkConfigRequest>) -> Self {
        self.network_config = input;
        self
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn get_network_config(&self) -> &::std::option::Option<crate::types::EnvironmentUpdateNetworkConfigRequest> {
        &self.network_config
    }
    /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
            app_name: self.app_name,
            environment_name: self.environment_name,
            environment_role_arn: self.environment_role_arn,
            environment_role_permission_mode: self.environment_role_permission_mode,
            source_config: self.source_config,
            waf_log_configs: self.waf_log_configs,
            gradual_rollout_config: self.gradual_rollout_config,
            web: self.web,
            backend: self.backend,
            network_config: self.network_config,
        })
    }
}