aws-sdk-ec2 1.224.0

AWS SDK for Amazon Elastic Compute Cloud
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 CreateRouteServerInput {
    /// <p>The private Autonomous System Number (ASN) for the Amazon side of the BGP session. Valid values are from 1 to 4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range.</p>
    pub amazon_side_asn: ::std::option::Option<i64>,
    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>A check for 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>,
    /// <p>Indicates whether routes should be persisted after all BGP sessions are terminated.</p>
    pub persist_routes: ::std::option::Option<crate::types::RouteServerPersistRoutesAction>,
    /// <p>The number of minutes a route server will wait after BGP is re-established to unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. Required if PersistRoutes is <code>enabled</code>.</p>
    /// <p>If you set the duration to 1 minute, then when your network appliance re-establishes BGP with route server, it has 1 minute to relearn it's adjacent network and advertise those routes to route server before route server resumes normal functionality. In most cases, 1 minute is probably sufficient. If, however, you have concerns that your BGP network may not be capable of fully re-establishing and re-learning everything in 1 minute, you can increase the duration up to 5 minutes.</p>
    pub persist_routes_duration: ::std::option::Option<i64>,
    /// <p>Indicates whether SNS notifications should be enabled for route server events. Enabling SNS notifications persists BGP status changes to an SNS topic provisioned by Amazon Web Services.</p>
    pub sns_notifications_enabled: ::std::option::Option<bool>,
    /// <p>The tags to apply to the route server during creation.</p>
    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl CreateRouteServerInput {
    /// <p>The private Autonomous System Number (ASN) for the Amazon side of the BGP session. Valid values are from 1 to 4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range.</p>
    pub fn amazon_side_asn(&self) -> ::std::option::Option<i64> {
        self.amazon_side_asn
    }
    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>A check for 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
    }
    /// <p>Indicates whether routes should be persisted after all BGP sessions are terminated.</p>
    pub fn persist_routes(&self) -> ::std::option::Option<&crate::types::RouteServerPersistRoutesAction> {
        self.persist_routes.as_ref()
    }
    /// <p>The number of minutes a route server will wait after BGP is re-established to unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. Required if PersistRoutes is <code>enabled</code>.</p>
    /// <p>If you set the duration to 1 minute, then when your network appliance re-establishes BGP with route server, it has 1 minute to relearn it's adjacent network and advertise those routes to route server before route server resumes normal functionality. In most cases, 1 minute is probably sufficient. If, however, you have concerns that your BGP network may not be capable of fully re-establishing and re-learning everything in 1 minute, you can increase the duration up to 5 minutes.</p>
    pub fn persist_routes_duration(&self) -> ::std::option::Option<i64> {
        self.persist_routes_duration
    }
    /// <p>Indicates whether SNS notifications should be enabled for route server events. Enabling SNS notifications persists BGP status changes to an SNS topic provisioned by Amazon Web Services.</p>
    pub fn sns_notifications_enabled(&self) -> ::std::option::Option<bool> {
        self.sns_notifications_enabled
    }
    /// <p>The tags to apply to the route server during creation.</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()
    }
}
impl CreateRouteServerInput {
    /// Creates a new builder-style object to manufacture [`CreateRouteServerInput`](crate::operation::create_route_server::CreateRouteServerInput).
    pub fn builder() -> crate::operation::create_route_server::builders::CreateRouteServerInputBuilder {
        crate::operation::create_route_server::builders::CreateRouteServerInputBuilder::default()
    }
}

