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