aws_sdk_rekognition/operation/list_dataset_entries/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_dataset_entries::_list_dataset_entries_output::ListDatasetEntriesOutputBuilder;
3
4pub use crate::operation::list_dataset_entries::_list_dataset_entries_input::ListDatasetEntriesInputBuilder;
5
6impl crate::operation::list_dataset_entries::builders::ListDatasetEntriesInputBuilder {
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_entries::ListDatasetEntriesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_dataset_entries::ListDatasetEntriesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_dataset_entries();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListDatasetEntries`.
24///
25/// <note>
26/// <p>This operation applies only to Amazon Rekognition Custom Labels.</p>
27/// </note>
28/// <p>Lists the entries (images) within a dataset. An entry is a JSON Line that contains the information for a single image, including the image location, assigned labels, and object location bounding boxes. For more information, see <a href="https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-manifest-files.html">Creating a manifest file</a>.</p>
29/// <p>JSON Lines in the response include information about non-terminal errors found in the dataset. Non terminal errors are reported in <code>errors</code> lists within each JSON Line. The same information is reported in the training and testing validation result manifests that Amazon Rekognition Custom Labels creates during model training.</p>
30/// <p>You can filter the response in variety of ways, such as choosing which labels to return and returning JSON Lines created after a specific date.</p>
31/// <p>This operation requires permissions to perform the <code>rekognition:ListDatasetEntries</code> action.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct ListDatasetEntriesFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::list_dataset_entries::builders::ListDatasetEntriesInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::list_dataset_entries::ListDatasetEntriesOutput,
41 crate::operation::list_dataset_entries::ListDatasetEntriesError,
42 > for ListDatasetEntriesFluentBuilder
43{
44 fn send(
45 self,
46 config_override: crate::config::Builder,
47 ) -> crate::client::customize::internal::BoxFuture<
48 crate::client::customize::internal::SendResult<
49 crate::operation::list_dataset_entries::ListDatasetEntriesOutput,
50 crate::operation::list_dataset_entries::ListDatasetEntriesError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl ListDatasetEntriesFluentBuilder {
57 /// Creates a new `ListDatasetEntriesFluentBuilder`.
58 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59 Self {
60 handle,
61 inner: ::std::default::Default::default(),
62 config_override: ::std::option::Option::None,
63 }
64 }
65 /// Access the ListDatasetEntries as a reference.
66 pub fn as_input(&self) -> &crate::operation::list_dataset_entries::builders::ListDatasetEntriesInputBuilder {
67 &self.inner
68 }
69 /// Sends the request and returns the response.
70 ///
71 /// If an error occurs, an `SdkError` will be returned with additional details that
72 /// can be matched against.
73 ///
74 /// By default, any retryable failures will be retried twice. Retry behavior
75 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76 /// set when configuring the client.
77 pub async fn send(
78 self,
79 ) -> ::std::result::Result<
80 crate::operation::list_dataset_entries::ListDatasetEntriesOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::list_dataset_entries::ListDatasetEntriesError,
83 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84 >,
85 > {
86 let input = self
87 .inner
88 .build()
89 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90 let runtime_plugins = crate::operation::list_dataset_entries::ListDatasetEntries::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::list_dataset_entries::ListDatasetEntries::orchestrate(&runtime_plugins, input).await
96 }
97
98 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99 pub fn customize(
100 self,
101 ) -> crate::client::customize::CustomizableOperation<
102 crate::operation::list_dataset_entries::ListDatasetEntriesOutput,
103 crate::operation::list_dataset_entries::ListDatasetEntriesError,
104 Self,
105 > {
106 crate::client::customize::CustomizableOperation::new(self)
107 }
108 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109 self.set_config_override(::std::option::Option::Some(config_override.into()));
110 self
111 }
112
113 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114 self.config_override = config_override;
115 self
116 }
117 /// Create a paginator for this request
118 ///
119 /// Paginators are used by calling [`send().await`](crate::operation::list_dataset_entries::paginator::ListDatasetEntriesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120 pub fn into_paginator(self) -> crate::operation::list_dataset_entries::paginator::ListDatasetEntriesPaginator {
121 crate::operation::list_dataset_entries::paginator::ListDatasetEntriesPaginator::new(self.handle, self.inner)
122 }
123 /// <p>The Amazon Resource Name (ARN) for the dataset that you want to use.</p>
124 pub fn dataset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125 self.inner = self.inner.dataset_arn(input.into());
126 self
127 }
128 /// <p>The Amazon Resource Name (ARN) for the dataset that you want to use.</p>
129 pub fn set_dataset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.inner = self.inner.set_dataset_arn(input);
131 self
132 }
133 /// <p>The Amazon Resource Name (ARN) for the dataset that you want to use.</p>
134 pub fn get_dataset_arn(&self) -> &::std::option::Option<::std::string::String> {
135 self.inner.get_dataset_arn()
136 }
137 ///
138 /// Appends an item to `ContainsLabels`.
139 ///
140 /// To override the contents of this collection use [`set_contains_labels`](Self::set_contains_labels).
141 ///
142 /// <p>Specifies a label filter for the response. The response includes an entry only if one or more of the labels in <code>ContainsLabels</code> exist in the entry.</p>
143 pub fn contains_labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.contains_labels(input.into());
145 self
146 }
147 /// <p>Specifies a label filter for the response. The response includes an entry only if one or more of the labels in <code>ContainsLabels</code> exist in the entry.</p>
148 pub fn set_contains_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
149 self.inner = self.inner.set_contains_labels(input);
150 self
151 }
152 /// <p>Specifies a label filter for the response. The response includes an entry only if one or more of the labels in <code>ContainsLabels</code> exist in the entry.</p>
153 pub fn get_contains_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
154 self.inner.get_contains_labels()
155 }
156 /// <p>Specify <code>true</code> to get only the JSON Lines where the image is labeled. Specify <code>false</code> to get only the JSON Lines where the image isn't labeled. If you don't specify <code>Labeled</code>, <code>ListDatasetEntries</code> returns JSON Lines for labeled and unlabeled images.</p>
157 pub fn labeled(mut self, input: bool) -> Self {
158 self.inner = self.inner.labeled(input);
159 self
160 }
161 /// <p>Specify <code>true</code> to get only the JSON Lines where the image is labeled. Specify <code>false</code> to get only the JSON Lines where the image isn't labeled. If you don't specify <code>Labeled</code>, <code>ListDatasetEntries</code> returns JSON Lines for labeled and unlabeled images.</p>
162 pub fn set_labeled(mut self, input: ::std::option::Option<bool>) -> Self {
163 self.inner = self.inner.set_labeled(input);
164 self
165 }
166 /// <p>Specify <code>true</code> to get only the JSON Lines where the image is labeled. Specify <code>false</code> to get only the JSON Lines where the image isn't labeled. If you don't specify <code>Labeled</code>, <code>ListDatasetEntries</code> returns JSON Lines for labeled and unlabeled images.</p>
167 pub fn get_labeled(&self) -> &::std::option::Option<bool> {
168 self.inner.get_labeled()
169 }
170 /// <p>If specified, <code>ListDatasetEntries</code> only returns JSON Lines where the value of <code>SourceRefContains</code> is part of the <code>source-ref</code> field. The <code>source-ref</code> field contains the Amazon S3 location of the image. You can use <code>SouceRefContains</code> for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.</p>
171 pub fn source_ref_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.source_ref_contains(input.into());
173 self
174 }
175 /// <p>If specified, <code>ListDatasetEntries</code> only returns JSON Lines where the value of <code>SourceRefContains</code> is part of the <code>source-ref</code> field. The <code>source-ref</code> field contains the Amazon S3 location of the image. You can use <code>SouceRefContains</code> for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.</p>
176 pub fn set_source_ref_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177 self.inner = self.inner.set_source_ref_contains(input);
178 self
179 }
180 /// <p>If specified, <code>ListDatasetEntries</code> only returns JSON Lines where the value of <code>SourceRefContains</code> is part of the <code>source-ref</code> field. The <code>source-ref</code> field contains the Amazon S3 location of the image. You can use <code>SouceRefContains</code> for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.</p>
181 pub fn get_source_ref_contains(&self) -> &::std::option::Option<::std::string::String> {
182 self.inner.get_source_ref_contains()
183 }
184 /// <p>Specifies an error filter for the response. Specify <code>True</code> to only include entries that have errors.</p>
185 pub fn has_errors(mut self, input: bool) -> Self {
186 self.inner = self.inner.has_errors(input);
187 self
188 }
189 /// <p>Specifies an error filter for the response. Specify <code>True</code> to only include entries that have errors.</p>
190 pub fn set_has_errors(mut self, input: ::std::option::Option<bool>) -> Self {
191 self.inner = self.inner.set_has_errors(input);
192 self
193 }
194 /// <p>Specifies an error filter for the response. Specify <code>True</code> to only include entries that have errors.</p>
195 pub fn get_has_errors(&self) -> &::std::option::Option<bool> {
196 self.inner.get_has_errors()
197 }
198 /// <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>
199 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.next_token(input.into());
201 self
202 }
203 /// <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>
204 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.inner = self.inner.set_next_token(input);
206 self
207 }
208 /// <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>
209 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
210 self.inner.get_next_token()
211 }
212 /// <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>
213 pub fn max_results(mut self, input: i32) -> Self {
214 self.inner = self.inner.max_results(input);
215 self
216 }
217 /// <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>
218 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
219 self.inner = self.inner.set_max_results(input);
220 self
221 }
222 /// <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>
223 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
224 self.inner.get_max_results()
225 }
226}