aws_sdk_bedrock/operation/list_custom_model_deployments/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_custom_model_deployments::_list_custom_model_deployments_output::ListCustomModelDeploymentsOutputBuilder;
3
4pub use crate::operation::list_custom_model_deployments::_list_custom_model_deployments_input::ListCustomModelDeploymentsInputBuilder;
5
6impl crate::operation::list_custom_model_deployments::builders::ListCustomModelDeploymentsInputBuilder {
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_custom_model_deployments::ListCustomModelDeploymentsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_custom_model_deployments();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListCustomModelDeployments`.
24///
25/// <p>Lists custom model deployments in your account. You can filter the results by creation time, name, status, and associated model. Use this operation to manage and monitor your custom model deployments.</p>
26/// <p>We recommend using pagination to ensure that the operation returns quickly and successfully.</p>
27/// <p>The following actions are related to the <code>ListCustomModelDeployments</code> operation:</p>
28/// <ul>
29/// <li>
30/// <p><a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateCustomModelDeployment.html">CreateCustomModelDeployment</a></p></li>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetCustomModelDeployment.html">GetCustomModelDeployment</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_DeleteCustomModelDeployment.html">DeleteCustomModelDeployment</a></p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct ListCustomModelDeploymentsFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::list_custom_model_deployments::builders::ListCustomModelDeploymentsInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsOutput,
45        crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsError,
46    > for ListCustomModelDeploymentsFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsOutput,
54            crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl ListCustomModelDeploymentsFluentBuilder {
61    /// Creates a new `ListCustomModelDeploymentsFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the ListCustomModelDeployments as a reference.
70    pub fn as_input(&self) -> &crate::operation::list_custom_model_deployments::builders::ListCustomModelDeploymentsInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::list_custom_model_deployments::ListCustomModelDeployments::operation_runtime_plugins(
95            self.handle.runtime_plugins.clone(),
96            &self.handle.conf,
97            self.config_override,
98        );
99        crate::operation::list_custom_model_deployments::ListCustomModelDeployments::orchestrate(&runtime_plugins, input).await
100    }
101
102    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103    pub fn customize(
104        self,
105    ) -> crate::client::customize::CustomizableOperation<
106        crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsOutput,
107        crate::operation::list_custom_model_deployments::ListCustomModelDeploymentsError,
108        Self,
109    > {
110        crate::client::customize::CustomizableOperation::new(self)
111    }
112    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113        self.set_config_override(::std::option::Option::Some(config_override.into()));
114        self
115    }
116
117    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118        self.config_override = config_override;
119        self
120    }
121    /// Create a paginator for this request
122    ///
123    /// Paginators are used by calling [`send().await`](crate::operation::list_custom_model_deployments::paginator::ListCustomModelDeploymentsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
124    pub fn into_paginator(self) -> crate::operation::list_custom_model_deployments::paginator::ListCustomModelDeploymentsPaginator {
125        crate::operation::list_custom_model_deployments::paginator::ListCustomModelDeploymentsPaginator::new(self.handle, self.inner)
126    }
127    /// <p>Filters deployments created before the specified date and time.</p>
128    pub fn created_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
129        self.inner = self.inner.created_before(input);
130        self
131    }
132    /// <p>Filters deployments created before the specified date and time.</p>
133    pub fn set_created_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
134        self.inner = self.inner.set_created_before(input);
135        self
136    }
137    /// <p>Filters deployments created before the specified date and time.</p>
138    pub fn get_created_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
139        self.inner.get_created_before()
140    }
141    /// <p>Filters deployments created after the specified date and time.</p>
142    pub fn created_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
143        self.inner = self.inner.created_after(input);
144        self
145    }
146    /// <p>Filters deployments created after the specified date and time.</p>
147    pub fn set_created_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
148        self.inner = self.inner.set_created_after(input);
149        self
150    }
151    /// <p>Filters deployments created after the specified date and time.</p>
152    pub fn get_created_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
153        self.inner.get_created_after()
154    }
155    /// <p>Filters deployments whose names contain the specified string.</p>
156    pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.name_contains(input.into());
158        self
159    }
160    /// <p>Filters deployments whose names contain the specified string.</p>
161    pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_name_contains(input);
163        self
164    }
165    /// <p>Filters deployments whose names contain the specified string.</p>
166    pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_name_contains()
168    }
169    /// <p>The maximum number of results to return in a single call.</p>
170    pub fn max_results(mut self, input: i32) -> Self {
171        self.inner = self.inner.max_results(input);
172        self
173    }
174    /// <p>The maximum number of results to return in a single call.</p>
175    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
176        self.inner = self.inner.set_max_results(input);
177        self
178    }
179    /// <p>The maximum number of results to return in a single call.</p>
180    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
181        self.inner.get_max_results()
182    }
183    /// <p>The token for the next set of results. Use this token to retrieve additional results when the response is truncated.</p>
184    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.next_token(input.into());
186        self
187    }
188    /// <p>The token for the next set of results. Use this token to retrieve additional results when the response is truncated.</p>
189    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_next_token(input);
191        self
192    }
193    /// <p>The token for the next set of results. Use this token to retrieve additional results when the response is truncated.</p>
194    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_next_token()
196    }
197    /// <p>The field to sort the results by. The only supported value is <code>CreationTime</code>.</p>
198    pub fn sort_by(mut self, input: crate::types::SortModelsBy) -> Self {
199        self.inner = self.inner.sort_by(input);
200        self
201    }
202    /// <p>The field to sort the results by. The only supported value is <code>CreationTime</code>.</p>
203    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::SortModelsBy>) -> Self {
204        self.inner = self.inner.set_sort_by(input);
205        self
206    }
207    /// <p>The field to sort the results by. The only supported value is <code>CreationTime</code>.</p>
208    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::SortModelsBy> {
209        self.inner.get_sort_by()
210    }
211    /// <p>The sort order for the results. Valid values are <code>Ascending</code> and <code>Descending</code>. Default is <code>Descending</code>.</p>
212    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
213        self.inner = self.inner.sort_order(input);
214        self
215    }
216    /// <p>The sort order for the results. Valid values are <code>Ascending</code> and <code>Descending</code>. Default is <code>Descending</code>.</p>
217    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
218        self.inner = self.inner.set_sort_order(input);
219        self
220    }
221    /// <p>The sort order for the results. Valid values are <code>Ascending</code> and <code>Descending</code>. Default is <code>Descending</code>.</p>
222    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
223        self.inner.get_sort_order()
224    }
225    /// <p>Filters deployments by status. Valid values are <code>CREATING</code>, <code>ACTIVE</code>, and <code>FAILED</code>.</p>
226    pub fn status_equals(mut self, input: crate::types::CustomModelDeploymentStatus) -> Self {
227        self.inner = self.inner.status_equals(input);
228        self
229    }
230    /// <p>Filters deployments by status. Valid values are <code>CREATING</code>, <code>ACTIVE</code>, and <code>FAILED</code>.</p>
231    pub fn set_status_equals(mut self, input: ::std::option::Option<crate::types::CustomModelDeploymentStatus>) -> Self {
232        self.inner = self.inner.set_status_equals(input);
233        self
234    }
235    /// <p>Filters deployments by status. Valid values are <code>CREATING</code>, <code>ACTIVE</code>, and <code>FAILED</code>.</p>
236    pub fn get_status_equals(&self) -> &::std::option::Option<crate::types::CustomModelDeploymentStatus> {
237        self.inner.get_status_equals()
238    }
239    /// <p>Filters deployments by the Amazon Resource Name (ARN) of the associated custom model.</p>
240    pub fn model_arn_equals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241        self.inner = self.inner.model_arn_equals(input.into());
242        self
243    }
244    /// <p>Filters deployments by the Amazon Resource Name (ARN) of the associated custom model.</p>
245    pub fn set_model_arn_equals(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_model_arn_equals(input);
247        self
248    }
249    /// <p>Filters deployments by the Amazon Resource Name (ARN) of the associated custom model.</p>
250    pub fn get_model_arn_equals(&self) -> &::std::option::Option<::std::string::String> {
251        self.inner.get_model_arn_equals()
252    }
253}