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 /// <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>
112 /// <p>Acceptable formats include:</p>
113 /// <ul>
114 /// <li>
115 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
116 /// <li>
117 /// <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>
118 /// <li>
119 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
120 /// <li>
121 /// <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>
122 /// </ul>
123 /// <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>
124 pub fn creation_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
125 self.inner = self.inner.creation_time_after(input);
126 self
127 }
128 /// <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>
129 /// <p>Acceptable formats include:</p>
130 /// <ul>
131 /// <li>
132 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
133 /// <li>
134 /// <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>
135 /// <li>
136 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
137 /// <li>
138 /// <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>
139 /// </ul>
140 /// <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>
141 pub fn set_creation_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
142 self.inner = self.inner.set_creation_time_after(input);
143 self
144 }
145 /// <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>
146 /// <p>Acceptable formats include:</p>
147 /// <ul>
148 /// <li>
149 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
150 /// <li>
151 /// <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>
152 /// <li>
153 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
154 /// <li>
155 /// <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>
156 /// </ul>
157 /// <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>
158 pub fn get_creation_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
159 self.inner.get_creation_time_after()
160 }
161 /// <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>
162 pub fn creation_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
163 self.inner = self.inner.creation_time_before(input);
164 self
165 }
166 /// <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>
167 pub fn set_creation_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
168 self.inner = self.inner.set_creation_time_before(input);
169 self
170 }
171 /// <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>
172 pub fn get_creation_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173 self.inner.get_creation_time_before()
174 }
175 /// <p>Set the maximum number of SageMaker HyperPod clusters to list.</p>
176 pub fn max_results(mut self, input: i32) -> Self {
177 self.inner = self.inner.max_results(input);
178 self
179 }
180 /// <p>Set the maximum number of SageMaker HyperPod clusters to list.</p>
181 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
182 self.inner = self.inner.set_max_results(input);
183 self
184 }
185 /// <p>Set the maximum number of SageMaker HyperPod clusters to list.</p>
186 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
187 self.inner.get_max_results()
188 }
189 /// <p>Set the maximum number of instances to print in the list.</p>
190 pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.name_contains(input.into());
192 self
193 }
194 /// <p>Set the maximum number of instances to print in the list.</p>
195 pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.inner = self.inner.set_name_contains(input);
197 self
198 }
199 /// <p>Set the maximum number of instances to print in the list.</p>
200 pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
201 self.inner.get_name_contains()
202 }
203 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
204 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.inner = self.inner.next_token(input.into());
206 self
207 }
208 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
209 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.inner = self.inner.set_next_token(input);
211 self
212 }
213 /// <p>Set the next token to retrieve the list of SageMaker HyperPod clusters.</p>
214 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
215 self.inner.get_next_token()
216 }
217 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
218 pub fn sort_by(mut self, input: crate::types::ClusterSortBy) -> Self {
219 self.inner = self.inner.sort_by(input);
220 self
221 }
222 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
223 pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::ClusterSortBy>) -> Self {
224 self.inner = self.inner.set_sort_by(input);
225 self
226 }
227 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
228 pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::ClusterSortBy> {
229 self.inner.get_sort_by()
230 }
231 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
232 pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
233 self.inner = self.inner.sort_order(input);
234 self
235 }
236 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
237 pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
238 self.inner = self.inner.set_sort_order(input);
239 self
240 }
241 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
242 pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
243 self.inner.get_sort_order()
244 }
245 /// <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>
246 pub fn training_plan_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247 self.inner = self.inner.training_plan_arn(input.into());
248 self
249 }
250 /// <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>
251 pub fn set_training_plan_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.inner = self.inner.set_training_plan_arn(input);
253 self
254 }
255 /// <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>
256 pub fn get_training_plan_arn(&self) -> &::std::option::Option<::std::string::String> {
257 self.inner.get_training_plan_arn()
258 }
259}