aws_sdk_ec2/operation/describe_customer_gateways/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_customer_gateways::_describe_customer_gateways_output::DescribeCustomerGatewaysOutputBuilder;
3
4pub use crate::operation::describe_customer_gateways::_describe_customer_gateways_input::DescribeCustomerGatewaysInputBuilder;
5
6impl crate::operation::describe_customer_gateways::builders::DescribeCustomerGatewaysInputBuilder {
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::describe_customer_gateways::DescribeCustomerGatewaysOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_customer_gateways::DescribeCustomerGatewaysError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_customer_gateways();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeCustomerGateways`.
24///
25/// <p>Describes one or more of your VPN customer gateways.</p>
26/// <p>For more information, see <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html">Amazon Web Services Site-to-Site VPN</a> in the <i>Amazon Web Services Site-to-Site VPN User Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct DescribeCustomerGatewaysFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::describe_customer_gateways::builders::DescribeCustomerGatewaysInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::describe_customer_gateways::DescribeCustomerGatewaysOutput,
36        crate::operation::describe_customer_gateways::DescribeCustomerGatewaysError,
37    > for DescribeCustomerGatewaysFluentBuilder
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::describe_customer_gateways::DescribeCustomerGatewaysOutput,
45            crate::operation::describe_customer_gateways::DescribeCustomerGatewaysError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl DescribeCustomerGatewaysFluentBuilder {
52    /// Creates a new `DescribeCustomerGatewaysFluentBuilder`.
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 DescribeCustomerGateways as a reference.
61    pub fn as_input(&self) -> &crate::operation::describe_customer_gateways::builders::DescribeCustomerGatewaysInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::describe_customer_gateways::DescribeCustomerGatewaysOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::describe_customer_gateways::DescribeCustomerGatewaysError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::describe_customer_gateways::DescribeCustomerGateways::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::describe_customer_gateways::DescribeCustomerGateways::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::describe_customer_gateways::DescribeCustomerGatewaysOutput,
98        crate::operation::describe_customer_gateways::DescribeCustomerGatewaysError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    ///
113    /// Appends an item to `CustomerGatewayIds`.
114    ///
115    /// To override the contents of this collection use [`set_customer_gateway_ids`](Self::set_customer_gateway_ids).
116    ///
117    /// <p>One or more customer gateway IDs.</p>
118    /// <p>Default: Describes all your customer gateways.</p>
119    pub fn customer_gateway_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.customer_gateway_ids(input.into());
121        self
122    }
123    /// <p>One or more customer gateway IDs.</p>
124    /// <p>Default: Describes all your customer gateways.</p>
125    pub fn set_customer_gateway_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
126        self.inner = self.inner.set_customer_gateway_ids(input);
127        self
128    }
129    /// <p>One or more customer gateway IDs.</p>
130    /// <p>Default: Describes all your customer gateways.</p>
131    pub fn get_customer_gateway_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
132        self.inner.get_customer_gateway_ids()
133    }
134    ///
135    /// Appends an item to `Filters`.
136    ///
137    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
138    ///
139    /// <p>One or more filters.</p>
140    /// <ul>
141    /// <li>
142    /// <p><code>bgp-asn</code> - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).</p></li>
143    /// <li>
144    /// <p><code>customer-gateway-id</code> - The ID of the customer gateway.</p></li>
145    /// <li>
146    /// <p><code>ip-address</code> - The IP address of the customer gateway device's external interface.</p></li>
147    /// <li>
148    /// <p><code>state</code> - The state of the customer gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
149    /// <li>
150    /// <p><code>type</code> - The type of customer gateway. Currently, the only supported type is <code>ipsec.1</code>.</p></li>
151    /// <li>
152    /// <p><code>tag</code>:<key>
153    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
154    /// <code>Owner</code> and the value
155    /// <code>TeamA</code>, specify
156    /// <code>tag:Owner</code> for the filter name and
157    /// <code>TeamA</code> for the filter value.
158    /// </key></p></li>
159    /// <li>
160    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
161    /// </ul>
162    pub fn filters(mut self, input: crate::types::Filter) -> Self {
163        self.inner = self.inner.filters(input);
164        self
165    }
166    /// <p>One or more filters.</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>bgp-asn</code> - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).</p></li>
170    /// <li>
171    /// <p><code>customer-gateway-id</code> - The ID of the customer gateway.</p></li>
172    /// <li>
173    /// <p><code>ip-address</code> - The IP address of the customer gateway device's external interface.</p></li>
174    /// <li>
175    /// <p><code>state</code> - The state of the customer gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
176    /// <li>
177    /// <p><code>type</code> - The type of customer gateway. Currently, the only supported type is <code>ipsec.1</code>.</p></li>
178    /// <li>
179    /// <p><code>tag</code>:<key>
180    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
181    /// <code>Owner</code> and the value
182    /// <code>TeamA</code>, specify
183    /// <code>tag:Owner</code> for the filter name and
184    /// <code>TeamA</code> for the filter value.
185    /// </key></p></li>
186    /// <li>
187    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
188    /// </ul>
189    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
190        self.inner = self.inner.set_filters(input);
191        self
192    }
193    /// <p>One or more filters.</p>
194    /// <ul>
195    /// <li>
196    /// <p><code>bgp-asn</code> - The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).</p></li>
197    /// <li>
198    /// <p><code>customer-gateway-id</code> - The ID of the customer gateway.</p></li>
199    /// <li>
200    /// <p><code>ip-address</code> - The IP address of the customer gateway device's external interface.</p></li>
201    /// <li>
202    /// <p><code>state</code> - The state of the customer gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
203    /// <li>
204    /// <p><code>type</code> - The type of customer gateway. Currently, the only supported type is <code>ipsec.1</code>.</p></li>
205    /// <li>
206    /// <p><code>tag</code>:<key>
207    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
208    /// <code>Owner</code> and the value
209    /// <code>TeamA</code>, specify
210    /// <code>tag:Owner</code> for the filter name and
211    /// <code>TeamA</code> for the filter value.
212    /// </key></p></li>
213    /// <li>
214    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
215    /// </ul>
216    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
217        self.inner.get_filters()
218    }
219    /// <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>
220    pub fn dry_run(mut self, input: bool) -> Self {
221        self.inner = self.inner.dry_run(input);
222        self
223    }
224    /// <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>
225    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
226        self.inner = self.inner.set_dry_run(input);
227        self
228    }
229    /// <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>
230    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
231        self.inner.get_dry_run()
232    }
233}