aws_sdk_directconnect/operation/create_direct_connect_gateway_association/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_direct_connect_gateway_association::_create_direct_connect_gateway_association_output::CreateDirectConnectGatewayAssociationOutputBuilder;
3
4pub use crate::operation::create_direct_connect_gateway_association::_create_direct_connect_gateway_association_input::CreateDirectConnectGatewayAssociationInputBuilder;
5
6impl crate::operation::create_direct_connect_gateway_association::builders::CreateDirectConnectGatewayAssociationInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_direct_connect_gateway_association();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDirectConnectGatewayAssociation`.
24///
25/// <p>Creates an association between a Direct Connect gateway and a virtual private gateway. The virtual private gateway must be attached to a VPC and must not be associated with another Direct Connect gateway.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDirectConnectGatewayAssociationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_direct_connect_gateway_association::builders::CreateDirectConnectGatewayAssociationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationOutput,
35        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationError,
36    > for CreateDirectConnectGatewayAssociationFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationOutput,
44            crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateDirectConnectGatewayAssociationFluentBuilder {
51    /// Creates a new `CreateDirectConnectGatewayAssociationFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateDirectConnectGatewayAssociation as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::create_direct_connect_gateway_association::builders::CreateDirectConnectGatewayAssociationInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociation::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociation::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationOutput,
100        crate::operation::create_direct_connect_gateway_association::CreateDirectConnectGatewayAssociationError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The ID of the Direct Connect gateway.</p>
115    pub fn direct_connect_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.direct_connect_gateway_id(input.into());
117        self
118    }
119    /// <p>The ID of the Direct Connect gateway.</p>
120    pub fn set_direct_connect_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_direct_connect_gateway_id(input);
122        self
123    }
124    /// <p>The ID of the Direct Connect gateway.</p>
125    pub fn get_direct_connect_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_direct_connect_gateway_id()
127    }
128    /// <p>The ID of the virtual private gateway or transit gateway.</p>
129    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.gateway_id(input.into());
131        self
132    }
133    /// <p>The ID of the virtual private gateway or transit gateway.</p>
134    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_gateway_id(input);
136        self
137    }
138    /// <p>The ID of the virtual private gateway or transit gateway.</p>
139    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_gateway_id()
141    }
142    ///
143    /// Appends an item to `addAllowedPrefixesToDirectConnectGateway`.
144    ///
145    /// To override the contents of this collection use [`set_add_allowed_prefixes_to_direct_connect_gateway`](Self::set_add_allowed_prefixes_to_direct_connect_gateway).
146    ///
147    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway</p>
148    /// <p>This parameter is required when you create an association to a transit gateway.</p>
149    /// <p>For information about how to set the prefixes, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes">Allowed Prefixes</a> in the <i>Direct Connect User Guide</i>.</p>
150    pub fn add_allowed_prefixes_to_direct_connect_gateway(mut self, input: crate::types::RouteFilterPrefix) -> Self {
151        self.inner = self.inner.add_allowed_prefixes_to_direct_connect_gateway(input);
152        self
153    }
154    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway</p>
155    /// <p>This parameter is required when you create an association to a transit gateway.</p>
156    /// <p>For information about how to set the prefixes, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes">Allowed Prefixes</a> in the <i>Direct Connect User Guide</i>.</p>
157    pub fn set_add_allowed_prefixes_to_direct_connect_gateway(
158        mut self,
159        input: ::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>>,
160    ) -> Self {
161        self.inner = self.inner.set_add_allowed_prefixes_to_direct_connect_gateway(input);
162        self
163    }
164    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway</p>
165    /// <p>This parameter is required when you create an association to a transit gateway.</p>
166    /// <p>For information about how to set the prefixes, see <a href="https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes">Allowed Prefixes</a> in the <i>Direct Connect User Guide</i>.</p>
167    pub fn get_add_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>> {
168        self.inner.get_add_allowed_prefixes_to_direct_connect_gateway()
169    }
170    /// <p>The ID of the virtual private gateway.</p>
171    pub fn virtual_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.virtual_gateway_id(input.into());
173        self
174    }
175    /// <p>The ID of the virtual private gateway.</p>
176    pub fn set_virtual_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_virtual_gateway_id(input);
178        self
179    }
180    /// <p>The ID of the virtual private gateway.</p>
181    pub fn get_virtual_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_virtual_gateway_id()
183    }
184}