aws_sdk_networkmanager/operation/get_network_resources/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_network_resources::_get_network_resources_output::GetNetworkResourcesOutputBuilder;
3
4pub use crate::operation::get_network_resources::_get_network_resources_input::GetNetworkResourcesInputBuilder;
5
6impl crate::operation::get_network_resources::builders::GetNetworkResourcesInputBuilder {
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::get_network_resources::GetNetworkResourcesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_network_resources::GetNetworkResourcesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_network_resources();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetNetworkResources`.
24///
25/// <p>Describes the network resources for the specified global network.</p>
26/// <p>The results include information from the corresponding Describe call for the resource, minus any sensitive information such as pre-shared keys.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetNetworkResourcesFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::get_network_resources::builders::GetNetworkResourcesInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::get_network_resources::GetNetworkResourcesOutput,
36        crate::operation::get_network_resources::GetNetworkResourcesError,
37    > for GetNetworkResourcesFluentBuilder
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::get_network_resources::GetNetworkResourcesOutput,
45            crate::operation::get_network_resources::GetNetworkResourcesError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl GetNetworkResourcesFluentBuilder {
52    /// Creates a new `GetNetworkResourcesFluentBuilder`.
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 GetNetworkResources as a reference.
61    pub fn as_input(&self) -> &crate::operation::get_network_resources::builders::GetNetworkResourcesInputBuilder {
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::get_network_resources::GetNetworkResourcesOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::get_network_resources::GetNetworkResourcesError,
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::get_network_resources::GetNetworkResources::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::get_network_resources::GetNetworkResources::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::get_network_resources::GetNetworkResourcesOutput,
98        crate::operation::get_network_resources::GetNetworkResourcesError,
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    /// Create a paginator for this request
113    ///
114    /// Paginators are used by calling [`send().await`](crate::operation::get_network_resources::paginator::GetNetworkResourcesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115    pub fn into_paginator(self) -> crate::operation::get_network_resources::paginator::GetNetworkResourcesPaginator {
116        crate::operation::get_network_resources::paginator::GetNetworkResourcesPaginator::new(self.handle, self.inner)
117    }
118    /// <p>The ID of the global network.</p>
119    pub fn global_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.global_network_id(input.into());
121        self
122    }
123    /// <p>The ID of the global network.</p>
124    pub fn set_global_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_global_network_id(input);
126        self
127    }
128    /// <p>The ID of the global network.</p>
129    pub fn get_global_network_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_global_network_id()
131    }
132    /// <p>The ID of a core network.</p>
133    pub fn core_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.core_network_id(input.into());
135        self
136    }
137    /// <p>The ID of a core network.</p>
138    pub fn set_core_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_core_network_id(input);
140        self
141    }
142    /// <p>The ID of a core network.</p>
143    pub fn get_core_network_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_core_network_id()
145    }
146    /// <p>The ARN of the gateway.</p>
147    pub fn registered_gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.registered_gateway_arn(input.into());
149        self
150    }
151    /// <p>The ARN of the gateway.</p>
152    pub fn set_registered_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_registered_gateway_arn(input);
154        self
155    }
156    /// <p>The ARN of the gateway.</p>
157    pub fn get_registered_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_registered_gateway_arn()
159    }
160    /// <p>The Amazon Web Services Region.</p>
161    pub fn aws_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.aws_region(input.into());
163        self
164    }
165    /// <p>The Amazon Web Services Region.</p>
166    pub fn set_aws_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_aws_region(input);
168        self
169    }
170    /// <p>The Amazon Web Services Region.</p>
171    pub fn get_aws_region(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_aws_region()
173    }
174    /// <p>The Amazon Web Services account ID.</p>
175    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.account_id(input.into());
177        self
178    }
179    /// <p>The Amazon Web Services account ID.</p>
180    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_account_id(input);
182        self
183    }
184    /// <p>The Amazon Web Services account ID.</p>
185    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_account_id()
187    }
188    /// <p>The resource type.</p>
189    /// <p>The following are the supported resource types for Direct Connect:</p>
190    /// <ul>
191    /// <li>
192    /// <p><code>dxcon</code></p></li>
193    /// <li>
194    /// <p><code>dx-gateway</code></p></li>
195    /// <li>
196    /// <p><code>dx-vif</code></p></li>
197    /// </ul>
198    /// <p>The following are the supported resource types for Network Manager:</p>
199    /// <ul>
200    /// <li>
201    /// <p><code>attachment</code></p></li>
202    /// <li>
203    /// <p><code>connect-peer</code></p></li>
204    /// <li>
205    /// <p><code>connection</code></p></li>
206    /// <li>
207    /// <p><code>core-network</code></p></li>
208    /// <li>
209    /// <p><code>device</code></p></li>
210    /// <li>
211    /// <p><code>link</code></p></li>
212    /// <li>
213    /// <p><code>peering</code></p></li>
214    /// <li>
215    /// <p><code>site</code></p></li>
216    /// </ul>
217    /// <p>The following are the supported resource types for Amazon VPC:</p>
218    /// <ul>
219    /// <li>
220    /// <p><code>customer-gateway</code></p></li>
221    /// <li>
222    /// <p><code>transit-gateway</code></p></li>
223    /// <li>
224    /// <p><code>transit-gateway-attachment</code></p></li>
225    /// <li>
226    /// <p><code>transit-gateway-connect-peer</code></p></li>
227    /// <li>
228    /// <p><code>transit-gateway-route-table</code></p></li>
229    /// <li>
230    /// <p><code>vpn-connection</code></p></li>
231    /// </ul>
232    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233        self.inner = self.inner.resource_type(input.into());
234        self
235    }
236    /// <p>The resource type.</p>
237    /// <p>The following are the supported resource types for Direct Connect:</p>
238    /// <ul>
239    /// <li>
240    /// <p><code>dxcon</code></p></li>
241    /// <li>
242    /// <p><code>dx-gateway</code></p></li>
243    /// <li>
244    /// <p><code>dx-vif</code></p></li>
245    /// </ul>
246    /// <p>The following are the supported resource types for Network Manager:</p>
247    /// <ul>
248    /// <li>
249    /// <p><code>attachment</code></p></li>
250    /// <li>
251    /// <p><code>connect-peer</code></p></li>
252    /// <li>
253    /// <p><code>connection</code></p></li>
254    /// <li>
255    /// <p><code>core-network</code></p></li>
256    /// <li>
257    /// <p><code>device</code></p></li>
258    /// <li>
259    /// <p><code>link</code></p></li>
260    /// <li>
261    /// <p><code>peering</code></p></li>
262    /// <li>
263    /// <p><code>site</code></p></li>
264    /// </ul>
265    /// <p>The following are the supported resource types for Amazon VPC:</p>
266    /// <ul>
267    /// <li>
268    /// <p><code>customer-gateway</code></p></li>
269    /// <li>
270    /// <p><code>transit-gateway</code></p></li>
271    /// <li>
272    /// <p><code>transit-gateway-attachment</code></p></li>
273    /// <li>
274    /// <p><code>transit-gateway-connect-peer</code></p></li>
275    /// <li>
276    /// <p><code>transit-gateway-route-table</code></p></li>
277    /// <li>
278    /// <p><code>vpn-connection</code></p></li>
279    /// </ul>
280    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
281        self.inner = self.inner.set_resource_type(input);
282        self
283    }
284    /// <p>The resource type.</p>
285    /// <p>The following are the supported resource types for Direct Connect:</p>
286    /// <ul>
287    /// <li>
288    /// <p><code>dxcon</code></p></li>
289    /// <li>
290    /// <p><code>dx-gateway</code></p></li>
291    /// <li>
292    /// <p><code>dx-vif</code></p></li>
293    /// </ul>
294    /// <p>The following are the supported resource types for Network Manager:</p>
295    /// <ul>
296    /// <li>
297    /// <p><code>attachment</code></p></li>
298    /// <li>
299    /// <p><code>connect-peer</code></p></li>
300    /// <li>
301    /// <p><code>connection</code></p></li>
302    /// <li>
303    /// <p><code>core-network</code></p></li>
304    /// <li>
305    /// <p><code>device</code></p></li>
306    /// <li>
307    /// <p><code>link</code></p></li>
308    /// <li>
309    /// <p><code>peering</code></p></li>
310    /// <li>
311    /// <p><code>site</code></p></li>
312    /// </ul>
313    /// <p>The following are the supported resource types for Amazon VPC:</p>
314    /// <ul>
315    /// <li>
316    /// <p><code>customer-gateway</code></p></li>
317    /// <li>
318    /// <p><code>transit-gateway</code></p></li>
319    /// <li>
320    /// <p><code>transit-gateway-attachment</code></p></li>
321    /// <li>
322    /// <p><code>transit-gateway-connect-peer</code></p></li>
323    /// <li>
324    /// <p><code>transit-gateway-route-table</code></p></li>
325    /// <li>
326    /// <p><code>vpn-connection</code></p></li>
327    /// </ul>
328    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
329        self.inner.get_resource_type()
330    }
331    /// <p>The ARN of the resource.</p>
332    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333        self.inner = self.inner.resource_arn(input.into());
334        self
335    }
336    /// <p>The ARN of the resource.</p>
337    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338        self.inner = self.inner.set_resource_arn(input);
339        self
340    }
341    /// <p>The ARN of the resource.</p>
342    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
343        self.inner.get_resource_arn()
344    }
345    /// <p>The maximum number of results to return.</p>
346    pub fn max_results(mut self, input: i32) -> Self {
347        self.inner = self.inner.max_results(input);
348        self
349    }
350    /// <p>The maximum number of results to return.</p>
351    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
352        self.inner = self.inner.set_max_results(input);
353        self
354    }
355    /// <p>The maximum number of results to return.</p>
356    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
357        self.inner.get_max_results()
358    }
359    /// <p>The token for the next page of results.</p>
360    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361        self.inner = self.inner.next_token(input.into());
362        self
363    }
364    /// <p>The token for the next page of results.</p>
365    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
366        self.inner = self.inner.set_next_token(input);
367        self
368    }
369    /// <p>The token for the next page of results.</p>
370    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
371        self.inner.get_next_token()
372    }
373}