aws-sdk-lightsail 1.108.0

AWS SDK for Amazon Lightsail
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 CreateLoadBalancerInput {
    /// <p>The name of your load balancer.</p>
    pub load_balancer_name: ::std::option::Option<::std::string::String>,
    /// <p>The instance port where you're creating your load balancer.</p>
    pub instance_port: ::std::option::Option<i32>,
    /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
    /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
    pub health_check_path: ::std::option::Option<::std::string::String>,
    /// <p>The name of the SSL/TLS certificate.</p>
    /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
    pub certificate_name: ::std::option::Option<::std::string::String>,
    /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
    /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
    pub certificate_domain_name: ::std::option::Option<::std::string::String>,
    /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
    pub certificate_alternative_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The tag keys and optional values to add to the resource during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The IP address type for the load balancer.</p>
    /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
    /// <p>The default value is <code>dualstack</code>.</p>
    pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
    /// <p>The name of the TLS policy to apply to the load balancer.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
    /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub tls_policy_name: ::std::option::Option<::std::string::String>,
}
impl CreateLoadBalancerInput {
    /// <p>The name of your load balancer.</p>
    pub fn load_balancer_name(&self) -> ::std::option::Option<&str> {
        self.load_balancer_name.as_deref()
    }
    /// <p>The instance port where you're creating your load balancer.</p>
    pub fn instance_port(&self) -> ::std::option::Option<i32> {
        self.instance_port
    }
    /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
    /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
    pub fn health_check_path(&self) -> ::std::option::Option<&str> {
        self.health_check_path.as_deref()
    }
    /// <p>The name of the SSL/TLS certificate.</p>
    /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
    pub fn certificate_name(&self) -> ::std::option::Option<&str> {
        self.certificate_name.as_deref()
    }
    /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
    /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
    pub fn certificate_domain_name(&self) -> ::std::option::Option<&str> {
        self.certificate_domain_name.as_deref()
    }
    /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</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 `.certificate_alternative_names.is_none()`.
    pub fn certificate_alternative_names(&self) -> &[::std::string::String] {
        self.certificate_alternative_names.as_deref().unwrap_or_default()
    }
    /// <p>The tag keys and optional values to add to the resource during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>The IP address type for the load balancer.</p>
    /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
    /// <p>The default value is <code>dualstack</code>.</p>
    pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
        self.ip_address_type.as_ref()
    }
    /// <p>The name of the TLS policy to apply to the load balancer.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
    /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn tls_policy_name(&self) -> ::std::option::Option<&str> {
        self.tls_policy_name.as_deref()
    }
}
impl CreateLoadBalancerInput {
    /// Creates a new builder-style object to manufacture [`CreateLoadBalancerInput`](crate::operation::create_load_balancer::CreateLoadBalancerInput).
    pub fn builder() -> crate::operation::create_load_balancer::builders::CreateLoadBalancerInputBuilder {
        crate::operation::create_load_balancer::builders::CreateLoadBalancerInputBuilder::default()
    }
}

