aws_sdk_ec2/operation/describe_vpn_connections/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_vpn_connections::_describe_vpn_connections_output::DescribeVpnConnectionsOutputBuilder;
3
4pub use crate::operation::describe_vpn_connections::_describe_vpn_connections_input::DescribeVpnConnectionsInputBuilder;
5
6impl crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder {
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_connections::DescribeVpnConnectionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_vpn_connections();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeVpnConnections`.
24///
25/// <p>Describes one or more of your VPN connections.</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 DescribeVpnConnectionsFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
36 crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
37 > for DescribeVpnConnectionsFluentBuilder
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_connections::DescribeVpnConnectionsOutput,
45 crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl DescribeVpnConnectionsFluentBuilder {
52 /// Creates a new `DescribeVpnConnectionsFluentBuilder`.
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 DescribeVpnConnections as a reference.
61 pub fn as_input(&self) -> &crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder {
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_connections::DescribeVpnConnectionsOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
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_connections::DescribeVpnConnections::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::describe_vpn_connections::DescribeVpnConnections::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_connections::DescribeVpnConnectionsOutput,
98 crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
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>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
121 /// <li>
122 /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
123 /// <li>
124 /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
125 /// <li>
126 /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
127 /// <li>
128 /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
129 /// <li>
130 /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
131 /// <li>
132 /// <p><code>tag</code>:<key>
133 /// - 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
134 /// <code>Owner</code> and the value
135 /// <code>TeamA</code>, specify
136 /// <code>tag:Owner</code> for the filter name and
137 /// <code>TeamA</code> for the filter value.
138 /// </key></p></li>
139 /// <li>
140 /// <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>
141 /// <li>
142 /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
143 /// <li>
144 /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
145 /// <li>
146 /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
147 /// <li>
148 /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
149 /// </ul>
150 pub fn filters(mut self, input: crate::types::Filter) -> Self {
151 self.inner = self.inner.filters(input);
152 self
153 }
154 /// <p>One or more filters.</p>
155 /// <ul>
156 /// <li>
157 /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
158 /// <li>
159 /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
160 /// <li>
161 /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
162 /// <li>
163 /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
164 /// <li>
165 /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
166 /// <li>
167 /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
168 /// <li>
169 /// <p><code>tag</code>:<key>
170 /// - 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
171 /// <code>Owner</code> and the value
172 /// <code>TeamA</code>, specify
173 /// <code>tag:Owner</code> for the filter name and
174 /// <code>TeamA</code> for the filter value.
175 /// </key></p></li>
176 /// <li>
177 /// <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>
178 /// <li>
179 /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
180 /// <li>
181 /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
182 /// <li>
183 /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
184 /// <li>
185 /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
186 /// </ul>
187 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
188 self.inner = self.inner.set_filters(input);
189 self
190 }
191 /// <p>One or more filters.</p>
192 /// <ul>
193 /// <li>
194 /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
195 /// <li>
196 /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
197 /// <li>
198 /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
199 /// <li>
200 /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
201 /// <li>
202 /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
203 /// <li>
204 /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</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 /// <li>
216 /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
217 /// <li>
218 /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
219 /// <li>
220 /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
221 /// <li>
222 /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
223 /// </ul>
224 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
225 self.inner.get_filters()
226 }
227 ///
228 /// Appends an item to `VpnConnectionIds`.
229 ///
230 /// To override the contents of this collection use [`set_vpn_connection_ids`](Self::set_vpn_connection_ids).
231 ///
232 /// <p>One or more VPN connection IDs.</p>
233 /// <p>Default: Describes your VPN connections.</p>
234 pub fn vpn_connection_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235 self.inner = self.inner.vpn_connection_ids(input.into());
236 self
237 }
238 /// <p>One or more VPN connection IDs.</p>
239 /// <p>Default: Describes your VPN connections.</p>
240 pub fn set_vpn_connection_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
241 self.inner = self.inner.set_vpn_connection_ids(input);
242 self
243 }
244 /// <p>One or more VPN connection IDs.</p>
245 /// <p>Default: Describes your VPN connections.</p>
246 pub fn get_vpn_connection_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
247 self.inner.get_vpn_connection_ids()
248 }
249 /// <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>
250 pub fn dry_run(mut self, input: bool) -> Self {
251 self.inner = self.inner.dry_run(input);
252 self
253 }
254 /// <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>
255 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
256 self.inner = self.inner.set_dry_run(input);
257 self
258 }
259 /// <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>
260 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
261 self.inner.get_dry_run()
262 }
263}