aws_sdk_sagemaker/operation/list_clusters/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_clusters::_list_clusters_output::ListClustersOutputBuilder;
3
4pub use crate::operation::list_clusters::_list_clusters_input::ListClustersInputBuilder;
5
6impl crate::operation::list_clusters::builders::ListClustersInputBuilder {
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_clusters::ListClustersOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_clusters::ListClustersError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_clusters();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListClusters`.
24///
25/// <p>Retrieves the list of SageMaker HyperPod clusters.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListClustersFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_clusters::builders::ListClustersInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_clusters::ListClustersOutput,
35 crate::operation::list_clusters::ListClustersError,
36 > for ListClustersFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::list_clusters::ListClustersOutput,
44 crate::operation::list_clusters::ListClustersError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ListClustersFluentBuilder {
51 /// Creates a new `ListClustersFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the ListClusters as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_clusters::builders::ListClustersInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::list_clusters::ListClustersOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::list_clusters::ListClustersError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::list_clusters::ListClusters::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::list_clusters::ListClusters::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::list_clusters::ListClustersOutput,
97 crate::operation::list_clusters::ListClustersError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// Create a paginator for this request
112 ///
113 /// Paginators are used by calling [`send().await`](crate::operation::list_clusters::paginator::ListClustersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::list_clusters::paginator::ListClustersPaginator {
115 crate::operation::list_clusters::paginator::ListClustersPaginator::new(self.handle, self.inner)
116 }
117 /// <p>Set a start time for the time range during which you want to list SageMaker HyperPod clusters. Timestamps are formatted according to the ISO 8601 standard.</p>
118 /// <p>Acceptable formats include:</p>
119 /// <ul>
120 /// <li>
121 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
122 /// <li>
123 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (with offset), for example, <code>2014-10-01T12:30:00.000-08:00</code></p></li>
124 /// <li>
125 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
126 /// <li>
127 /// <p>Unix time in seconds, for example, <code>1412195400</code>. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.</p></li>
128 /// </ul>
129 /// <p>For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
130 pub fn creation_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
131 self.inner = self.inner.creation_time_after(input);
132 self
133 }
134 /// <p>Set a start time for the time range during which you want to list SageMaker HyperPod clusters. Timestamps are formatted according to the ISO 8601 standard.</p>
135 /// <p>Acceptable formats include:</p>
136 /// <ul>
137 /// <li>
138 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
139 /// <li>
140 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (with offset), for example, <code>2014-10-01T12:30:00.000-08:00</code></p></li>
141 /// <li>
142 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
143 /// <li>
144 /// <p>Unix time in seconds, for example, <code>1412195400</code>. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.</p></li>
145 /// </ul>
146 /// <p>For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
147 pub fn set_creation_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
148 self.inner = self.inner.set_creation_time_after(input);
149 self
150 }
151 /// <p>Set a start time for the time range during which you want to list SageMaker HyperPod clusters. Timestamps are formatted according to the ISO 8601 standard.</p>
152 /// <p>Acceptable formats include:</p>
153 /// <ul>
154 /// <li>
155 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
156 /// <li>
157 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (with offset), for example, <code>2014-10-01T12:30:00.000-08:00</code></p></li>
158 /// <li>
159 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
160 /// <li>
161 /// <p>Unix time in seconds, for example, <code>1412195400</code>. This is also referred to as Unix Epoch time and represents the number of seconds since midnight, January 1, 1970 UTC.</p></li>
162 /// </ul>
163 /// <p>For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
164 pub fn get_creation_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
165 self.inner.get_creation_time_after()
166 }
167 /// <p>Set an end time for the time range during which you want to list SageMaker HyperPod clusters. A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for <code>CreationTimeAfter</code>. For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
168 pub fn creation_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
169 self.inner = self.inner.creation_time_before(input);
170 self
171 }
172 /// <p>Set an end time for the time range during which you want to list SageMaker HyperPod clusters. A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for <code>CreationTimeAfter</code>. For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
173 pub fn set_creation_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
174 self.inner = self.inner.set_creation_time_before(input);
175 self
176 }
177 /// <p>Set an end time for the time range during which you want to list SageMaker HyperPod clusters. A filter that returns nodes in a SageMaker HyperPod cluster created before the specified time. The acceptable formats are the same as the timestamp formats for <code>CreationTimeAfter</code>. For more information about the timestamp format, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-types.html#parameter-type-timestamp">Timestamp</a> in the <i>Amazon Web Services Command Line Interface User Guide</i>.</p>
178 pub fn get_creation_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179 self.inner.get_creation_time_before()
180 }
181 /// <p>Specifies the maximum number of clusters to evaluate for the operation (not necessarily the number of matching items). After SageMaker processes the number of clusters up to <code>MaxResults</code>, it stops the operation and returns the matching clusters up to that point. If all the matching clusters are desired, SageMaker will go through all the clusters until <code>NextToken</code> is empty.</p>
182 pub fn max_results(mut self, input: i32) -> Self {
183 self.inner = self.inner.max_results(input);
184 self
185 }
186 /// <p>Specifies the maximum number of clusters to evaluate for the operation (not necessarily the number of matching items). After SageMaker processes the number of clusters up to <code>MaxResults</code>, it stops the operation and returns the matching clusters up to that point. If all the matching clusters are desired, SageMaker will go through all the clusters until <code>NextToken</code> is empty.</p>
187 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
188 self.inner = self.inner.set_max_results(input);
189 self
190 }
191 /// <p>Specifies the maximum number of clusters to evaluate for the operation (not necessarily the number of matching items). After SageMaker processes the number of clusters up to <code>MaxResults</code>, it stops the operation and returns the matching clusters up to that point. If all the matching clusters are desired, SageMaker will go through all the clusters until <code>NextToken</code> is empty.</p>
192 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
193 self.inner.get_max_results()
194 }
195 /// <p>Set the maximum number of instances to print in the list.</p>
196 pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.name_contains(input.into());
198 self
199 }
200 /// <p>Set the maximum number of instances to print in the list.</p>
201 pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_name_contains(input);
203 self
204 }
205 /// <p>Set the maximum number of instances to print in the list.</p>
206 pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_name_contains()
208 }
209 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
210 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211 self.inner = self.inner.next_token(input.into());
212 self
213 }
214 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
215 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.inner = self.inner.set_next_token(input);
217 self
218 }
219 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
220 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
221 self.inner.get_next_token()
222 }
223 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
224 pub fn sort_by(mut self, input: crate::types::ClusterSortBy) -> Self {
225 self.inner = self.inner.sort_by(input);
226 self
227 }
228 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
229 pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::ClusterSortBy>) -> Self {
230 self.inner = self.inner.set_sort_by(input);
231 self
232 }
233 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
234 pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::ClusterSortBy> {
235 self.inner.get_sort_by()
236 }
237 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
238 pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
239 self.inner = self.inner.sort_order(input);
240 self
241 }
242 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
243 pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
244 self.inner = self.inner.set_sort_order(input);
245 self
246 }
247 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
248 pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
249 self.inner.get_sort_order()
250 }
251 /// <p>The Amazon Resource Name (ARN); of the training plan to filter clusters by. For more information about reserving GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingPlan.html">CreateTrainingPlan</a> </code>.</p>
252 pub fn training_plan_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253 self.inner = self.inner.training_plan_arn(input.into());
254 self
255 }
256 /// <p>The Amazon Resource Name (ARN); of the training plan to filter clusters by. For more information about reserving GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingPlan.html">CreateTrainingPlan</a> </code>.</p>
257 pub fn set_training_plan_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258 self.inner = self.inner.set_training_plan_arn(input);
259 self
260 }
261 /// <p>The Amazon Resource Name (ARN); of the training plan to filter clusters by. For more information about reserving GPU capacity for your SageMaker HyperPod clusters using Amazon SageMaker Training Plan, see <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingPlan.html">CreateTrainingPlan</a> </code>.</p>
262 pub fn get_training_plan_arn(&self) -> &::std::option::Option<::std::string::String> {
263 self.inner.get_training_plan_arn()
264 }
265}