aws-sdk-ec2 1.221.0

AWS SDK for Amazon Elastic Compute Cloud
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Contains the parameters for CreateCustomerGateway.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCustomerGatewayInput {
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Default: 65000</p>
    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
    pub bgp_asn: ::std::option::Option<i32>,
    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
    pub public_ip: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
    pub certificate_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
    pub r#type: ::std::option::Option<crate::types::GatewayType>,
    /// <p>The tags to apply to the customer gateway.</p>
    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
    /// <p>A name for the customer gateway device.</p>
    /// <p>Length Constraints: Up to 255 characters.</p>
    pub device_name: ::std::option::Option<::std::string::String>,
    /// <p>The IP address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>Ipv6</code>, you can use an IPv6 address.</p>
    pub ip_address: ::std::option::Option<::std::string::String>,
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
    pub bgp_asn_extended: ::std::option::Option<i64>,
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub dry_run: ::std::option::Option<bool>,
}
impl CreateCustomerGatewayInput {
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Default: 65000</p>
    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
    pub fn bgp_asn(&self) -> ::std::option::Option<i32> {
        self.bgp_asn
    }
    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
    pub fn public_ip(&self) -> ::std::option::Option<&str> {
        self.public_ip.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
    pub fn certificate_arn(&self) -> ::std::option::Option<&str> {
        self.certificate_arn.as_deref()
    }
    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::GatewayType> {
        self.r#type.as_ref()
    }
    /// <p>The tags to apply to the customer gateway.</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 `.tag_specifications.is_none()`.
    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
        self.tag_specifications.as_deref().unwrap_or_default()
    }
    /// <p>A name for the customer gateway device.</p>
    /// <p>Length Constraints: Up to 255 characters.</p>
    pub fn device_name(&self) -> ::std::option::Option<&str> {
        self.device_name.as_deref()
    }
    /// <p>The IP address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>Ipv6</code>, you can use an IPv6 address.</p>
    pub fn ip_address(&self) -> ::std::option::Option<&str> {
        self.ip_address.as_deref()
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
    pub fn bgp_asn_extended(&self) -> ::std::option::Option<i64> {
        self.bgp_asn_extended
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(&self) -> ::std::option::Option<bool> {
        self.dry_run
    }
}
impl CreateCustomerGatewayInput {
    /// Creates a new builder-style object to manufacture [`CreateCustomerGatewayInput`](crate::operation::create_customer_gateway::CreateCustomerGatewayInput).
    pub fn builder() -> crate::operation::create_customer_gateway::builders::CreateCustomerGatewayInputBuilder {
        crate::operation::create_customer_gateway::builders::CreateCustomerGatewayInputBuilder::default()
    }
}

/// A builder for [`CreateCustomerGatewayInput`](crate::operation::create_customer_gateway::CreateCustomerGatewayInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCustomerGatewayInputBuilder {
    pub(crate) bgp_asn: ::std::option::Option<i32>,
    pub(crate) public_ip: ::std::option::Option<::std::string::String>,
    pub(crate) certificate_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::GatewayType>,
    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
    pub(crate) device_name: ::std::option::Option<::std::string::String>,
    pub(crate) ip_address: ::std::option::Option<::std::string::String>,
    pub(crate) bgp_asn_extended: ::std::option::Option<i64>,
    pub(crate) dry_run: ::std::option::Option<bool>,
}
impl CreateCustomerGatewayInputBuilder {
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Default: 65000</p>
    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
    pub fn bgp_asn(mut self, input: i32) -> Self {
        self.bgp_asn = ::std::option::Option::Some(input);
        self
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Default: 65000</p>
    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
    pub fn set_bgp_asn(mut self, input: ::std::option::Option<i32>) -> Self {
        self.bgp_asn = input;
        self
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Default: 65000</p>
    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
    pub fn get_bgp_asn(&self) -> &::std::option::Option<i32> {
        &self.bgp_asn
    }
    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
    pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.public_ip = ::std::option::Option::Some(input.into());
        self
    }
    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
    pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.public_ip = input;
        self
    }
    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
    pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
        &self.public_ip
    }
    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
    pub fn certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
    pub fn set_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
    pub fn get_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_arn
    }
    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::GatewayType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::GatewayType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::GatewayType> {
        &self.r#type
    }
    /// Appends an item to `tag_specifications`.
    ///
    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
    ///
    /// <p>The tags to apply to the customer gateway.</p>
    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
        let mut v = self.tag_specifications.unwrap_or_default();
        v.push(input);
        self.tag_specifications = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tags to apply to the customer gateway.</p>
    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
        self.tag_specifications = input;
        self
    }
    /// <p>The tags to apply to the customer gateway.</p>
    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
        &self.tag_specifications
    }
    /// <p>A name for the customer gateway device.</p>
    /// <p>Length Constraints: Up to 255 characters.</p>
    pub fn device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.device_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A name for the customer gateway device.</p>
    /// <p>Length Constraints: Up to 255 characters.</p>
    pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.device_name = input;
        self
    }
    /// <p>A name for the customer gateway device.</p>
    /// <p>Length Constraints: Up to 255 characters.</p>
    pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.device_name
    }
    /// <p>The IP address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>Ipv6</code>, you can use an IPv6 address.</p>
    pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ip_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>Ipv6</code>, you can use an IPv6 address.</p>
    pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ip_address = input;
        self
    }
    /// <p>The IP address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>Ipv6</code>, you can use an IPv6 address.</p>
    pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.ip_address
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
    pub fn bgp_asn_extended(mut self, input: i64) -> Self {
        self.bgp_asn_extended = ::std::option::Option::Some(input);
        self
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
    pub fn set_bgp_asn_extended(mut self, input: ::std::option::Option<i64>) -> Self {
        self.bgp_asn_extended = input;
        self
    }
    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
    pub fn get_bgp_asn_extended(&self) -> &::std::option::Option<i64> {
        &self.bgp_asn_extended
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// Consumes the builder and constructs a [`CreateCustomerGatewayInput`](crate::operation::create_customer_gateway::CreateCustomerGatewayInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_customer_gateway::CreateCustomerGatewayInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_customer_gateway::CreateCustomerGatewayInput {
            bgp_asn: self.bgp_asn,
            public_ip: self.public_ip,
            certificate_arn: self.certificate_arn,
            r#type: self.r#type,
            tag_specifications: self.tag_specifications,
            device_name: self.device_name,
            ip_address: self.ip_address,
            bgp_asn_extended: self.bgp_asn_extended,
            dry_run: self.dry_run,
        })
    }
}