aws_sdk_ec2/operation/create_transit_gateway_peering_attachment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_transit_gateway_peering_attachment::_create_transit_gateway_peering_attachment_output::CreateTransitGatewayPeeringAttachmentOutputBuilder;
3
4pub use crate::operation::create_transit_gateway_peering_attachment::_create_transit_gateway_peering_attachment_input::CreateTransitGatewayPeeringAttachmentInputBuilder;
5
6impl crate::operation::create_transit_gateway_peering_attachment::builders::CreateTransitGatewayPeeringAttachmentInputBuilder {
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_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_transit_gateway_peering_attachment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTransitGatewayPeeringAttachment`.
24///
25/// <p>Requests a transit gateway peering attachment between the specified transit gateway (requester) and a peer transit gateway (accepter). The peer transit gateway can be in your account or a different Amazon Web Services account.</p>
26/// <p>After you create the peering attachment, the owner of the accepter transit gateway must accept the attachment request.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateTransitGatewayPeeringAttachmentFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_transit_gateway_peering_attachment::builders::CreateTransitGatewayPeeringAttachmentInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentOutput,
36        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentError,
37    > for CreateTransitGatewayPeeringAttachmentFluentBuilder
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_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentOutput,
45            crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateTransitGatewayPeeringAttachmentFluentBuilder {
52    /// Creates a new `CreateTransitGatewayPeeringAttachmentFluentBuilder`.
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 CreateTransitGatewayPeeringAttachment as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::create_transit_gateway_peering_attachment::builders::CreateTransitGatewayPeeringAttachmentInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins =
88            crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachment::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachment::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentOutput,
101        crate::operation::create_transit_gateway_peering_attachment::CreateTransitGatewayPeeringAttachmentError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The ID of the transit gateway.</p>
116    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.transit_gateway_id(input.into());
118        self
119    }
120    /// <p>The ID of the transit gateway.</p>
121    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_transit_gateway_id(input);
123        self
124    }
125    /// <p>The ID of the transit gateway.</p>
126    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_transit_gateway_id()
128    }
129    /// <p>The ID of the peer transit gateway with which to create the peering attachment.</p>
130    pub fn peer_transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.peer_transit_gateway_id(input.into());
132        self
133    }
134    /// <p>The ID of the peer transit gateway with which to create the peering attachment.</p>
135    pub fn set_peer_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_peer_transit_gateway_id(input);
137        self
138    }
139    /// <p>The ID of the peer transit gateway with which to create the peering attachment.</p>
140    pub fn get_peer_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_peer_transit_gateway_id()
142    }
143    /// <p>The ID of the Amazon Web Services account that owns the peer transit gateway.</p>
144    pub fn peer_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.peer_account_id(input.into());
146        self
147    }
148    /// <p>The ID of the Amazon Web Services account that owns the peer transit gateway.</p>
149    pub fn set_peer_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_peer_account_id(input);
151        self
152    }
153    /// <p>The ID of the Amazon Web Services account that owns the peer transit gateway.</p>
154    pub fn get_peer_account_id(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_peer_account_id()
156    }
157    /// <p>The Region where the peer transit gateway is located.</p>
158    pub fn peer_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.peer_region(input.into());
160        self
161    }
162    /// <p>The Region where the peer transit gateway is located.</p>
163    pub fn set_peer_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_peer_region(input);
165        self
166    }
167    /// <p>The Region where the peer transit gateway is located.</p>
168    pub fn get_peer_region(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_peer_region()
170    }
171    /// <p>Requests a transit gateway peering attachment.</p>
172    pub fn options(mut self, input: crate::types::CreateTransitGatewayPeeringAttachmentRequestOptions) -> Self {
173        self.inner = self.inner.options(input);
174        self
175    }
176    /// <p>Requests a transit gateway peering attachment.</p>
177    pub fn set_options(mut self, input: ::std::option::Option<crate::types::CreateTransitGatewayPeeringAttachmentRequestOptions>) -> Self {
178        self.inner = self.inner.set_options(input);
179        self
180    }
181    /// <p>Requests a transit gateway peering attachment.</p>
182    pub fn get_options(&self) -> &::std::option::Option<crate::types::CreateTransitGatewayPeeringAttachmentRequestOptions> {
183        self.inner.get_options()
184    }
185    ///
186    /// Appends an item to `TagSpecifications`.
187    ///
188    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
189    ///
190    /// <p>The tags to apply to the transit gateway peering attachment.</p>
191    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
192        self.inner = self.inner.tag_specifications(input);
193        self
194    }
195    /// <p>The tags to apply to the transit gateway peering attachment.</p>
196    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
197        self.inner = self.inner.set_tag_specifications(input);
198        self
199    }
200    /// <p>The tags to apply to the transit gateway peering attachment.</p>
201    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
202        self.inner.get_tag_specifications()
203    }
204    /// <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>
205    pub fn dry_run(mut self, input: bool) -> Self {
206        self.inner = self.inner.dry_run(input);
207        self
208    }
209    /// <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>
210    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
211        self.inner = self.inner.set_dry_run(input);
212        self
213    }
214    /// <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>
215    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
216        self.inner.get_dry_run()
217    }
218}