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