aws_sdk_rekognition/operation/start_label_detection/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_label_detection::_start_label_detection_output::StartLabelDetectionOutputBuilder;
3
4pub use crate::operation::start_label_detection::_start_label_detection_input::StartLabelDetectionInputBuilder;
5
6impl crate::operation::start_label_detection::builders::StartLabelDetectionInputBuilder {
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::start_label_detection::StartLabelDetectionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_label_detection::StartLabelDetectionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_label_detection();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartLabelDetection`.
24///
25/// <p>Starts asynchronous detection of labels in a stored video.</p>
26/// <p>Amazon Rekognition Video can detect labels in a video. Labels are instances of real-world entities. This includes objects like flower, tree, and table; events like wedding, graduation, and birthday party; concepts like landscape, evening, and nature; and activities like a person getting out of a car or a person skiing.</p>
27/// <p>The video must be stored in an Amazon S3 bucket. Use <code>Video</code> to specify the bucket name and the filename of the video. <code>StartLabelDetection</code> returns a job identifier (<code>JobId</code>) which you use to get the results of the operation. When label detection is finished, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic that you specify in <code>NotificationChannel</code>.</p>
28/// <p>To get the results of the label detection operation, first check that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call <code>GetLabelDetection</code> and pass the job identifier (<code>JobId</code>) from the initial call to <code>StartLabelDetection</code>.</p>
29/// <p><i>Optional Parameters</i></p>
30/// <p><code>StartLabelDetection</code> has the <code>GENERAL_LABELS</code> Feature applied by default. This feature allows you to provide filtering criteria to the <code>Settings</code> parameter. You can filter with sets of individual labels or with label categories. You can specify inclusive filters, exclusive filters, or a combination of inclusive and exclusive filters. For more information on filtering, see <a href="https://docs.aws.amazon.com/rekognition/latest/dg/labels-detecting-labels-video.html">Detecting labels in a video</a>.</p>
31/// <p>You can specify <code>MinConfidence</code> to control the confidence threshold for the labels returned. The default is 50.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct StartLabelDetectionFluentBuilder {
34 handle: ::std::sync::Arc<crate::client::Handle>,
35 inner: crate::operation::start_label_detection::builders::StartLabelDetectionInputBuilder,
36 config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39 crate::client::customize::internal::CustomizableSend<
40 crate::operation::start_label_detection::StartLabelDetectionOutput,
41 crate::operation::start_label_detection::StartLabelDetectionError,
42 > for StartLabelDetectionFluentBuilder
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::start_label_detection::StartLabelDetectionOutput,
50 crate::operation::start_label_detection::StartLabelDetectionError,
51 >,
52 > {
53 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54 }
55}
56impl StartLabelDetectionFluentBuilder {
57 /// Creates a new `StartLabelDetectionFluentBuilder`.
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 StartLabelDetection as a reference.
66 pub fn as_input(&self) -> &crate::operation::start_label_detection::builders::StartLabelDetectionInputBuilder {
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::start_label_detection::StartLabelDetectionOutput,
81 ::aws_smithy_runtime_api::client::result::SdkError<
82 crate::operation::start_label_detection::StartLabelDetectionError,
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::start_label_detection::StartLabelDetection::operation_runtime_plugins(
91 self.handle.runtime_plugins.clone(),
92 &self.handle.conf,
93 self.config_override,
94 );
95 crate::operation::start_label_detection::StartLabelDetection::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::start_label_detection::StartLabelDetectionOutput,
103 crate::operation::start_label_detection::StartLabelDetectionError,
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 /// <p>The video in which you want to detect labels. The video must be stored in an Amazon S3 bucket.</p>
118 pub fn video(mut self, input: crate::types::Video) -> Self {
119 self.inner = self.inner.video(input);
120 self
121 }
122 /// <p>The video in which you want to detect labels. The video must be stored in an Amazon S3 bucket.</p>
123 pub fn set_video(mut self, input: ::std::option::Option<crate::types::Video>) -> Self {
124 self.inner = self.inner.set_video(input);
125 self
126 }
127 /// <p>The video in which you want to detect labels. The video must be stored in an Amazon S3 bucket.</p>
128 pub fn get_video(&self) -> &::std::option::Option<crate::types::Video> {
129 self.inner.get_video()
130 }
131 /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartLabelDetection</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
132 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.client_request_token(input.into());
134 self
135 }
136 /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartLabelDetection</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
137 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_client_request_token(input);
139 self
140 }
141 /// <p>Idempotent token used to identify the start request. If you use the same token with multiple <code>StartLabelDetection</code> requests, the same <code>JobId</code> is returned. Use <code>ClientRequestToken</code> to prevent the same job from being accidently started more than once.</p>
142 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_client_request_token()
144 }
145 /// <p>Specifies the minimum confidence that Amazon Rekognition Video must have in order to return a detected label. Confidence represents how certain Amazon Rekognition is that a label is correctly identified.0 is the lowest confidence. 100 is the highest confidence. Amazon Rekognition Video doesn't return any labels with a confidence level lower than this specified value.</p>
146 /// <p>If you don't specify <code>MinConfidence</code>, the operation returns labels and bounding boxes (if detected) with confidence values greater than or equal to 50 percent.</p>
147 pub fn min_confidence(mut self, input: f32) -> Self {
148 self.inner = self.inner.min_confidence(input);
149 self
150 }
151 /// <p>Specifies the minimum confidence that Amazon Rekognition Video must have in order to return a detected label. Confidence represents how certain Amazon Rekognition is that a label is correctly identified.0 is the lowest confidence. 100 is the highest confidence. Amazon Rekognition Video doesn't return any labels with a confidence level lower than this specified value.</p>
152 /// <p>If you don't specify <code>MinConfidence</code>, the operation returns labels and bounding boxes (if detected) with confidence values greater than or equal to 50 percent.</p>
153 pub fn set_min_confidence(mut self, input: ::std::option::Option<f32>) -> Self {
154 self.inner = self.inner.set_min_confidence(input);
155 self
156 }
157 /// <p>Specifies the minimum confidence that Amazon Rekognition Video must have in order to return a detected label. Confidence represents how certain Amazon Rekognition is that a label is correctly identified.0 is the lowest confidence. 100 is the highest confidence. Amazon Rekognition Video doesn't return any labels with a confidence level lower than this specified value.</p>
158 /// <p>If you don't specify <code>MinConfidence</code>, the operation returns labels and bounding boxes (if detected) with confidence values greater than or equal to 50 percent.</p>
159 pub fn get_min_confidence(&self) -> &::std::option::Option<f32> {
160 self.inner.get_min_confidence()
161 }
162 /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the label detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
163 pub fn notification_channel(mut self, input: crate::types::NotificationChannel) -> Self {
164 self.inner = self.inner.notification_channel(input);
165 self
166 }
167 /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the label detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
168 pub fn set_notification_channel(mut self, input: ::std::option::Option<crate::types::NotificationChannel>) -> Self {
169 self.inner = self.inner.set_notification_channel(input);
170 self
171 }
172 /// <p>The Amazon SNS topic ARN you want Amazon Rekognition Video to publish the completion status of the label detection operation to. The Amazon SNS topic must have a topic name that begins with <i>AmazonRekognition</i> if you are using the AmazonRekognitionServiceRole permissions policy.</p>
173 pub fn get_notification_channel(&self) -> &::std::option::Option<crate::types::NotificationChannel> {
174 self.inner.get_notification_channel()
175 }
176 /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
177 pub fn job_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.inner = self.inner.job_tag(input.into());
179 self
180 }
181 /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
182 pub fn set_job_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.inner = self.inner.set_job_tag(input);
184 self
185 }
186 /// <p>An identifier you specify that's returned in the completion notification that's published to your Amazon Simple Notification Service topic. For example, you can use <code>JobTag</code> to group related jobs and identify them in the completion notification.</p>
187 pub fn get_job_tag(&self) -> &::std::option::Option<::std::string::String> {
188 self.inner.get_job_tag()
189 }
190 ///
191 /// Appends an item to `Features`.
192 ///
193 /// To override the contents of this collection use [`set_features`](Self::set_features).
194 ///
195 /// <p>The features to return after video analysis. You can specify that GENERAL_LABELS are returned.</p>
196 pub fn features(mut self, input: crate::types::LabelDetectionFeatureName) -> Self {
197 self.inner = self.inner.features(input);
198 self
199 }
200 /// <p>The features to return after video analysis. You can specify that GENERAL_LABELS are returned.</p>
201 pub fn set_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LabelDetectionFeatureName>>) -> Self {
202 self.inner = self.inner.set_features(input);
203 self
204 }
205 /// <p>The features to return after video analysis. You can specify that GENERAL_LABELS are returned.</p>
206 pub fn get_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LabelDetectionFeatureName>> {
207 self.inner.get_features()
208 }
209 /// <p>The settings for a StartLabelDetection request.Contains the specified parameters for the label detection request of an asynchronous label analysis operation. Settings can include filters for GENERAL_LABELS.</p>
210 pub fn settings(mut self, input: crate::types::LabelDetectionSettings) -> Self {
211 self.inner = self.inner.settings(input);
212 self
213 }
214 /// <p>The settings for a StartLabelDetection request.Contains the specified parameters for the label detection request of an asynchronous label analysis operation. Settings can include filters for GENERAL_LABELS.</p>
215 pub fn set_settings(mut self, input: ::std::option::Option<crate::types::LabelDetectionSettings>) -> Self {
216 self.inner = self.inner.set_settings(input);
217 self
218 }
219 /// <p>The settings for a StartLabelDetection request.Contains the specified parameters for the label detection request of an asynchronous label analysis operation. Settings can include filters for GENERAL_LABELS.</p>
220 pub fn get_settings(&self) -> &::std::option::Option<crate::types::LabelDetectionSettings> {
221 self.inner.get_settings()
222 }
223}