aws_sdk_sagemaker/operation/list_cluster_nodes/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_cluster_nodes::_list_cluster_nodes_output::ListClusterNodesOutputBuilder;
3
4pub use crate::operation::list_cluster_nodes::_list_cluster_nodes_input::ListClusterNodesInputBuilder;
5
6impl crate::operation::list_cluster_nodes::builders::ListClusterNodesInputBuilder {
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_cluster_nodes::ListClusterNodesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_cluster_nodes::ListClusterNodesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_cluster_nodes();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListClusterNodes`.
24///
25/// <p>Retrieves the list of instances (also called <i>nodes</i> interchangeably) in a SageMaker HyperPod cluster.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListClusterNodesFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_cluster_nodes::builders::ListClusterNodesInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_cluster_nodes::ListClusterNodesOutput,
35 crate::operation::list_cluster_nodes::ListClusterNodesError,
36 > for ListClusterNodesFluentBuilder
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_cluster_nodes::ListClusterNodesOutput,
44 crate::operation::list_cluster_nodes::ListClusterNodesError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl ListClusterNodesFluentBuilder {
51 /// Creates a new `ListClusterNodesFluentBuilder`.
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 ListClusterNodes as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_cluster_nodes::builders::ListClusterNodesInputBuilder {
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_cluster_nodes::ListClusterNodesOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::list_cluster_nodes::ListClusterNodesError,
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_cluster_nodes::ListClusterNodes::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::list_cluster_nodes::ListClusterNodes::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_cluster_nodes::ListClusterNodesOutput,
97 crate::operation::list_cluster_nodes::ListClusterNodesError,
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_cluster_nodes::paginator::ListClusterNodesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114 pub fn into_paginator(self) -> crate::operation::list_cluster_nodes::paginator::ListClusterNodesPaginator {
115 crate::operation::list_cluster_nodes::paginator::ListClusterNodesPaginator::new(self.handle, self.inner)
116 }
117 /// <p>The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster in which you want to retrieve the list of nodes.</p>
118 pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.inner = self.inner.cluster_name(input.into());
120 self
121 }
122 /// <p>The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster in which you want to retrieve the list of nodes.</p>
123 pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_cluster_name(input);
125 self
126 }
127 /// <p>The string name or the Amazon Resource Name (ARN) of the SageMaker HyperPod cluster in which you want to retrieve the list of nodes.</p>
128 pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_cluster_name()
130 }
131 /// <p>A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard.</p>
132 /// <p>Acceptable formats include:</p>
133 /// <ul>
134 /// <li>
135 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
136 /// <li>
137 /// <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>
138 /// <li>
139 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
140 /// <li>
141 /// <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>
142 /// </ul>
143 /// <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>
144 pub fn creation_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
145 self.inner = self.inner.creation_time_after(input);
146 self
147 }
148 /// <p>A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard.</p>
149 /// <p>Acceptable formats include:</p>
150 /// <ul>
151 /// <li>
152 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
153 /// <li>
154 /// <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>
155 /// <li>
156 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
157 /// <li>
158 /// <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>
159 /// </ul>
160 /// <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>
161 pub fn set_creation_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
162 self.inner = self.inner.set_creation_time_after(input);
163 self
164 }
165 /// <p>A filter that returns nodes in a SageMaker HyperPod cluster created after the specified time. Timestamps are formatted according to the ISO 8601 standard.</p>
166 /// <p>Acceptable formats include:</p>
167 /// <ul>
168 /// <li>
169 /// <p><code>YYYY-MM-DDThh:mm:ss.sssTZD</code> (UTC), for example, <code>2014-10-01T20:30:00.000Z</code></p></li>
170 /// <li>
171 /// <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>
172 /// <li>
173 /// <p><code>YYYY-MM-DD</code>, for example, <code>2014-10-01</code></p></li>
174 /// <li>
175 /// <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>
176 /// </ul>
177 /// <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>
178 pub fn get_creation_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179 self.inner.get_creation_time_after()
180 }
181 /// <p>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>
182 pub fn creation_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
183 self.inner = self.inner.creation_time_before(input);
184 self
185 }
186 /// <p>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>
187 pub fn set_creation_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188 self.inner = self.inner.set_creation_time_before(input);
189 self
190 }
191 /// <p>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>
192 pub fn get_creation_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193 self.inner.get_creation_time_before()
194 }
195 /// <p>A filter that returns the instance groups whose name contain a specified string.</p>
196 pub fn instance_group_name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.instance_group_name_contains(input.into());
198 self
199 }
200 /// <p>A filter that returns the instance groups whose name contain a specified string.</p>
201 pub fn set_instance_group_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_instance_group_name_contains(input);
203 self
204 }
205 /// <p>A filter that returns the instance groups whose name contain a specified string.</p>
206 pub fn get_instance_group_name_contains(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_instance_group_name_contains()
208 }
209 /// <p>The maximum number of nodes to return in the response.</p>
210 pub fn max_results(mut self, input: i32) -> Self {
211 self.inner = self.inner.max_results(input);
212 self
213 }
214 /// <p>The maximum number of nodes to return in the response.</p>
215 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
216 self.inner = self.inner.set_max_results(input);
217 self
218 }
219 /// <p>The maximum number of nodes to return in the response.</p>
220 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
221 self.inner.get_max_results()
222 }
223 /// <p>If the result of the previous <code>ListClusterNodes</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of cluster nodes, use the token in the next request.</p>
224 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225 self.inner = self.inner.next_token(input.into());
226 self
227 }
228 /// <p>If the result of the previous <code>ListClusterNodes</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of cluster nodes, use the token in the next request.</p>
229 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230 self.inner = self.inner.set_next_token(input);
231 self
232 }
233 /// <p>If the result of the previous <code>ListClusterNodes</code> request was truncated, the response includes a <code>NextToken</code>. To retrieve the next set of cluster nodes, use the token in the next request.</p>
234 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
235 self.inner.get_next_token()
236 }
237 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
238 pub fn sort_by(mut self, input: crate::types::ClusterSortBy) -> Self {
239 self.inner = self.inner.sort_by(input);
240 self
241 }
242 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
243 pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::ClusterSortBy>) -> Self {
244 self.inner = self.inner.set_sort_by(input);
245 self
246 }
247 /// <p>The field by which to sort results. The default value is <code>CREATION_TIME</code>.</p>
248 pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::ClusterSortBy> {
249 self.inner.get_sort_by()
250 }
251 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
252 pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
253 self.inner = self.inner.sort_order(input);
254 self
255 }
256 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
257 pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
258 self.inner = self.inner.set_sort_order(input);
259 self
260 }
261 /// <p>The sort order for results. The default value is <code>Ascending</code>.</p>
262 pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
263 self.inner.get_sort_order()
264 }
265}