aws_sdk_sagemaker/operation/list_hubs/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_hubs::_list_hubs_output::ListHubsOutputBuilder;
3
4pub use crate::operation::list_hubs::_list_hubs_input::ListHubsInputBuilder;
5
6impl crate::operation::list_hubs::builders::ListHubsInputBuilder {
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::list_hubs::ListHubsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_hubs::ListHubsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_hubs();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListHubs`.
24///
25/// <p>List all existing hubs.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListHubsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_hubs::builders::ListHubsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::list_hubs::ListHubsOutput, crate::operation::list_hubs::ListHubsError>
33    for ListHubsFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::list_hubs::ListHubsOutput, crate::operation::list_hubs::ListHubsError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl ListHubsFluentBuilder {
45    /// Creates a new `ListHubsFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the ListHubs as a reference.
54    pub fn as_input(&self) -> &crate::operation::list_hubs::builders::ListHubsInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::list_hubs::ListHubsOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::list_hubs::ListHubsError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::list_hubs::ListHubs::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::list_hubs::ListHubs::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<crate::operation::list_hubs::ListHubsOutput, crate::operation::list_hubs::ListHubsError, Self>
90    {
91        crate::client::customize::CustomizableOperation::new(self)
92    }
93    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94        self.set_config_override(::std::option::Option::Some(config_override.into()));
95        self
96    }
97
98    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99        self.config_override = config_override;
100        self
101    }
102    /// <p>Only list hubs with names that contain the specified string.</p>
103    pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.inner = self.inner.name_contains(input.into());
105        self
106    }
107    /// <p>Only list hubs with names that contain the specified string.</p>
108    pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.inner = self.inner.set_name_contains(input);
110        self
111    }
112    /// <p>Only list hubs with names that contain the specified string.</p>
113    pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
114        self.inner.get_name_contains()
115    }
116    /// <p>Only list hubs that were created before the time specified.</p>
117    pub fn creation_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
118        self.inner = self.inner.creation_time_before(input);
119        self
120    }
121    /// <p>Only list hubs that were created before the time specified.</p>
122    pub fn set_creation_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
123        self.inner = self.inner.set_creation_time_before(input);
124        self
125    }
126    /// <p>Only list hubs that were created before the time specified.</p>
127    pub fn get_creation_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
128        self.inner.get_creation_time_before()
129    }
130    /// <p>Only list hubs that were created after the time specified.</p>
131    pub fn creation_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
132        self.inner = self.inner.creation_time_after(input);
133        self
134    }
135    /// <p>Only list hubs that were created after the time specified.</p>
136    pub fn set_creation_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
137        self.inner = self.inner.set_creation_time_after(input);
138        self
139    }
140    /// <p>Only list hubs that were created after the time specified.</p>
141    pub fn get_creation_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
142        self.inner.get_creation_time_after()
143    }
144    /// <p>Only list hubs that were last modified before the time specified.</p>
145    pub fn last_modified_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
146        self.inner = self.inner.last_modified_time_before(input);
147        self
148    }
149    /// <p>Only list hubs that were last modified before the time specified.</p>
150    pub fn set_last_modified_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
151        self.inner = self.inner.set_last_modified_time_before(input);
152        self
153    }
154    /// <p>Only list hubs that were last modified before the time specified.</p>
155    pub fn get_last_modified_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
156        self.inner.get_last_modified_time_before()
157    }
158    /// <p>Only list hubs that were last modified after the time specified.</p>
159    pub fn last_modified_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
160        self.inner = self.inner.last_modified_time_after(input);
161        self
162    }
163    /// <p>Only list hubs that were last modified after the time specified.</p>
164    pub fn set_last_modified_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
165        self.inner = self.inner.set_last_modified_time_after(input);
166        self
167    }
168    /// <p>Only list hubs that were last modified after the time specified.</p>
169    pub fn get_last_modified_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
170        self.inner.get_last_modified_time_after()
171    }
172    /// <p>Sort hubs by either name or creation time.</p>
173    pub fn sort_by(mut self, input: crate::types::HubSortBy) -> Self {
174        self.inner = self.inner.sort_by(input);
175        self
176    }
177    /// <p>Sort hubs by either name or creation time.</p>
178    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::HubSortBy>) -> Self {
179        self.inner = self.inner.set_sort_by(input);
180        self
181    }
182    /// <p>Sort hubs by either name or creation time.</p>
183    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::HubSortBy> {
184        self.inner.get_sort_by()
185    }
186    /// <p>Sort hubs by ascending or descending order.</p>
187    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
188        self.inner = self.inner.sort_order(input);
189        self
190    }
191    /// <p>Sort hubs by ascending or descending order.</p>
192    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
193        self.inner = self.inner.set_sort_order(input);
194        self
195    }
196    /// <p>Sort hubs by ascending or descending order.</p>
197    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
198        self.inner.get_sort_order()
199    }
200    /// <p>The maximum number of hubs to list.</p>
201    pub fn max_results(mut self, input: i32) -> Self {
202        self.inner = self.inner.max_results(input);
203        self
204    }
205    /// <p>The maximum number of hubs to list.</p>
206    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
207        self.inner = self.inner.set_max_results(input);
208        self
209    }
210    /// <p>The maximum number of hubs to list.</p>
211    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
212        self.inner.get_max_results()
213    }
214    /// <p>If the response to a previous <code>ListHubs</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of hubs, use the token in the next request.</p>
215    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.next_token(input.into());
217        self
218    }
219    /// <p>If the response to a previous <code>ListHubs</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of hubs, use the token in the next request.</p>
220    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_next_token(input);
222        self
223    }
224    /// <p>If the response to a previous <code>ListHubs</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of hubs, use the token in the next request.</p>
225    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_next_token()
227    }
228}