aws_sdk_rekognition/
lib.rs

1#![allow(deprecated)]
2#![allow(unknown_lints)]
3#![allow(clippy::module_inception)]
4#![allow(clippy::upper_case_acronyms)]
5#![allow(clippy::large_enum_variant)]
6#![allow(clippy::wrong_self_convention)]
7#![allow(clippy::should_implement_trait)]
8#![allow(clippy::disallowed_names)]
9#![allow(clippy::vec_init_then_push)]
10#![allow(clippy::type_complexity)]
11#![allow(clippy::needless_return)]
12#![allow(clippy::derive_partial_eq_without_eq)]
13#![allow(clippy::result_large_err)]
14#![allow(clippy::unnecessary_map_on_constructor)]
15#![allow(clippy::deprecated_semver)]
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21#![cfg_attr(docsrs, feature(doc_cfg))]
22//! This is the API Reference for [Amazon Rekognition Image](https://docs.aws.amazon.com/rekognition/latest/dg/images.html), [Amazon Rekognition Custom Labels](https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/what-is.html), [Amazon Rekognition Stored Video](https://docs.aws.amazon.com/rekognition/latest/dg/video.html), [Amazon Rekognition Streaming Video](https://docs.aws.amazon.com/rekognition/latest/dg/streaming-video.html). It provides descriptions of actions, data types, common parameters, and common errors.
23//!
24//! __Amazon Rekognition Image__
25//!   - [AssociateFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_AssociateFaces.html)
26//!   - [CompareFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CompareFaces.html)
27//!   - [CreateCollection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateCollection.html)
28//!   - [CreateUser](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateUser.html)
29//!   - [DeleteCollection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteCollection.html)
30//!   - [DeleteFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteFaces.html)
31//!   - [DeleteUser](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteUser.html)
32//!   - [DescribeCollection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeCollection.html)
33//!   - [DetectFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectFaces.html)
34//!   - [DetectLabels](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectLabels.html)
35//!   - [DetectModerationLabels](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectModerationLabels.html)
36//!   - [DetectProtectiveEquipment](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectProtectiveEquipment.html)
37//!   - [DetectText](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectText.html)
38//!   - [DisassociateFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DisassociateFaces.html)
39//!   - [GetCelebrityInfo](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetCelebrityInfo.html)
40//!   - [GetMediaAnalysisJob](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetMediaAnalysisJob.html)
41//!   - [IndexFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_IndexFaces.html)
42//!   - [ListCollections](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListCollections.html)
43//!   - [ListMediaAnalysisJob](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListMediaAnalysisJob.html)
44//!   - [ListFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListFaces.html)
45//!   - [ListUsers](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListFaces.html)
46//!   - [RecognizeCelebrities](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_RecognizeCelebrities.html)
47//!   - [SearchFaces](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchFaces.html)
48//!   - [SearchFacesByImage](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchFacesByImage.html)
49//!   - [SearchUsers](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchUsers.html)
50//!   - [SearchUsersByImage](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_SearchUsersByImage.html)
51//!   - [StartMediaAnalysisJob](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartMediaAnalysisJob.html)
52//!
53//! __Amazon Rekognition Custom Labels__
54//!   - [CopyProjectVersion](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CopyProjectVersion.html)
55//!   - [CreateDataset](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateDataset.html)
56//!   - [CreateProject](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateProject.html)
57//!   - [CreateProjectVersion](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateProjectVersion.html)
58//!   - [DeleteDataset](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteDataset.html)
59//!   - [DeleteProject](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProject.html)
60//!   - [DeleteProjectPolicy](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProjectPolicy.html)
61//!   - [DeleteProjectVersion](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteProjectVersion.html)
62//!   - [DescribeDataset](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeDataset.html)
63//!   - [DescribeProjects](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeProjects.html)
64//!   - [DescribeProjectVersions](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeProjectVersions.html)
65//!   - [DetectCustomLabels](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DetectCustomLabels.html)
66//!   - [DistributeDatasetEntries](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DistributeDatasetEntries.html)
67//!   - [ListDatasetEntries](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListDatasetEntries.html)
68//!   - [ListDatasetLabels](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListDatasetLabels.html)
69//!   - [ListProjectPolicies](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListProjectPolicies.html)
70//!   - [PutProjectPolicy](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_PutProjectPolicy.html)
71//!   - [StartProjectVersion](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartProjectVersion.html)
72//!   - [StopProjectVersion](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StopProjectVersion.html)
73//!   - [UpdateDatasetEntries](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_UpdateDatasetEntries.html)
74//!
75//! __Amazon Rekognition Video Stored Video__
76//!   - [GetCelebrityRecognition](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetCelebrityRecognition.html)
77//!   - [GetContentModeration](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetContentModeration.html)
78//!   - [GetFaceDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceDetection.html)
79//!   - [GetFaceSearch](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetFaceSearch.html)
80//!   - [GetLabelDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetLabelDetection.html)
81//!   - [GetPersonTracking](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetPersonTracking.html)
82//!   - [GetSegmentDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetSegmentDetection.html)
83//!   - [GetTextDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_GetTextDetection.html)
84//!   - [StartCelebrityRecognition](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartCelebrityRecognition.html)
85//!   - [StartContentModeration](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartContentModeration.html)
86//!   - [StartFaceDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartFaceDetection.html)
87//!   - [StartFaceSearch](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartFaceSearch.html)
88//!   - [StartLabelDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartLabelDetection.html)
89//!   - [StartPersonTracking](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartPersonTracking.html)
90//!   - [StartSegmentDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartSegmentDetection.html)
91//!   - [StartTextDetection](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartTextDetection.html)
92//!
93//! __Amazon Rekognition Video Streaming Video__
94//!   - [CreateStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_CreateStreamProcessor.html)
95//!   - [DeleteStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DeleteStreamProcessor.html)
96//!   - [DescribeStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_DescribeStreamProcessor.html)
97//!   - [ListStreamProcessors](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_ListStreamProcessors.html)
98//!   - [StartStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StartStreamProcessor.html)
99//!   - [StopStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_StopStreamProcessor.html)
100//!   - [UpdateStreamProcessor](https://docs.aws.amazon.com/rekognition/latest/APIReference/API_UpdateStreamProcessor.html)
101//!
102//! ## Getting Started
103//!
104//! > Examples are available for many services and operations, check out the
105//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
106//!
107//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
108//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-rekognition` to
109//! your project, add the following to your **Cargo.toml** file:
110//!
111//! ```toml
112//! [dependencies]
113//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
114//! aws-sdk-rekognition = "1.93.0"
115//! tokio = { version = "1", features = ["full"] }
116//! ```
117//!
118//! Then in code, a client can be created with the following:
119//!
120//! ```rust,no_run
121//! use aws_sdk_rekognition as rekognition;
122//!
123//! #[::tokio::main]
124//! async fn main() -> Result<(), rekognition::Error> {
125//!     let config = aws_config::load_from_env().await;
126//!     let client = aws_sdk_rekognition::Client::new(&config);
127//!
128//!     // ... make some calls with the client
129//!
130//!     Ok(())
131//! }
132//! ```
133//!
134//! See the [client documentation](https://docs.rs/aws-sdk-rekognition/latest/aws_sdk_rekognition/client/struct.Client.html)
135//! for information on what calls can be made, and the inputs and outputs for each of those calls.
136//!
137//! ## Using the SDK
138//!
139//! Until the SDK is released, we will be adding information about using the SDK to the
140//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
141//! additional sections for the guide by opening an issue and describing what you are trying to do.
142//!
143//! ## Getting Help
144//!
145//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
146//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
147//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
148//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
149//!
150//!
151//! # Crate Organization
152//!
153//! The entry point for most customers will be [`Client`], which exposes one method for each API
154//! offered by Amazon Rekognition. The return value of each of these methods is a "fluent builder",
155//! where the different inputs for that API are added by builder-style function call chaining,
156//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
157//! either a successful output or a [`SdkError`](crate::error::SdkError).
158//!
159//! Some of these API inputs may be structs or enums to provide more complex structured information.
160//! These structs and enums live in [`types`](crate::types). There are some simpler types for
161//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
162//!
163//! All types required to configure a client via the [`Config`](crate::Config) struct live
164//! in [`config`](crate::config).
165//!
166//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
167//! is the input, output, and error type for that API, as well as builders to construct each of those.
168//!
169//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
170//! client can return. Any other error type can be converted to this `Error` type via the
171//! [`From`](std::convert::From) trait.
172//!
173//! The other modules within this crate are not required for normal usage.
174
175// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
176pub use error_meta::Error;
177
178#[doc(inline)]
179pub use config::Config;
180
181/// Client for calling Amazon Rekognition.
182/// ## Constructing a `Client`
183///
184/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
185/// crate should be used to automatically resolve this config using
186/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
187/// across multiple different AWS SDK clients. This config resolution process can be customized
188/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
189/// the [builder pattern] to customize the default config.
190///
191/// In the simplest case, creating a client looks as follows:
192/// ```rust,no_run
193/// # async fn wrapper() {
194/// let config = aws_config::load_from_env().await;
195/// let client = aws_sdk_rekognition::Client::new(&config);
196/// # }
197/// ```
198///
199/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
200/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
201/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
202/// done as follows:
203///
204/// ```rust,no_run
205/// # async fn wrapper() {
206/// let sdk_config = ::aws_config::load_from_env().await;
207/// let config = aws_sdk_rekognition::config::Builder::from(&sdk_config)
208/// # /*
209///     .some_service_specific_setting("value")
210/// # */
211///     .build();
212/// # }
213/// ```
214///
215/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
216///
217/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
218/// be done once at application start-up.
219///
220/// [`Config`]: crate::Config
221/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
222/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
223/// [`aws-config` docs]: https://docs.rs/aws-config/*
224/// [`aws-config`]: https://crates.io/crates/aws-config
225/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
226/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
227/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
228/// # Using the `Client`
229///
230/// A client has a function for every operation that can be performed by the service.
231/// For example, the [`AssociateFaces`](crate::operation::associate_faces) operation has
232/// a [`Client::associate_faces`], function which returns a builder for that operation.
233/// The fluent builder ultimately has a `send()` function that returns an async future that
234/// returns a result, as illustrated below:
235///
236/// ```rust,ignore
237/// let result = client.associate_faces()
238///     .collection_id("example")
239///     .send()
240///     .await;
241/// ```
242///
243/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
244/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
245/// information.
246/// # Waiters
247///
248/// This client provides `wait_until` methods behind the [`Waiters`](crate::client::Waiters) trait.
249/// To use them, simply import the trait, and then call one of the `wait_until` methods. This will
250/// return a waiter fluent builder that takes various parameters, which are documented on the builder
251/// type. Once parameters have been provided, the `wait` method can be called to initiate waiting.
252///
253/// For example, if there was a `wait_until_thing` method, it could look like:
254/// ```rust,ignore
255/// let result = client.wait_until_thing()
256///     .thing_id("someId")
257///     .wait(Duration::from_secs(120))
258///     .await;
259/// ```
260pub mod client;
261
262/// Configuration for Amazon Rekognition.
263pub mod config;
264
265/// Common errors and error handling utilities.
266pub mod error;
267
268mod error_meta;
269
270/// Information about this crate.
271pub mod meta;
272
273/// All operations that this crate can perform.
274pub mod operation;
275
276/// Primitives such as `Blob` or `DateTime` used by other types.
277pub mod primitives;
278
279/// Data structures used by operation inputs/outputs.
280pub mod types;
281
282pub(crate) mod client_idempotency_token;
283
284mod idempotency_token;
285
286pub(crate) mod protocol_serde;
287
288mod sdk_feature_tracker;
289
290mod serialization_settings;
291
292mod endpoint_lib;
293
294mod lens;
295
296mod serde_util;
297
298/// Supporting types for waiters.
299///
300/// Note: to use waiters, import the [`Waiters`](crate::client::Waiters) trait, which adds methods prefixed with `wait_until` to the client.
301pub mod waiters;
302
303mod json_errors;
304
305#[doc(inline)]
306pub use client::Client;