aws_sdk_networkmanager/operation/get_links/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_links::_get_links_output::GetLinksOutputBuilder;
3
4pub use crate::operation::get_links::_get_links_input::GetLinksInputBuilder;
5
6impl crate::operation::get_links::builders::GetLinksInputBuilder {
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_links::GetLinksOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_links::GetLinksError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_links();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetLinks`.
24///
25/// <p>Gets information about one or more links in a specified global network.</p>
26/// <p>If you specify the site ID, you cannot specify the type or provider in the same request. You can specify the type and provider in the same request.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetLinksFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::get_links::builders::GetLinksInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::get_links::GetLinksOutput, crate::operation::get_links::GetLinksError>
34    for GetLinksFluentBuilder
35{
36    fn send(
37        self,
38        config_override: crate::config::Builder,
39    ) -> crate::client::customize::internal::BoxFuture<
40        crate::client::customize::internal::SendResult<crate::operation::get_links::GetLinksOutput, crate::operation::get_links::GetLinksError>,
41    > {
42        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43    }
44}
45impl GetLinksFluentBuilder {
46    /// Creates a new `GetLinksFluentBuilder`.
47    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
48        Self {
49            handle,
50            inner: ::std::default::Default::default(),
51            config_override: ::std::option::Option::None,
52        }
53    }
54    /// Access the GetLinks as a reference.
55    pub fn as_input(&self) -> &crate::operation::get_links::builders::GetLinksInputBuilder {
56        &self.inner
57    }
58    /// Sends the request and returns the response.
59    ///
60    /// If an error occurs, an `SdkError` will be returned with additional details that
61    /// can be matched against.
62    ///
63    /// By default, any retryable failures will be retried twice. Retry behavior
64    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
65    /// set when configuring the client.
66    pub async fn send(
67        self,
68    ) -> ::std::result::Result<
69        crate::operation::get_links::GetLinksOutput,
70        ::aws_smithy_runtime_api::client::result::SdkError<
71            crate::operation::get_links::GetLinksError,
72            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
73        >,
74    > {
75        let input = self
76            .inner
77            .build()
78            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79        let runtime_plugins = crate::operation::get_links::GetLinks::operation_runtime_plugins(
80            self.handle.runtime_plugins.clone(),
81            &self.handle.conf,
82            self.config_override,
83        );
84        crate::operation::get_links::GetLinks::orchestrate(&runtime_plugins, input).await
85    }
86
87    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
88    pub fn customize(
89        self,
90    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_links::GetLinksOutput, crate::operation::get_links::GetLinksError, Self>
91    {
92        crate::client::customize::CustomizableOperation::new(self)
93    }
94    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
95        self.set_config_override(::std::option::Option::Some(config_override.into()));
96        self
97    }
98
99    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
100        self.config_override = config_override;
101        self
102    }
103    /// Create a paginator for this request
104    ///
105    /// Paginators are used by calling [`send().await`](crate::operation::get_links::paginator::GetLinksPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
106    pub fn into_paginator(self) -> crate::operation::get_links::paginator::GetLinksPaginator {
107        crate::operation::get_links::paginator::GetLinksPaginator::new(self.handle, self.inner)
108    }
109    /// <p>The ID of the global network.</p>
110    pub fn global_network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.inner = self.inner.global_network_id(input.into());
112        self
113    }
114    /// <p>The ID of the global network.</p>
115    pub fn set_global_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.inner = self.inner.set_global_network_id(input);
117        self
118    }
119    /// <p>The ID of the global network.</p>
120    pub fn get_global_network_id(&self) -> &::std::option::Option<::std::string::String> {
121        self.inner.get_global_network_id()
122    }
123    ///
124    /// Appends an item to `LinkIds`.
125    ///
126    /// To override the contents of this collection use [`set_link_ids`](Self::set_link_ids).
127    ///
128    /// <p>One or more link IDs. The maximum is 10.</p>
129    pub fn link_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.link_ids(input.into());
131        self
132    }
133    /// <p>One or more link IDs. The maximum is 10.</p>
134    pub fn set_link_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
135        self.inner = self.inner.set_link_ids(input);
136        self
137    }
138    /// <p>One or more link IDs. The maximum is 10.</p>
139    pub fn get_link_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
140        self.inner.get_link_ids()
141    }
142    /// <p>The ID of the site.</p>
143    pub fn site_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.site_id(input.into());
145        self
146    }
147    /// <p>The ID of the site.</p>
148    pub fn set_site_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_site_id(input);
150        self
151    }
152    /// <p>The ID of the site.</p>
153    pub fn get_site_id(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_site_id()
155    }
156    /// <p>The link type.</p>
157    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.r#type(input.into());
159        self
160    }
161    /// <p>The link type.</p>
162    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_type(input);
164        self
165    }
166    /// <p>The link type.</p>
167    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_type()
169    }
170    /// <p>The link provider.</p>
171    pub fn provider(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.provider(input.into());
173        self
174    }
175    /// <p>The link provider.</p>
176    pub fn set_provider(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_provider(input);
178        self
179    }
180    /// <p>The link provider.</p>
181    pub fn get_provider(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_provider()
183    }
184    /// <p>The maximum number of results to return.</p>
185    pub fn max_results(mut self, input: i32) -> Self {
186        self.inner = self.inner.max_results(input);
187        self
188    }
189    /// <p>The maximum number of results to return.</p>
190    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
191        self.inner = self.inner.set_max_results(input);
192        self
193    }
194    /// <p>The maximum number of results to return.</p>
195    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
196        self.inner.get_max_results()
197    }
198    /// <p>The token for the next page of results.</p>
199    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.next_token(input.into());
201        self
202    }
203    /// <p>The token for the next page of results.</p>
204    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_next_token(input);
206        self
207    }
208    /// <p>The token for the next page of results.</p>
209    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_next_token()
211    }
212}