aws_sdk_ec2/operation/describe_vpn_gateways/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_vpn_gateways::_describe_vpn_gateways_output::DescribeVpnGatewaysOutputBuilder;
3
4pub use crate::operation::describe_vpn_gateways::_describe_vpn_gateways_input::DescribeVpnGatewaysInputBuilder;
5
6impl crate::operation::describe_vpn_gateways::builders::DescribeVpnGatewaysInputBuilder {
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_vpn_gateways::DescribeVpnGatewaysOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_vpn_gateways();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeVpnGateways`.
24///
25/// <p>Describes one or more of your virtual private 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 DescribeVpnGatewaysFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::describe_vpn_gateways::builders::DescribeVpnGatewaysInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysOutput,
36 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysError,
37 > for DescribeVpnGatewaysFluentBuilder
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_vpn_gateways::DescribeVpnGatewaysOutput,
45 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl DescribeVpnGatewaysFluentBuilder {
52 /// Creates a new `DescribeVpnGatewaysFluentBuilder`.
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 DescribeVpnGateways as a reference.
61 pub fn as_input(&self) -> &crate::operation::describe_vpn_gateways::builders::DescribeVpnGatewaysInputBuilder {
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_vpn_gateways::DescribeVpnGatewaysOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysError,
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_vpn_gateways::DescribeVpnGateways::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::describe_vpn_gateways::DescribeVpnGateways::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_vpn_gateways::DescribeVpnGatewaysOutput,
98 crate::operation::describe_vpn_gateways::DescribeVpnGatewaysError,
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 `Filters`.
114 ///
115 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
116 ///
117 /// <p>One or more filters.</p>
118 /// <ul>
119 /// <li>
120 /// <p><code>amazon-side-asn</code> - The Autonomous System Number (ASN) for the Amazon side of the gateway.</p></li>
121 /// <li>
122 /// <p><code>attachment.state</code> - The current state of the attachment between the gateway and the VPC (<code>attaching</code> | <code>attached</code> | <code>detaching</code> | <code>detached</code>).</p></li>
123 /// <li>
124 /// <p><code>attachment.vpc-id</code> - The ID of an attached VPC.</p></li>
125 /// <li>
126 /// <p><code>availability-zone</code> - The Availability Zone for the virtual private gateway (if applicable).</p></li>
127 /// <li>
128 /// <p><code>state</code> - The state of the virtual private gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
129 /// <li>
130 /// <p><code>tag</code>:<key>
131 /// - 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
132 /// <code>Owner</code> and the value
133 /// <code>TeamA</code>, specify
134 /// <code>tag:Owner</code> for the filter name and
135 /// <code>TeamA</code> for the filter value.
136 /// </key></p></li>
137 /// <li>
138 /// <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>
139 /// <li>
140 /// <p><code>type</code> - The type of virtual private gateway. Currently the only supported type is <code>ipsec.1</code>.</p></li>
141 /// <li>
142 /// <p><code>vpn-gateway-id</code> - The ID of the virtual private gateway.</p></li>
143 /// </ul>
144 pub fn filters(mut self, input: crate::types::Filter) -> Self {
145 self.inner = self.inner.filters(input);
146 self
147 }
148 /// <p>One or more filters.</p>
149 /// <ul>
150 /// <li>
151 /// <p><code>amazon-side-asn</code> - The Autonomous System Number (ASN) for the Amazon side of the gateway.</p></li>
152 /// <li>
153 /// <p><code>attachment.state</code> - The current state of the attachment between the gateway and the VPC (<code>attaching</code> | <code>attached</code> | <code>detaching</code> | <code>detached</code>).</p></li>
154 /// <li>
155 /// <p><code>attachment.vpc-id</code> - The ID of an attached VPC.</p></li>
156 /// <li>
157 /// <p><code>availability-zone</code> - The Availability Zone for the virtual private gateway (if applicable).</p></li>
158 /// <li>
159 /// <p><code>state</code> - The state of the virtual private gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
160 /// <li>
161 /// <p><code>tag</code>:<key>
162 /// - 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
163 /// <code>Owner</code> and the value
164 /// <code>TeamA</code>, specify
165 /// <code>tag:Owner</code> for the filter name and
166 /// <code>TeamA</code> for the filter value.
167 /// </key></p></li>
168 /// <li>
169 /// <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>
170 /// <li>
171 /// <p><code>type</code> - The type of virtual private gateway. Currently the only supported type is <code>ipsec.1</code>.</p></li>
172 /// <li>
173 /// <p><code>vpn-gateway-id</code> - The ID of the virtual private gateway.</p></li>
174 /// </ul>
175 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
176 self.inner = self.inner.set_filters(input);
177 self
178 }
179 /// <p>One or more filters.</p>
180 /// <ul>
181 /// <li>
182 /// <p><code>amazon-side-asn</code> - The Autonomous System Number (ASN) for the Amazon side of the gateway.</p></li>
183 /// <li>
184 /// <p><code>attachment.state</code> - The current state of the attachment between the gateway and the VPC (<code>attaching</code> | <code>attached</code> | <code>detaching</code> | <code>detached</code>).</p></li>
185 /// <li>
186 /// <p><code>attachment.vpc-id</code> - The ID of an attached VPC.</p></li>
187 /// <li>
188 /// <p><code>availability-zone</code> - The Availability Zone for the virtual private gateway (if applicable).</p></li>
189 /// <li>
190 /// <p><code>state</code> - The state of the virtual private gateway (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
191 /// <li>
192 /// <p><code>tag</code>:<key>
193 /// - 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
194 /// <code>Owner</code> and the value
195 /// <code>TeamA</code>, specify
196 /// <code>tag:Owner</code> for the filter name and
197 /// <code>TeamA</code> for the filter value.
198 /// </key></p></li>
199 /// <li>
200 /// <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>
201 /// <li>
202 /// <p><code>type</code> - The type of virtual private gateway. Currently the only supported type is <code>ipsec.1</code>.</p></li>
203 /// <li>
204 /// <p><code>vpn-gateway-id</code> - The ID of the virtual private gateway.</p></li>
205 /// </ul>
206 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
207 self.inner.get_filters()
208 }
209 ///
210 /// Appends an item to `VpnGatewayIds`.
211 ///
212 /// To override the contents of this collection use [`set_vpn_gateway_ids`](Self::set_vpn_gateway_ids).
213 ///
214 /// <p>One or more virtual private gateway IDs.</p>
215 /// <p>Default: Describes all your virtual private gateways.</p>
216 pub fn vpn_gateway_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.inner = self.inner.vpn_gateway_ids(input.into());
218 self
219 }
220 /// <p>One or more virtual private gateway IDs.</p>
221 /// <p>Default: Describes all your virtual private gateways.</p>
222 pub fn set_vpn_gateway_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
223 self.inner = self.inner.set_vpn_gateway_ids(input);
224 self
225 }
226 /// <p>One or more virtual private gateway IDs.</p>
227 /// <p>Default: Describes all your virtual private gateways.</p>
228 pub fn get_vpn_gateway_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
229 self.inner.get_vpn_gateway_ids()
230 }
231 /// <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>
232 pub fn dry_run(mut self, input: bool) -> Self {
233 self.inner = self.inner.dry_run(input);
234 self
235 }
236 /// <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>
237 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
238 self.inner = self.inner.set_dry_run(input);
239 self
240 }
241 /// <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>
242 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
243 self.inner.get_dry_run()
244 }
245}