aws_sdk_rekognition/operation/get_face_search/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_face_search::_get_face_search_output::GetFaceSearchOutputBuilder;
3
4pub use crate::operation::get_face_search::_get_face_search_input::GetFaceSearchInputBuilder;
5
6impl crate::operation::get_face_search::builders::GetFaceSearchInputBuilder {
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::get_face_search::GetFaceSearchOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_face_search::GetFaceSearchError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_face_search();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetFaceSearch`.
24///
25/// <p>Gets the face search results for Amazon Rekognition Video face search started by <code>StartFaceSearch</code>. The search returns faces in a collection that match the faces of persons detected in a video. It also includes the time(s) that faces are matched in the video.</p>
26/// <p>Face search in a video is an asynchronous operation. You start face search by calling to <code>StartFaceSearch</code> which returns a job identifier (<code>JobId</code>). When the search operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to <code>StartFaceSearch</code>. To get the search results, first check that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call <code>GetFaceSearch</code> and pass the job identifier (<code>JobId</code>) from the initial call to <code>StartFaceSearch</code>.</p>
27/// <p>For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.</p>
28/// <p>The search results are retured in an array, <code>Persons</code>, of <code>PersonMatch</code> objects. Each<code>PersonMatch</code> element contains details about the matching faces in the input collection, person information (facial attributes, bounding boxes, and person identifer) for the matched person, and the time the person was matched in the video.</p><note>
29/// <p><code>GetFaceSearch</code> only returns the default facial attributes (<code>BoundingBox</code>, <code>Confidence</code>, <code>Landmarks</code>, <code>Pose</code>, and <code>Quality</code>). The other facial attributes listed in the <code>Face</code> object of the following response syntax are not returned. For more information, see FaceDetail in the Amazon Rekognition Developer Guide.</p>
30/// </note>
31/// <p>By default, the <code>Persons</code> array is sorted by the time, in milliseconds from the start of the video, persons are matched. You can also sort by persons by specifying <code>INDEX</code> for the <code>SORTBY</code> input parameter.</p>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct GetFaceSearchFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::get_face_search::builders::GetFaceSearchInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::get_face_search::GetFaceSearchOutput,
41        crate::operation::get_face_search::GetFaceSearchError,
42    > for GetFaceSearchFluentBuilder
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::get_face_search::GetFaceSearchOutput,
50            crate::operation::get_face_search::GetFaceSearchError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl GetFaceSearchFluentBuilder {
57    /// Creates a new `GetFaceSearchFluentBuilder`.
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 GetFaceSearch as a reference.
66    pub fn as_input(&self) -> &crate::operation::get_face_search::builders::GetFaceSearchInputBuilder {
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::get_face_search::GetFaceSearchOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::get_face_search::GetFaceSearchError,
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::get_face_search::GetFaceSearch::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::get_face_search::GetFaceSearch::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::get_face_search::GetFaceSearchOutput,
103        crate::operation::get_face_search::GetFaceSearchError,
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::get_face_search::paginator::GetFaceSearchPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
120    pub fn into_paginator(self) -> crate::operation::get_face_search::paginator::GetFaceSearchPaginator {
121        crate::operation::get_face_search::paginator::GetFaceSearchPaginator::new(self.handle, self.inner)
122    }
123    /// <p>The job identifer for the search request. You get the job identifier from an initial call to <code>StartFaceSearch</code>.</p>
124    pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.job_id(input.into());
126        self
127    }
128    /// <p>The job identifer for the search request. You get the job identifier from an initial call to <code>StartFaceSearch</code>.</p>
129    pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_job_id(input);
131        self
132    }
133    /// <p>The job identifer for the search request. You get the job identifier from an initial call to <code>StartFaceSearch</code>.</p>
134    pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_job_id()
136    }
137    /// <p>Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.</p>
138    pub fn max_results(mut self, input: i32) -> Self {
139        self.inner = self.inner.max_results(input);
140        self
141    }
142    /// <p>Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.</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>Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.</p>
148    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
149        self.inner.get_max_results()
150    }
151    /// <p>If the previous response was incomplete (because there is more search results to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of search results.</p>
152    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.next_token(input.into());
154        self
155    }
156    /// <p>If the previous response was incomplete (because there is more search results to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of search results.</p>
157    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_next_token(input);
159        self
160    }
161    /// <p>If the previous response was incomplete (because there is more search results to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of search results.</p>
162    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_next_token()
164    }
165    /// <p>Sort to use for grouping faces in the response. Use <code>TIMESTAMP</code> to group faces by the time that they are recognized. Use <code>INDEX</code> to sort by recognized faces.</p>
166    pub fn sort_by(mut self, input: crate::types::FaceSearchSortBy) -> Self {
167        self.inner = self.inner.sort_by(input);
168        self
169    }
170    /// <p>Sort to use for grouping faces in the response. Use <code>TIMESTAMP</code> to group faces by the time that they are recognized. Use <code>INDEX</code> to sort by recognized faces.</p>
171    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::FaceSearchSortBy>) -> Self {
172        self.inner = self.inner.set_sort_by(input);
173        self
174    }
175    /// <p>Sort to use for grouping faces in the response. Use <code>TIMESTAMP</code> to group faces by the time that they are recognized. Use <code>INDEX</code> to sort by recognized faces.</p>
176    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::FaceSearchSortBy> {
177        self.inner.get_sort_by()
178    }
179}