aws_sdk_directconnect/operation/create_direct_connect_gateway_association_proposal/
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_proposal::_create_direct_connect_gateway_association_proposal_output::CreateDirectConnectGatewayAssociationProposalOutputBuilder;
3
4pub use crate::operation::create_direct_connect_gateway_association_proposal::_create_direct_connect_gateway_association_proposal_input::CreateDirectConnectGatewayAssociationProposalInputBuilder;
5
6impl crate::operation::create_direct_connect_gateway_association_proposal::builders::CreateDirectConnectGatewayAssociationProposalInputBuilder {
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_proposal::CreateDirectConnectGatewayAssociationProposalOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_direct_connect_gateway_association_proposal();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDirectConnectGatewayAssociationProposal`.
24///
25/// <p>Creates a proposal to associate the specified virtual private gateway or transit gateway with the specified Direct Connect gateway.</p>
26/// <p>You can associate a Direct Connect gateway and virtual private gateway or transit gateway that is owned by any Amazon Web Services account.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateDirectConnectGatewayAssociationProposalFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_direct_connect_gateway_association_proposal::builders::CreateDirectConnectGatewayAssociationProposalInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalOutput,
36        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalError,
37    > for CreateDirectConnectGatewayAssociationProposalFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalOutput,
45            crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateDirectConnectGatewayAssociationProposalFluentBuilder {
52    /// Creates a new `CreateDirectConnectGatewayAssociationProposalFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateDirectConnectGatewayAssociationProposal as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::create_direct_connect_gateway_association_proposal::builders::CreateDirectConnectGatewayAssociationProposalInputBuilder
64    {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposal::operation_runtime_plugins(
89                            self.handle.runtime_plugins.clone(),
90                            &self.handle.conf,
91                            self.config_override,
92                        );
93        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposal::orchestrate(
94            &runtime_plugins,
95            input,
96        )
97        .await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalOutput,
105        crate::operation::create_direct_connect_gateway_association_proposal::CreateDirectConnectGatewayAssociationProposalError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The ID of the Direct Connect gateway.</p>
120    pub fn direct_connect_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.direct_connect_gateway_id(input.into());
122        self
123    }
124    /// <p>The ID of the Direct Connect gateway.</p>
125    pub fn set_direct_connect_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_direct_connect_gateway_id(input);
127        self
128    }
129    /// <p>The ID of the Direct Connect gateway.</p>
130    pub fn get_direct_connect_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_direct_connect_gateway_id()
132    }
133    /// <p>The ID of the Amazon Web Services account that owns the Direct Connect gateway.</p>
134    pub fn direct_connect_gateway_owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.direct_connect_gateway_owner_account(input.into());
136        self
137    }
138    /// <p>The ID of the Amazon Web Services account that owns the Direct Connect gateway.</p>
139    pub fn set_direct_connect_gateway_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_direct_connect_gateway_owner_account(input);
141        self
142    }
143    /// <p>The ID of the Amazon Web Services account that owns the Direct Connect gateway.</p>
144    pub fn get_direct_connect_gateway_owner_account(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_direct_connect_gateway_owner_account()
146    }
147    /// <p>The ID of the virtual private gateway or transit gateway.</p>
148    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.gateway_id(input.into());
150        self
151    }
152    /// <p>The ID of the virtual private gateway or transit gateway.</p>
153    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_gateway_id(input);
155        self
156    }
157    /// <p>The ID of the virtual private gateway or transit gateway.</p>
158    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_gateway_id()
160    }
161    ///
162    /// Appends an item to `addAllowedPrefixesToDirectConnectGateway`.
163    ///
164    /// 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).
165    ///
166    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
167    pub fn add_allowed_prefixes_to_direct_connect_gateway(mut self, input: crate::types::RouteFilterPrefix) -> Self {
168        self.inner = self.inner.add_allowed_prefixes_to_direct_connect_gateway(input);
169        self
170    }
171    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
172    pub fn set_add_allowed_prefixes_to_direct_connect_gateway(
173        mut self,
174        input: ::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>>,
175    ) -> Self {
176        self.inner = self.inner.set_add_allowed_prefixes_to_direct_connect_gateway(input);
177        self
178    }
179    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
180    pub fn get_add_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>> {
181        self.inner.get_add_allowed_prefixes_to_direct_connect_gateway()
182    }
183    ///
184    /// Appends an item to `removeAllowedPrefixesToDirectConnectGateway`.
185    ///
186    /// To override the contents of this collection use [`set_remove_allowed_prefixes_to_direct_connect_gateway`](Self::set_remove_allowed_prefixes_to_direct_connect_gateway).
187    ///
188    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
189    pub fn remove_allowed_prefixes_to_direct_connect_gateway(mut self, input: crate::types::RouteFilterPrefix) -> Self {
190        self.inner = self.inner.remove_allowed_prefixes_to_direct_connect_gateway(input);
191        self
192    }
193    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
194    pub fn set_remove_allowed_prefixes_to_direct_connect_gateway(
195        mut self,
196        input: ::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>>,
197    ) -> Self {
198        self.inner = self.inner.set_remove_allowed_prefixes_to_direct_connect_gateway(input);
199        self
200    }
201    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
202    pub fn get_remove_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>> {
203        self.inner.get_remove_allowed_prefixes_to_direct_connect_gateway()
204    }
205}