aws_sdk_directconnect/operation/update_direct_connect_gateway_association/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_direct_connect_gateway_association::_update_direct_connect_gateway_association_output::UpdateDirectConnectGatewayAssociationOutputBuilder;
3
4pub use crate::operation::update_direct_connect_gateway_association::_update_direct_connect_gateway_association_input::UpdateDirectConnectGatewayAssociationInputBuilder;
5
6impl crate::operation::update_direct_connect_gateway_association::builders::UpdateDirectConnectGatewayAssociationInputBuilder {
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::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_direct_connect_gateway_association();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateDirectConnectGatewayAssociation`.
24///
25/// <p>Updates the specified attributes of the Direct Connect gateway association.</p>
26/// <p>Add or remove prefixes from the association.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateDirectConnectGatewayAssociationFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_direct_connect_gateway_association::builders::UpdateDirectConnectGatewayAssociationInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationOutput,
36        crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationError,
37    > for UpdateDirectConnectGatewayAssociationFluentBuilder
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::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationOutput,
45            crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl UpdateDirectConnectGatewayAssociationFluentBuilder {
52    /// Creates a new `UpdateDirectConnectGatewayAssociationFluentBuilder`.
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 UpdateDirectConnectGatewayAssociation as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::update_direct_connect_gateway_association::builders::UpdateDirectConnectGatewayAssociationInputBuilder {
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::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationError,
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::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociation::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociation::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::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationOutput,
101        crate::operation::update_direct_connect_gateway_association::UpdateDirectConnectGatewayAssociationError,
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    ///
130    /// Appends an item to `addAllowedPrefixesToDirectConnectGateway`.
131    ///
132    /// 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).
133    ///
134    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
135    pub fn add_allowed_prefixes_to_direct_connect_gateway(mut self, input: crate::types::RouteFilterPrefix) -> Self {
136        self.inner = self.inner.add_allowed_prefixes_to_direct_connect_gateway(input);
137        self
138    }
139    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
140    pub fn set_add_allowed_prefixes_to_direct_connect_gateway(
141        mut self,
142        input: ::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>>,
143    ) -> Self {
144        self.inner = self.inner.set_add_allowed_prefixes_to_direct_connect_gateway(input);
145        self
146    }
147    /// <p>The Amazon VPC prefixes to advertise to the Direct Connect gateway.</p>
148    pub fn get_add_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>> {
149        self.inner.get_add_allowed_prefixes_to_direct_connect_gateway()
150    }
151    ///
152    /// Appends an item to `removeAllowedPrefixesToDirectConnectGateway`.
153    ///
154    /// 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).
155    ///
156    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
157    pub fn remove_allowed_prefixes_to_direct_connect_gateway(mut self, input: crate::types::RouteFilterPrefix) -> Self {
158        self.inner = self.inner.remove_allowed_prefixes_to_direct_connect_gateway(input);
159        self
160    }
161    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
162    pub fn set_remove_allowed_prefixes_to_direct_connect_gateway(
163        mut self,
164        input: ::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>>,
165    ) -> Self {
166        self.inner = self.inner.set_remove_allowed_prefixes_to_direct_connect_gateway(input);
167        self
168    }
169    /// <p>The Amazon VPC prefixes to no longer advertise to the Direct Connect gateway.</p>
170    pub fn get_remove_allowed_prefixes_to_direct_connect_gateway(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RouteFilterPrefix>> {
171        self.inner.get_remove_allowed_prefixes_to_direct_connect_gateway()
172    }
173}