aws_sdk_directconnect/operation/delete_direct_connect_gateway_association/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_direct_connect_gateway_association::_delete_direct_connect_gateway_association_output::DeleteDirectConnectGatewayAssociationOutputBuilder;
3
4pub use crate::operation::delete_direct_connect_gateway_association::_delete_direct_connect_gateway_association_input::DeleteDirectConnectGatewayAssociationInputBuilder;
5
6impl crate::operation::delete_direct_connect_gateway_association::builders::DeleteDirectConnectGatewayAssociationInputBuilder {
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::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_direct_connect_gateway_association();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteDirectConnectGatewayAssociation`.
24///
25/// <p>Deletes the association between the specified Direct Connect gateway and virtual private gateway.</p>
26/// <p>We recommend that you specify the <code>associationID</code> to delete the association. Alternatively, if you own virtual gateway and a Direct Connect gateway association, you can specify the <code>virtualGatewayId</code> and <code>directConnectGatewayId</code> to delete an association.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct DeleteDirectConnectGatewayAssociationFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::delete_direct_connect_gateway_association::builders::DeleteDirectConnectGatewayAssociationInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationOutput,
36        crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationError,
37    > for DeleteDirectConnectGatewayAssociationFluentBuilder
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::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationOutput,
45            crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl DeleteDirectConnectGatewayAssociationFluentBuilder {
52    /// Creates a new `DeleteDirectConnectGatewayAssociationFluentBuilder`.
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 DeleteDirectConnectGatewayAssociation as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::delete_direct_connect_gateway_association::builders::DeleteDirectConnectGatewayAssociationInputBuilder {
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::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationError,
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::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociation::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociation::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::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationOutput,
101        crate::operation::delete_direct_connect_gateway_association::DeleteDirectConnectGatewayAssociationError,
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 Direct Connect gateway association.</p>
116    pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.association_id(input.into());
118        self
119    }
120    /// <p>The ID of the Direct Connect gateway association.</p>
121    pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_association_id(input);
123        self
124    }
125    /// <p>The ID of the Direct Connect gateway association.</p>
126    pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_association_id()
128    }
129    /// <p>The ID of the Direct Connect gateway.</p>
130    pub fn direct_connect_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.direct_connect_gateway_id(input.into());
132        self
133    }
134    /// <p>The ID of the Direct Connect gateway.</p>
135    pub fn set_direct_connect_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_direct_connect_gateway_id(input);
137        self
138    }
139    /// <p>The ID of the Direct Connect gateway.</p>
140    pub fn get_direct_connect_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_direct_connect_gateway_id()
142    }
143    /// <p>The ID of the virtual private gateway.</p>
144    pub fn virtual_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.virtual_gateway_id(input.into());
146        self
147    }
148    /// <p>The ID of the virtual private gateway.</p>
149    pub fn set_virtual_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_virtual_gateway_id(input);
151        self
152    }
153    /// <p>The ID of the virtual private gateway.</p>
154    pub fn get_virtual_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_virtual_gateway_id()
156    }
157}