aws-sdk-lambda 1.121.0

AWS SDK for AWS Lambda
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 CreateCapacityProviderInput {
    /// <p>The name of the capacity provider.</p>
    pub capacity_provider_name: ::std::option::Option<::std::string::String>,
    /// <p>The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.</p>
    pub vpc_config: ::std::option::Option<crate::types::CapacityProviderVpcConfig>,
    /// <p>The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.</p>
    pub permissions_config: ::std::option::Option<crate::types::CapacityProviderPermissionsConfig>,
    /// <p>The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.</p>
    pub instance_requirements: ::std::option::Option<crate::types::InstanceRequirements>,
    /// <p>The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.</p>
    pub capacity_provider_scaling_config: ::std::option::Option<crate::types::CapacityProviderScalingConfig>,
    /// <p>The ARN of the KMS key used to encrypt data associated with the capacity provider.</p>
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
    /// <p>A list of tags to associate with the capacity provider.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateCapacityProviderInput {
    /// <p>The name of the capacity provider.</p>
    pub fn capacity_provider_name(&self) -> ::std::option::Option<&str> {
        self.capacity_provider_name.as_deref()
    }
    /// <p>The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.</p>
    pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::CapacityProviderVpcConfig> {
        self.vpc_config.as_ref()
    }
    /// <p>The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.</p>
    pub fn permissions_config(&self) -> ::std::option::Option<&crate::types::CapacityProviderPermissionsConfig> {
        self.permissions_config.as_ref()
    }
    /// <p>The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.</p>
    pub fn instance_requirements(&self) -> ::std::option::Option<&crate::types::InstanceRequirements> {
        self.instance_requirements.as_ref()
    }
    /// <p>The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.</p>
    pub fn capacity_provider_scaling_config(&self) -> ::std::option::Option<&crate::types::CapacityProviderScalingConfig> {
        self.capacity_provider_scaling_config.as_ref()
    }
    /// <p>The ARN of the KMS key used to encrypt data associated with the capacity provider.</p>
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
    /// <p>A list of tags to associate with the capacity provider.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateCapacityProviderInput {
    /// Creates a new builder-style object to manufacture [`CreateCapacityProviderInput`](crate::operation::create_capacity_provider::CreateCapacityProviderInput).
    pub fn builder() -> crate::operation::create_capacity_provider::builders::CreateCapacityProviderInputBuilder {
        crate::operation::create_capacity_provider::builders::CreateCapacityProviderInputBuilder::default()
    }
}

/// A builder for [`CreateCapacityProviderInput`](crate::operation::create_capacity_provider::CreateCapacityProviderInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCapacityProviderInputBuilder {
    pub(crate) capacity_provider_name: ::std::option::Option<::std::string::String>,
    pub(crate) vpc_config: ::std::option::Option<crate::types::CapacityProviderVpcConfig>,
    pub(crate) permissions_config: ::std::option::Option<crate::types::CapacityProviderPermissionsConfig>,
    pub(crate) instance_requirements: ::std::option::Option<crate::types::InstanceRequirements>,
    pub(crate) capacity_provider_scaling_config: ::std::option::Option<crate::types::CapacityProviderScalingConfig>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateCapacityProviderInputBuilder {
    /// <p>The name of the capacity provider.</p>
    /// This field is required.
    pub fn capacity_provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.capacity_provider_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the capacity provider.</p>
    pub fn set_capacity_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.capacity_provider_name = input;
        self
    }
    /// <p>The name of the capacity provider.</p>
    pub fn get_capacity_provider_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.capacity_provider_name
    }
    /// <p>The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.</p>
    /// This field is required.
    pub fn vpc_config(mut self, input: crate::types::CapacityProviderVpcConfig) -> Self {
        self.vpc_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.</p>
    pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::CapacityProviderVpcConfig>) -> Self {
        self.vpc_config = input;
        self
    }
    /// <p>The VPC configuration for the capacity provider, including subnet IDs and security group IDs where compute instances will be launched.</p>
    pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::CapacityProviderVpcConfig> {
        &self.vpc_config
    }
    /// <p>The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.</p>
    /// This field is required.
    pub fn permissions_config(mut self, input: crate::types::CapacityProviderPermissionsConfig) -> Self {
        self.permissions_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.</p>
    pub fn set_permissions_config(mut self, input: ::std::option::Option<crate::types::CapacityProviderPermissionsConfig>) -> Self {
        self.permissions_config = input;
        self
    }
    /// <p>The permissions configuration that specifies the IAM role ARN used by the capacity provider to manage compute resources.</p>
    pub fn get_permissions_config(&self) -> &::std::option::Option<crate::types::CapacityProviderPermissionsConfig> {
        &self.permissions_config
    }
    /// <p>The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.</p>
    pub fn instance_requirements(mut self, input: crate::types::InstanceRequirements) -> Self {
        self.instance_requirements = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.</p>
    pub fn set_instance_requirements(mut self, input: ::std::option::Option<crate::types::InstanceRequirements>) -> Self {
        self.instance_requirements = input;
        self
    }
    /// <p>The instance requirements that specify the compute instance characteristics, including architectures and allowed or excluded instance types.</p>
    pub fn get_instance_requirements(&self) -> &::std::option::Option<crate::types::InstanceRequirements> {
        &self.instance_requirements
    }
    /// <p>The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.</p>
    pub fn capacity_provider_scaling_config(mut self, input: crate::types::CapacityProviderScalingConfig) -> Self {
        self.capacity_provider_scaling_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.</p>
    pub fn set_capacity_provider_scaling_config(mut self, input: ::std::option::Option<crate::types::CapacityProviderScalingConfig>) -> Self {
        self.capacity_provider_scaling_config = input;
        self
    }
    /// <p>The scaling configuration that defines how the capacity provider scales compute instances, including maximum vCPU count and scaling policies.</p>
    pub fn get_capacity_provider_scaling_config(&self) -> &::std::option::Option<crate::types::CapacityProviderScalingConfig> {
        &self.capacity_provider_scaling_config
    }
    /// <p>The ARN of the KMS key used to encrypt data associated with the capacity provider.</p>
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the KMS key used to encrypt data associated with the capacity provider.</p>
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// <p>The ARN of the KMS key used to encrypt data associated with the capacity provider.</p>
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of tags to associate with the capacity provider.</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>A list of tags to associate with the capacity provider.</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>A list of tags to associate with the capacity provider.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateCapacityProviderInput`](crate::operation::create_capacity_provider::CreateCapacityProviderInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_capacity_provider::CreateCapacityProviderInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_capacity_provider::CreateCapacityProviderInput {
            capacity_provider_name: self.capacity_provider_name,
            vpc_config: self.vpc_config,
            permissions_config: self.permissions_config,
            instance_requirements: self.instance_requirements,
            capacity_provider_scaling_config: self.capacity_provider_scaling_config,
            kms_key_arn: self.kms_key_arn,
            tags: self.tags,
        })
    }
}