/// A builder for [`CreateRouteServerInput`](crate::operation::create_route_server::CreateRouteServerInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateRouteServerInputBuilder {
    pub(crate) amazon_side_asn: ::std::option::Option<i64>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) dry_run: ::std::option::Option<bool>,
    pub(crate) persist_routes: ::std::option::Option<crate::types::RouteServerPersistRoutesAction>,
    pub(crate) persist_routes_duration: ::std::option::Option<i64>,
    pub(crate) sns_notifications_enabled: ::std::option::Option<bool>,
    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl CreateRouteServerInputBuilder {
    /// <p>The private Autonomous System Number (ASN) for the Amazon side of the BGP session. Valid values are from 1 to 4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range.</p>
    /// This field is required.
    pub fn amazon_side_asn(mut self, input: i64) -> Self {
        self.amazon_side_asn = ::std::option::Option::Some(input);
        self
    }
    /// <p>The private Autonomous System Number (ASN) for the Amazon side of the BGP session. Valid values are from 1 to 4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range.</p>
    pub fn set_amazon_side_asn(mut self, input: ::std::option::Option<i64>) -> Self {
        self.amazon_side_asn = input;
        self
    }
    /// <p>The private Autonomous System Number (ASN) for the Amazon side of the BGP session. Valid values are from 1 to 4294967295. We recommend using a private ASN in the 64512–65534 (16-bit ASN) or 4200000000–4294967294 (32-bit ASN) range.</p>
    pub fn get_amazon_side_asn(&self) -> &::std::option::Option<i64> {
        &self.amazon_side_asn
    }
    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
    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
    }
    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>A check for 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>A check for 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>A check for 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
    }
    /// <p>Indicates whether routes should be persisted after all BGP sessions are terminated.</p>
    pub fn persist_routes(mut self, input: crate::types::RouteServerPersistRoutesAction) -> Self {
        self.persist_routes = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether routes should be persisted after all BGP sessions are terminated.</p>
    pub fn set_persist_routes(mut self, input: ::std::option::Option<crate::types::RouteServerPersistRoutesAction>) -> Self {
        self.persist_routes = input;
        self
    }
    /// <p>Indicates whether routes should be persisted after all BGP sessions are terminated.</p>
    pub fn get_persist_routes(&self) -> &::std::option::Option<crate::types::RouteServerPersistRoutesAction> {
        &self.persist_routes
    }
    /// <p>The number of minutes a route server will wait after BGP is re-established to unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. Required if PersistRoutes is <code>enabled</code>.</p>
    /// <p>If you set the duration to 1 minute, then when your network appliance re-establishes BGP with route server, it has 1 minute to relearn it's adjacent network and advertise those routes to route server before route server resumes normal functionality. In most cases, 1 minute is probably sufficient. If, however, you have concerns that your BGP network may not be capable of fully re-establishing and re-learning everything in 1 minute, you can increase the duration up to 5 minutes.</p>
    pub fn persist_routes_duration(mut self, input: i64) -> Self {
        self.persist_routes_duration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of minutes a route server will wait after BGP is re-established to unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. Required if PersistRoutes is <code>enabled</code>.</p>
    /// <p>If you set the duration to 1 minute, then when your network appliance re-establishes BGP with route server, it has 1 minute to relearn it's adjacent network and advertise those routes to route server before route server resumes normal functionality. In most cases, 1 minute is probably sufficient. If, however, you have concerns that your BGP network may not be capable of fully re-establishing and re-learning everything in 1 minute, you can increase the duration up to 5 minutes.</p>
    pub fn set_persist_routes_duration(mut self, input: ::std::option::Option<i64>) -> Self {
        self.persist_routes_duration = input;
        self
    }
    /// <p>The number of minutes a route server will wait after BGP is re-established to unpersist the routes in the FIB and RIB. Value must be in the range of 1-5. Required if PersistRoutes is <code>enabled</code>.</p>
    /// <p>If you set the duration to 1 minute, then when your network appliance re-establishes BGP with route server, it has 1 minute to relearn it's adjacent network and advertise those routes to route server before route server resumes normal functionality. In most cases, 1 minute is probably sufficient. If, however, you have concerns that your BGP network may not be capable of fully re-establishing and re-learning everything in 1 minute, you can increase the duration up to 5 minutes.</p>
    pub fn get_persist_routes_duration(&self) -> &::std::option::Option<i64> {
        &self.persist_routes_duration
    }
    /// <p>Indicates whether SNS notifications should be enabled for route server events. Enabling SNS notifications persists BGP status changes to an SNS topic provisioned by Amazon Web Services.</p>
    pub fn sns_notifications_enabled(mut self, input: bool) -> Self {
        self.sns_notifications_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether SNS notifications should be enabled for route server events. Enabling SNS notifications persists BGP status changes to an SNS topic provisioned by Amazon Web Services.</p>
    pub fn set_sns_notifications_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.sns_notifications_enabled = input;
        self
    }
    /// <p>Indicates whether SNS notifications should be enabled for route server events. Enabling SNS notifications persists BGP status changes to an SNS topic provisioned by Amazon Web Services.</p>
    pub fn get_sns_notifications_enabled(&self) -> &::std::option::Option<bool> {
        &self.sns_notifications_enabled
    }
    /// 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 route server during creation.</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 route server during creation.</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 route server during creation.</p>
    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
        &self.tag_specifications
    }
    /// Consumes the builder and constructs a [`CreateRouteServerInput`](crate::operation::create_route_server::CreateRouteServerInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_route_server::CreateRouteServerInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_route_server::CreateRouteServerInput {
            amazon_side_asn: self.amazon_side_asn,
            client_token: self.client_token,
            dry_run: self.dry_run,
            persist_routes: self.persist_routes,
            persist_routes_duration: self.persist_routes_duration,
            sns_notifications_enabled: self.sns_notifications_enabled,
            tag_specifications: self.tag_specifications,
        })
    }
}