aws_sdk_sagemaker/operation/list_notebook_instances/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_notebook_instances::_list_notebook_instances_output::ListNotebookInstancesOutputBuilder;
3
4pub use crate::operation::list_notebook_instances::_list_notebook_instances_input::ListNotebookInstancesInputBuilder;
5
6impl crate::operation::list_notebook_instances::builders::ListNotebookInstancesInputBuilder {
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_notebook_instances::ListNotebookInstancesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_notebook_instances::ListNotebookInstancesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_notebook_instances();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListNotebookInstances`.
24///
25/// <p>Returns a list of the SageMaker AI notebook instances in the requester's account in an Amazon Web Services Region.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListNotebookInstancesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_notebook_instances::builders::ListNotebookInstancesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_notebook_instances::ListNotebookInstancesOutput,
35        crate::operation::list_notebook_instances::ListNotebookInstancesError,
36    > for ListNotebookInstancesFluentBuilder
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_notebook_instances::ListNotebookInstancesOutput,
44            crate::operation::list_notebook_instances::ListNotebookInstancesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListNotebookInstancesFluentBuilder {
51    /// Creates a new `ListNotebookInstancesFluentBuilder`.
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 ListNotebookInstances as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_notebook_instances::builders::ListNotebookInstancesInputBuilder {
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_notebook_instances::ListNotebookInstancesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_notebook_instances::ListNotebookInstancesError,
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_notebook_instances::ListNotebookInstances::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_notebook_instances::ListNotebookInstances::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_notebook_instances::ListNotebookInstancesOutput,
97        crate::operation::list_notebook_instances::ListNotebookInstancesError,
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_notebook_instances::paginator::ListNotebookInstancesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_notebook_instances::paginator::ListNotebookInstancesPaginator {
115        crate::operation::list_notebook_instances::paginator::ListNotebookInstancesPaginator::new(self.handle, self.inner)
116    }
117    /// <p>If the previous call to the <code>ListNotebookInstances</code> is truncated, the response includes a <code>NextToken</code>. You can use this token in your subsequent <code>ListNotebookInstances</code> request to fetch the next set of notebook instances.</p><note>
118    /// <p>You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.</p>
119    /// </note>
120    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.next_token(input.into());
122        self
123    }
124    /// <p>If the previous call to the <code>ListNotebookInstances</code> is truncated, the response includes a <code>NextToken</code>. You can use this token in your subsequent <code>ListNotebookInstances</code> request to fetch the next set of notebook instances.</p><note>
125    /// <p>You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.</p>
126    /// </note>
127    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_next_token(input);
129        self
130    }
131    /// <p>If the previous call to the <code>ListNotebookInstances</code> is truncated, the response includes a <code>NextToken</code>. You can use this token in your subsequent <code>ListNotebookInstances</code> request to fetch the next set of notebook instances.</p><note>
132    /// <p>You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.</p>
133    /// </note>
134    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_next_token()
136    }
137    /// <p>The maximum number of notebook instances to return.</p>
138    pub fn max_results(mut self, input: i32) -> Self {
139        self.inner = self.inner.max_results(input);
140        self
141    }
142    /// <p>The maximum number of notebook instances to return.</p>
143    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
144        self.inner = self.inner.set_max_results(input);
145        self
146    }
147    /// <p>The maximum number of notebook instances to return.</p>
148    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
149        self.inner.get_max_results()
150    }
151    /// <p>The field to sort results by. The default is <code>Name</code>.</p>
152    pub fn sort_by(mut self, input: crate::types::NotebookInstanceSortKey) -> Self {
153        self.inner = self.inner.sort_by(input);
154        self
155    }
156    /// <p>The field to sort results by. The default is <code>Name</code>.</p>
157    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::NotebookInstanceSortKey>) -> Self {
158        self.inner = self.inner.set_sort_by(input);
159        self
160    }
161    /// <p>The field to sort results by. The default is <code>Name</code>.</p>
162    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::NotebookInstanceSortKey> {
163        self.inner.get_sort_by()
164    }
165    /// <p>The sort order for results.</p>
166    pub fn sort_order(mut self, input: crate::types::NotebookInstanceSortOrder) -> Self {
167        self.inner = self.inner.sort_order(input);
168        self
169    }
170    /// <p>The sort order for results.</p>
171    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::NotebookInstanceSortOrder>) -> Self {
172        self.inner = self.inner.set_sort_order(input);
173        self
174    }
175    /// <p>The sort order for results.</p>
176    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::NotebookInstanceSortOrder> {
177        self.inner.get_sort_order()
178    }
179    /// <p>A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.</p>
180    pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.name_contains(input.into());
182        self
183    }
184    /// <p>A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.</p>
185    pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_name_contains(input);
187        self
188    }
189    /// <p>A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.</p>
190    pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_name_contains()
192    }
193    /// <p>A filter that returns only notebook instances that were created before the specified time (timestamp).</p>
194    pub fn creation_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
195        self.inner = self.inner.creation_time_before(input);
196        self
197    }
198    /// <p>A filter that returns only notebook instances that were created before the specified time (timestamp).</p>
199    pub fn set_creation_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
200        self.inner = self.inner.set_creation_time_before(input);
201        self
202    }
203    /// <p>A filter that returns only notebook instances that were created before the specified time (timestamp).</p>
204    pub fn get_creation_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
205        self.inner.get_creation_time_before()
206    }
207    /// <p>A filter that returns only notebook instances that were created after the specified time (timestamp).</p>
208    pub fn creation_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
209        self.inner = self.inner.creation_time_after(input);
210        self
211    }
212    /// <p>A filter that returns only notebook instances that were created after the specified time (timestamp).</p>
213    pub fn set_creation_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
214        self.inner = self.inner.set_creation_time_after(input);
215        self
216    }
217    /// <p>A filter that returns only notebook instances that were created after the specified time (timestamp).</p>
218    pub fn get_creation_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
219        self.inner.get_creation_time_after()
220    }
221    /// <p>A filter that returns only notebook instances that were modified before the specified time (timestamp).</p>
222    pub fn last_modified_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
223        self.inner = self.inner.last_modified_time_before(input);
224        self
225    }
226    /// <p>A filter that returns only notebook instances that were modified before the specified time (timestamp).</p>
227    pub fn set_last_modified_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
228        self.inner = self.inner.set_last_modified_time_before(input);
229        self
230    }
231    /// <p>A filter that returns only notebook instances that were modified before the specified time (timestamp).</p>
232    pub fn get_last_modified_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
233        self.inner.get_last_modified_time_before()
234    }
235    /// <p>A filter that returns only notebook instances that were modified after the specified time (timestamp).</p>
236    pub fn last_modified_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
237        self.inner = self.inner.last_modified_time_after(input);
238        self
239    }
240    /// <p>A filter that returns only notebook instances that were modified after the specified time (timestamp).</p>
241    pub fn set_last_modified_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
242        self.inner = self.inner.set_last_modified_time_after(input);
243        self
244    }
245    /// <p>A filter that returns only notebook instances that were modified after the specified time (timestamp).</p>
246    pub fn get_last_modified_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
247        self.inner.get_last_modified_time_after()
248    }
249    /// <p>A filter that returns only notebook instances with the specified status.</p>
250    pub fn status_equals(mut self, input: crate::types::NotebookInstanceStatus) -> Self {
251        self.inner = self.inner.status_equals(input);
252        self
253    }
254    /// <p>A filter that returns only notebook instances with the specified status.</p>
255    pub fn set_status_equals(mut self, input: ::std::option::Option<crate::types::NotebookInstanceStatus>) -> Self {
256        self.inner = self.inner.set_status_equals(input);
257        self
258    }
259    /// <p>A filter that returns only notebook instances with the specified status.</p>
260    pub fn get_status_equals(&self) -> &::std::option::Option<crate::types::NotebookInstanceStatus> {
261        self.inner.get_status_equals()
262    }
263    /// <p>A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.</p>
264    pub fn notebook_instance_lifecycle_config_name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265        self.inner = self.inner.notebook_instance_lifecycle_config_name_contains(input.into());
266        self
267    }
268    /// <p>A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.</p>
269    pub fn set_notebook_instance_lifecycle_config_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270        self.inner = self.inner.set_notebook_instance_lifecycle_config_name_contains(input);
271        self
272    }
273    /// <p>A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.</p>
274    pub fn get_notebook_instance_lifecycle_config_name_contains(&self) -> &::std::option::Option<::std::string::String> {
275        self.inner.get_notebook_instance_lifecycle_config_name_contains()
276    }
277    /// <p>A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.</p>
278    pub fn default_code_repository_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
279        self.inner = self.inner.default_code_repository_contains(input.into());
280        self
281    }
282    /// <p>A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.</p>
283    pub fn set_default_code_repository_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284        self.inner = self.inner.set_default_code_repository_contains(input);
285        self
286    }
287    /// <p>A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.</p>
288    pub fn get_default_code_repository_contains(&self) -> &::std::option::Option<::std::string::String> {
289        self.inner.get_default_code_repository_contains()
290    }
291    /// <p>A filter that returns only notebook instances with associated with the specified git repository.</p>
292    pub fn additional_code_repository_equals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.inner = self.inner.additional_code_repository_equals(input.into());
294        self
295    }
296    /// <p>A filter that returns only notebook instances with associated with the specified git repository.</p>
297    pub fn set_additional_code_repository_equals(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.inner = self.inner.set_additional_code_repository_equals(input);
299        self
300    }
301    /// <p>A filter that returns only notebook instances with associated with the specified git repository.</p>
302    pub fn get_additional_code_repository_equals(&self) -> &::std::option::Option<::std::string::String> {
303        self.inner.get_additional_code_repository_equals()
304    }
305}