/// A builder for [`CreateLoadBalancerInput`](crate::operation::create_load_balancer::CreateLoadBalancerInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateLoadBalancerInputBuilder {
    pub(crate) load_balancer_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_port: ::std::option::Option<i32>,
    pub(crate) health_check_path: ::std::option::Option<::std::string::String>,
    pub(crate) certificate_name: ::std::option::Option<::std::string::String>,
    pub(crate) certificate_domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) certificate_alternative_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
    pub(crate) tls_policy_name: ::std::option::Option<::std::string::String>,
}
impl CreateLoadBalancerInputBuilder {
    /// <p>The name of your load balancer.</p>
    /// This field is required.
    pub fn load_balancer_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.load_balancer_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of your load balancer.</p>
    pub fn set_load_balancer_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.load_balancer_name = input;
        self
    }
    /// <p>The name of your load balancer.</p>
    pub fn get_load_balancer_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.load_balancer_name
    }
    /// <p>The instance port where you're creating your load balancer.</p>
    /// This field is required.
    pub fn instance_port(mut self, input: i32) -> Self {
        self.instance_port = ::std::option::Option::Some(input);
        self
    }
    /// <p>The instance port where you're creating your load balancer.</p>
    pub fn set_instance_port(mut self, input: ::std::option::Option<i32>) -> Self {
        self.instance_port = input;
        self
    }
    /// <p>The instance port where you're creating your load balancer.</p>
    pub fn get_instance_port(&self) -> &::std::option::Option<i32> {
        &self.instance_port
    }
    /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
    /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
    pub fn health_check_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.health_check_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
    /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
    pub fn set_health_check_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.health_check_path = input;
        self
    }
    /// <p>The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (<code>"/"</code>).</p>
    /// <p>You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.</p>
    pub fn get_health_check_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.health_check_path
    }
    /// <p>The name of the SSL/TLS certificate.</p>
    /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
    pub fn certificate_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the SSL/TLS certificate.</p>
    /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
    pub fn set_certificate_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_name = input;
        self
    }
    /// <p>The name of the SSL/TLS certificate.</p>
    /// <p>If you specify <code>certificateName</code>, then <code>certificateDomainName</code> is required (and vice-versa).</p>
    pub fn get_certificate_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_name
    }
    /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
    /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
    pub fn certificate_domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
    /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
    pub fn set_certificate_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_domain_name = input;
        self
    }
    /// <p>The domain name with which your certificate is associated (<code>example.com</code>).</p>
    /// <p>If you specify <code>certificateDomainName</code>, then <code>certificateName</code> is required (and vice-versa).</p>
    pub fn get_certificate_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_domain_name
    }
    /// Appends an item to `certificate_alternative_names`.
    ///
    /// To override the contents of this collection use [`set_certificate_alternative_names`](Self::set_certificate_alternative_names).
    ///
    /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
    pub fn certificate_alternative_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.certificate_alternative_names.unwrap_or_default();
        v.push(input.into());
        self.certificate_alternative_names = ::std::option::Option::Some(v);
        self
    }
    /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
    pub fn set_certificate_alternative_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.certificate_alternative_names = input;
        self
    }
    /// <p>The optional alternative domains and subdomains to use with your SSL/TLS certificate (<code>www.example.com</code>, <code>example.com</code>, <code>m.example.com</code>, <code>blog.example.com</code>).</p>
    pub fn get_certificate_alternative_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.certificate_alternative_names
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tag keys and optional values to add to the resource during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tag keys and optional values to add to the resource during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tag keys and optional values to add to the resource during create.</p>
    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The IP address type for the load balancer.</p>
    /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
    /// <p>The default value is <code>dualstack</code>.</p>
    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
        self.ip_address_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The IP address type for the load balancer.</p>
    /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
    /// <p>The default value is <code>dualstack</code>.</p>
    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
        self.ip_address_type = input;
        self
    }
    /// <p>The IP address type for the load balancer.</p>
    /// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
    /// <p>The default value is <code>dualstack</code>.</p>
    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
        &self.ip_address_type
    }
    /// <p>The name of the TLS policy to apply to the load balancer.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
    /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn tls_policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tls_policy_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the TLS policy to apply to the load balancer.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
    /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn set_tls_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tls_policy_name = input;
        self
    }
    /// <p>The name of the TLS policy to apply to the load balancer.</p>
    /// <p>Use the <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html">GetLoadBalancerTlsPolicies</a> action to get a list of TLS policy names that you can specify.</p>
    /// <p>For more information about load balancer TLS policies, see <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy">Configuring TLS security policies on your Amazon Lightsail load balancers</a> in the <i>Amazon Lightsail Developer Guide</i>.</p>
    pub fn get_tls_policy_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.tls_policy_name
    }
    /// Consumes the builder and constructs a [`CreateLoadBalancerInput`](crate::operation::create_load_balancer::CreateLoadBalancerInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_load_balancer::CreateLoadBalancerInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_load_balancer::CreateLoadBalancerInput {
            load_balancer_name: self.load_balancer_name,
            instance_port: self.instance_port,
            health_check_path: self.health_check_path,
            certificate_name: self.certificate_name,
            certificate_domain_name: self.certificate_domain_name,
            certificate_alternative_names: self.certificate_alternative_names,
            tags: self.tags,
            ip_address_type: self.ip_address_type,
            tls_policy_name: self.tls_policy_name,
        })
    }
}