aws_sdk_rekognition/operation/list_dataset_labels/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_dataset_labels::_list_dataset_labels_output::ListDatasetLabelsOutputBuilder;
3
4pub use crate::operation::list_dataset_labels::_list_dataset_labels_input::ListDatasetLabelsInputBuilder;
5
6impl crate::operation::list_dataset_labels::builders::ListDatasetLabelsInputBuilder {
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_dataset_labels::ListDatasetLabelsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_dataset_labels::ListDatasetLabelsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_dataset_labels();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListDatasetLabels`.
24///
25/// <note>
26/// <p>This operation applies only to Amazon Rekognition Custom Labels.</p>
27/// </note>
28/// <p>Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see <a href="https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-labeling-images.html">Labeling images</a>.</p>
29/// <p>Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see Labeling images in the <i>Amazon Rekognition Custom Labels Developer Guide</i>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct ListDatasetLabelsFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::list_dataset_labels::builders::ListDatasetLabelsInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::list_dataset_labels::ListDatasetLabelsOutput,
39        crate::operation::list_dataset_labels::ListDatasetLabelsError,
40    > for ListDatasetLabelsFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::list_dataset_labels::ListDatasetLabelsOutput,
48            crate::operation::list_dataset_labels::ListDatasetLabelsError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl ListDatasetLabelsFluentBuilder {
55    /// Creates a new `ListDatasetLabelsFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the ListDatasetLabels as a reference.
64    pub fn as_input(&self) -> &crate::operation::list_dataset_labels::builders::ListDatasetLabelsInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::list_dataset_labels::ListDatasetLabelsOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::list_dataset_labels::ListDatasetLabelsError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::list_dataset_labels::ListDatasetLabels::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::list_dataset_labels::ListDatasetLabels::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::list_dataset_labels::ListDatasetLabelsOutput,
101        crate::operation::list_dataset_labels::ListDatasetLabelsError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// Create a paginator for this request
116    ///
117    /// Paginators are used by calling [`send().await`](crate::operation::list_dataset_labels::paginator::ListDatasetLabelsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
118    pub fn into_paginator(self) -> crate::operation::list_dataset_labels::paginator::ListDatasetLabelsPaginator {
119        crate::operation::list_dataset_labels::paginator::ListDatasetLabelsPaginator::new(self.handle, self.inner)
120    }
121    /// <p>The Amazon Resource Name (ARN) of the dataset that you want to use.</p>
122    pub fn dataset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.dataset_arn(input.into());
124        self
125    }
126    /// <p>The Amazon Resource Name (ARN) of the dataset that you want to use.</p>
127    pub fn set_dataset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_dataset_arn(input);
129        self
130    }
131    /// <p>The Amazon Resource Name (ARN) of the dataset that you want to use.</p>
132    pub fn get_dataset_arn(&self) -> &::std::option::Option<::std::string::String> {
133        self.inner.get_dataset_arn()
134    }
135    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
136    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.next_token(input.into());
138        self
139    }
140    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
141    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_next_token(input);
143        self
144    }
145    /// <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.</p>
146    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_next_token()
148    }
149    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.</p>
150    pub fn max_results(mut self, input: i32) -> Self {
151        self.inner = self.inner.max_results(input);
152        self
153    }
154    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.</p>
155    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
156        self.inner = self.inner.set_max_results(input);
157        self
158    }
159    /// <p>The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.</p>
160    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
161        self.inner.get_max_results()
162    }
163}