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 CreateEnvironmentInput {
    /// <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::EnvironmentSourceConfigRequest>,
    /// <p>The gradual rollout settings for the environment.</p>
    pub gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    /// <p>The tags to apply to the resource.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The web hosting settings for the environment.</p>
    pub web: ::std::option::Option<crate::types::EnvironmentWebConfigRequest>,
    /// <p>The VPC network configuration for the environment.</p>
    pub network_config: ::std::option::Option<crate::types::EnvironmentNetworkConfigRequest>,
    /// <p>The backend settings for the environment. You can specify this only when the app has a backend. If you omit this, the default authentication settings and the plan's default database settings are used.</p>
    pub backend: ::std::option::Option<crate::types::EnvironmentBackendConfigRequest>,
}
impl CreateEnvironmentInput {
    /// <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::EnvironmentSourceConfigRequest> {
        self.source_config.as_ref()
    }
    /// <p>The gradual rollout settings for the environment.</p>
    pub fn gradual_rollout_config(&self) -> ::std::option::Option<&crate::types::GradualRolloutConfig> {
        self.gradual_rollout_config.as_ref()
    }
    /// <p>The tags to apply to the resource.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(&self) -> ::std::option::Option<&crate::types::EnvironmentWebConfigRequest> {
        self.web.as_ref()
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(&self) -> ::std::option::Option<&crate::types::EnvironmentNetworkConfigRequest> {
        self.network_config.as_ref()
    }
    /// <p>The backend settings for the environment. You can specify this only when the app has a backend. If you omit this, the default authentication settings and the plan's default database settings are used.</p>
    pub fn backend(&self) -> ::std::option::Option<&crate::types::EnvironmentBackendConfigRequest> {
        self.backend.as_ref()
    }
}
impl CreateEnvironmentInput {
    /// Creates a new builder-style object to manufacture [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
    pub fn builder() -> crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
        crate::operation::create_environment::builders::CreateEnvironmentInputBuilder::default()
    }
}

/// A builder for [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateEnvironmentInputBuilder {
    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::EnvironmentSourceConfigRequest>,
    pub(crate) gradual_rollout_config: ::std::option::Option<crate::types::GradualRolloutConfig>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) web: ::std::option::Option<crate::types::EnvironmentWebConfigRequest>,
    pub(crate) network_config: ::std::option::Option<crate::types::EnvironmentNetworkConfigRequest>,
    pub(crate) backend: ::std::option::Option<crate::types::EnvironmentBackendConfigRequest>,
}
impl CreateEnvironmentInputBuilder {
    /// <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>
    /// This field is required.
    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::EnvironmentSourceConfigRequest) -> 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::EnvironmentSourceConfigRequest>) -> 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::EnvironmentSourceConfigRequest> {
        &self.source_config
    }
    /// <p>The gradual rollout settings for the environment.</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 for the environment.</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 for the environment.</p>
    pub fn get_gradual_rollout_config(&self) -> &::std::option::Option<crate::types::GradualRolloutConfig> {
        &self.gradual_rollout_config
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to apply to the resource.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags to apply to the resource.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags to apply to the resource.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn web(mut self, input: crate::types::EnvironmentWebConfigRequest) -> 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::EnvironmentWebConfigRequest>) -> Self {
        self.web = input;
        self
    }
    /// <p>The web hosting settings for the environment.</p>
    pub fn get_web(&self) -> &::std::option::Option<crate::types::EnvironmentWebConfigRequest> {
        &self.web
    }
    /// <p>The VPC network configuration for the environment.</p>
    pub fn network_config(mut self, input: crate::types::EnvironmentNetworkConfigRequest) -> 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::EnvironmentNetworkConfigRequest>) -> 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::EnvironmentNetworkConfigRequest> {
        &self.network_config
    }
    /// <p>The backend settings for the environment. You can specify this only when the app has a backend. If you omit this, the default authentication settings and the plan's default database settings are used.</p>
    pub fn backend(mut self, input: crate::types::EnvironmentBackendConfigRequest) -> Self {
        self.backend = ::std::option::Option::Some(input);
        self
    }
    /// <p>The backend settings for the environment. You can specify this only when the app has a backend. If you omit this, the default authentication settings and the plan's default database settings are used.</p>
    pub fn set_backend(mut self, input: ::std::option::Option<crate::types::EnvironmentBackendConfigRequest>) -> Self {
        self.backend = input;
        self
    }
    /// <p>The backend settings for the environment. You can specify this only when the app has a backend. If you omit this, the default authentication settings and the plan's default database settings are used.</p>
    pub fn get_backend(&self) -> &::std::option::Option<crate::types::EnvironmentBackendConfigRequest> {
        &self.backend
    }
    /// Consumes the builder and constructs a [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_environment::CreateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_environment::CreateEnvironmentInput {
            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,
            gradual_rollout_config: self.gradual_rollout_config,
            tags: self.tags,
            web: self.web,
            network_config: self.network_config,
            backend: self.backend,
        })
    }
}