aws-sdk-elbproxy 1.0.0

AWS SDK for Elastic Load Balancing for Envoy
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 CreateProxyInput {
    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
    pub name: ::std::option::Option<::std::string::String>,
    /// The type of proxy.
    pub r#type: ::std::option::Option<crate::types::ProxyType>,
    /// The version of the proxy software, in `major.minor` format.
    pub proxy_version: ::std::option::Option<::std::string::String>,
    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// The configuration for the proxy.
    pub configuration: ::std::option::Option<crate::types::ProxyConfiguration>,
    /// The network configuration for the proxy.
    pub network_configuration: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>,
    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
    pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
    pub customer_kms_key_arn: ::std::option::Option<::std::string::String>,
    /// The tags for the proxy.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateProxyInput {
    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The type of proxy.
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ProxyType> {
        self.r#type.as_ref()
    }
    /// The version of the proxy software, in `major.minor` format.
    pub fn proxy_version(&self) -> ::std::option::Option<&str> {
        self.proxy_version.as_deref()
    }
    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// The configuration for the proxy.
    pub fn configuration(&self) -> ::std::option::Option<&crate::types::ProxyConfiguration> {
        self.configuration.as_ref()
    }
    /// The network configuration for the proxy.
    pub fn network_configuration(&self) -> ::std::option::Option<&crate::types::ProxyNetworkUserConfiguration> {
        self.network_configuration.as_ref()
    }
    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes.is_none()`.
    pub fn attributes(&self) -> &[crate::types::Attribute] {
        self.attributes.as_deref().unwrap_or_default()
    }
    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
    pub fn customer_kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.customer_kms_key_arn.as_deref()
    }
    /// The tags for the proxy.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateProxyInput {
    /// Creates a new builder-style object to manufacture [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
    pub fn builder() -> crate::operation::create_proxy::builders::CreateProxyInputBuilder {
        crate::operation::create_proxy::builders::CreateProxyInputBuilder::default()
    }
}

/// A builder for [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateProxyInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::ProxyType>,
    pub(crate) proxy_version: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) configuration: ::std::option::Option<crate::types::ProxyConfiguration>,
    pub(crate) network_configuration: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>,
    pub(crate) attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
    pub(crate) customer_kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateProxyInputBuilder {
    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the proxy. The name must be unique within your account for the Region. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The type of proxy.
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::ProxyType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// The type of proxy.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ProxyType>) -> Self {
        self.r#type = input;
        self
    }
    /// The type of proxy.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ProxyType> {
        &self.r#type
    }
    /// The version of the proxy software, in `major.minor` format.
    /// This field is required.
    pub fn proxy_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.proxy_version = ::std::option::Option::Some(input.into());
        self
    }
    /// The version of the proxy software, in `major.minor` format.
    pub fn set_proxy_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.proxy_version = input;
        self
    }
    /// The version of the proxy software, in `major.minor` format.
    pub fn get_proxy_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.proxy_version
    }
    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
    /// This field is required.
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the IAM role that provides permissions to the code that your Envoy configuration runs on the proxy, such as filters and extensions. These are the permissions that this code needs when it calls AWS services.
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// The configuration for the proxy.
    /// This field is required.
    pub fn configuration(mut self, input: crate::types::ProxyConfiguration) -> Self {
        self.configuration = ::std::option::Option::Some(input);
        self
    }
    /// The configuration for the proxy.
    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::ProxyConfiguration>) -> Self {
        self.configuration = input;
        self
    }
    /// The configuration for the proxy.
    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::ProxyConfiguration> {
        &self.configuration
    }
    /// The network configuration for the proxy.
    /// This field is required.
    pub fn network_configuration(mut self, input: crate::types::ProxyNetworkUserConfiguration) -> Self {
        self.network_configuration = ::std::option::Option::Some(input);
        self
    }
    /// The network configuration for the proxy.
    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::ProxyNetworkUserConfiguration>) -> Self {
        self.network_configuration = input;
        self
    }
    /// The network configuration for the proxy.
    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::ProxyNetworkUserConfiguration> {
        &self.network_configuration
    }
    /// Appends an item to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
    pub fn attributes(mut self, input: crate::types::Attribute) -> Self {
        let mut v = self.attributes.unwrap_or_default();
        v.push(input);
        self.attributes = ::std::option::Option::Some(v);
        self
    }
    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
    pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>) -> Self {
        self.attributes = input;
        self
    }
    /// The attributes for the proxy. Attributes can be changed after creation. Attributes that you don't specify are set to their default values.
    pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attribute>> {
        &self.attributes
    }
    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
    pub fn customer_kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.customer_kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
    pub fn set_customer_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.customer_kms_key_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the customer managed KMS key used to encrypt the proxy's configuration content. If you don't specify a key, the default service-owned key is used.
    pub fn get_customer_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.customer_kms_key_arn
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// The tags for the proxy.
    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
    }
    /// The tags for the proxy.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// The tags for the proxy.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    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
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateProxyInput`](crate::operation::create_proxy::CreateProxyInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_proxy::CreateProxyInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_proxy::CreateProxyInput {
            name: self.name,
            r#type: self.r#type,
            proxy_version: self.proxy_version,
            role_arn: self.role_arn,
            configuration: self.configuration,
            network_configuration: self.network_configuration,
            attributes: self.attributes,
            customer_kms_key_arn: self.customer_kms_key_arn,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}