aws_sdk_proton/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 Proton Service API Reference. It provides descriptions, syntax and usage examples for each of the [actions](https://docs.aws.amazon.com/proton/latest/APIReference/API_Operations.html) and [data types](https://docs.aws.amazon.com/proton/latest/APIReference/API_Types.html) for the Proton service.
23//!
24//! The documentation for each action shows the Query API request parameters and the XML response.
25//!
26//! Alternatively, you can use the Amazon Web Services CLI to access an API. For more information, see the [Amazon Web Services Command Line Interface User Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).
27//!
28//! The Proton service is a two-pronged automation framework. Administrators create service templates to provide standardized infrastructure and deployment tooling for serverless and container based applications. Developers, in turn, select from the available service templates to automate their application or service deployments.
29//!
30//! Because administrators define the infrastructure and tooling that Proton deploys and manages, they need permissions to use all of the listed API operations.
31//!
32//! When developers select a specific infrastructure and tooling set, Proton deploys their applications. To monitor their applications that are running on Proton, developers need permissions to the service _create_, _list_, _update_ and _delete_ API operations and the service instance _list_ and _update_ API operations.
33//!
34//! To learn more about Proton, see the [Proton User Guide](https://docs.aws.amazon.com/proton/latest/userguide/Welcome.html).
35//!
36//! __Ensuring Idempotency__
37//!
38//! When you make a mutating API request, the request typically returns a result before the asynchronous workflows of the operation are complete. Operations might also time out or encounter other server issues before they're complete, even if the request already returned a result. This might make it difficult to determine whether the request succeeded. Moreover, you might need to retry the request multiple times to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation occurs multiple times. This means that you might create more resources than you intended.
39//!
40//! _Idempotency_ ensures that an API request action completes no more than one time. With an idempotent request, if the original request action completes successfully, any subsequent retries complete successfully without performing any further actions. However, the result might contain updated information, such as the current creation status.
41//!
42//! The following lists of APIs are grouped according to methods that ensure idempotency.
43//!
44//! __Idempotent create APIs with a client token__
45//!
46//! The API actions in this list support idempotency with the use of a _client token_. The corresponding Amazon Web Services CLI commands also support idempotency using a client token. A client token is a unique, case-sensitive string of up to 64 ASCII characters. To make an idempotent API request using one of these actions, specify a client token in the request. We recommend that you _don't_ reuse the same client token for other API requests. If you don’t provide a client token for these APIs, a default client token is automatically provided by SDKs.
47//!
48//! Given a request action that has succeeded:
49//!
50//! If you retry the request using the same client token and the same parameters, the retry succeeds without performing any further actions other than returning the original resource detail data in the response.
51//!
52//! If you retry the request using the same client token, but one or more of the parameters are different, the retry throws a ValidationException with an IdempotentParameterMismatch error.
53//!
54//! Client tokens expire eight hours after a request is made. If you retry the request with the expired token, a new resource is created.
55//!
56//! If the original resource is deleted and you retry the request, a new resource is created.
57//!
58//! Idempotent create APIs with a client token:
59//! - CreateEnvironmentTemplateVersion
60//! - CreateServiceTemplateVersion
61//! - CreateEnvironmentAccountConnection
62//!
63//! __Idempotent create APIs__
64//!
65//! Given a request action that has succeeded:
66//!
67//! If you retry the request with an API from this group, and the original resource _hasn't_ been modified, the retry succeeds without performing any further actions other than returning the original resource detail data in the response.
68//!
69//! If the original resource has been modified, the retry throws a ConflictException.
70//!
71//! If you retry with different input parameters, the retry throws a ValidationException with an IdempotentParameterMismatch error.
72//!
73//! Idempotent create APIs:
74//! - CreateEnvironmentTemplate
75//! - CreateServiceTemplate
76//! - CreateEnvironment
77//! - CreateService
78//!
79//! __Idempotent delete APIs__
80//!
81//! Given a request action that has succeeded:
82//!
83//! When you retry the request with an API from this group and the resource was deleted, its metadata is returned in the response.
84//!
85//! If you retry and the resource doesn't exist, the response is empty.
86//!
87//! In both cases, the retry succeeds.
88//!
89//! Idempotent delete APIs:
90//! - DeleteEnvironmentTemplate
91//! - DeleteEnvironmentTemplateVersion
92//! - DeleteServiceTemplate
93//! - DeleteServiceTemplateVersion
94//! - DeleteEnvironmentAccountConnection
95//!
96//! __Asynchronous idempotent delete APIs__
97//!
98//! Given a request action that has succeeded:
99//!
100//! If you retry the request with an API from this group, if the original request delete operation status is DELETE_IN_PROGRESS, the retry returns the resource detail data in the response without performing any further actions.
101//!
102//! If the original request delete operation is complete, a retry returns an empty response.
103//!
104//! Asynchronous idempotent delete APIs:
105//! - DeleteEnvironment
106//! - DeleteService
107//!
108//! ## Getting Started
109//!
110//! > Examples are available for many services and operations, check out the
111//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
112//!
113//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
114//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-proton` to
115//! your project, add the following to your **Cargo.toml** file:
116//!
117//! ```toml
118//! [dependencies]
119//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
120//! aws-sdk-proton = "1.86.0"
121//! tokio = { version = "1", features = ["full"] }
122//! ```
123//!
124//! Then in code, a client can be created with the following:
125//!
126//! ```rust,no_run
127//! use aws_sdk_proton as proton;
128//!
129//! #[::tokio::main]
130//! async fn main() -> Result<(), proton::Error> {
131//! let config = aws_config::load_from_env().await;
132//! let client = aws_sdk_proton::Client::new(&config);
133//!
134//! // ... make some calls with the client
135//!
136//! Ok(())
137//! }
138//! ```
139//!
140//! See the [client documentation](https://docs.rs/aws-sdk-proton/latest/aws_sdk_proton/client/struct.Client.html)
141//! for information on what calls can be made, and the inputs and outputs for each of those calls.
142//!
143//! ## Using the SDK
144//!
145//! Until the SDK is released, we will be adding information about using the SDK to the
146//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
147//! additional sections for the guide by opening an issue and describing what you are trying to do.
148//!
149//! ## Getting Help
150//!
151//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
152//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
153//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
154//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
155//!
156//!
157//! # Crate Organization
158//!
159//! The entry point for most customers will be [`Client`], which exposes one method for each API
160//! offered by AWS Proton. The return value of each of these methods is a "fluent builder",
161//! where the different inputs for that API are added by builder-style function call chaining,
162//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
163//! either a successful output or a [`SdkError`](crate::error::SdkError).
164//!
165//! Some of these API inputs may be structs or enums to provide more complex structured information.
166//! These structs and enums live in [`types`](crate::types). There are some simpler types for
167//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
168//!
169//! All types required to configure a client via the [`Config`](crate::Config) struct live
170//! in [`config`](crate::config).
171//!
172//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
173//! is the input, output, and error type for that API, as well as builders to construct each of those.
174//!
175//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
176//! client can return. Any other error type can be converted to this `Error` type via the
177//! [`From`](std::convert::From) trait.
178//!
179//! The other modules within this crate are not required for normal usage.
180
181// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
182pub use error_meta::Error;
183
184#[doc(inline)]
185pub use config::Config;
186
187/// Client for calling AWS Proton.
188/// ## Constructing a `Client`
189///
190/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
191/// crate should be used to automatically resolve this config using
192/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
193/// across multiple different AWS SDK clients. This config resolution process can be customized
194/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
195/// the [builder pattern] to customize the default config.
196///
197/// In the simplest case, creating a client looks as follows:
198/// ```rust,no_run
199/// # async fn wrapper() {
200/// let config = aws_config::load_from_env().await;
201/// let client = aws_sdk_proton::Client::new(&config);
202/// # }
203/// ```
204///
205/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
206/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
207/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
208/// done as follows:
209///
210/// ```rust,no_run
211/// # async fn wrapper() {
212/// let sdk_config = ::aws_config::load_from_env().await;
213/// let config = aws_sdk_proton::config::Builder::from(&sdk_config)
214/// # /*
215/// .some_service_specific_setting("value")
216/// # */
217/// .build();
218/// # }
219/// ```
220///
221/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
222///
223/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
224/// be done once at application start-up.
225///
226/// [`Config`]: crate::Config
227/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
228/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
229/// [`aws-config` docs]: https://docs.rs/aws-config/*
230/// [`aws-config`]: https://crates.io/crates/aws-config
231/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
232/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
233/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
234/// # Using the `Client`
235///
236/// A client has a function for every operation that can be performed by the service.
237/// For example, the [`AcceptEnvironmentAccountConnection`](crate::operation::accept_environment_account_connection) operation has
238/// a [`Client::accept_environment_account_connection`], function which returns a builder for that operation.
239/// The fluent builder ultimately has a `send()` function that returns an async future that
240/// returns a result, as illustrated below:
241///
242/// ```rust,ignore
243/// let result = client.accept_environment_account_connection()
244/// .id("example")
245/// .send()
246/// .await;
247/// ```
248///
249/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
250/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
251/// information.
252/// # Waiters
253///
254/// This client provides `wait_until` methods behind the [`Waiters`](crate::client::Waiters) trait.
255/// To use them, simply import the trait, and then call one of the `wait_until` methods. This will
256/// return a waiter fluent builder that takes various parameters, which are documented on the builder
257/// type. Once parameters have been provided, the `wait` method can be called to initiate waiting.
258///
259/// For example, if there was a `wait_until_thing` method, it could look like:
260/// ```rust,ignore
261/// let result = client.wait_until_thing()
262/// .thing_id("someId")
263/// .wait(Duration::from_secs(120))
264/// .await;
265/// ```
266pub mod client;
267
268/// Configuration for AWS Proton.
269pub mod config;
270
271/// Common errors and error handling utilities.
272pub mod error;
273
274mod error_meta;
275
276/// Information about this crate.
277pub mod meta;
278
279/// All operations that this crate can perform.
280pub mod operation;
281
282/// Primitives such as `Blob` or `DateTime` used by other types.
283pub mod primitives;
284
285/// Data structures used by operation inputs/outputs.
286pub mod types;
287
288pub(crate) mod client_idempotency_token;
289
290mod idempotency_token;
291
292pub(crate) mod protocol_serde;
293
294mod sdk_feature_tracker;
295
296mod serialization_settings;
297
298mod endpoint_lib;
299
300mod lens;
301
302mod serde_util;
303
304/// Supporting types for waiters.
305///
306/// Note: to use waiters, import the [`Waiters`](crate::client::Waiters) trait, which adds methods prefixed with `wait_until` to the client.
307pub mod waiters;
308
309mod json_errors;
310
311#[doc(inline)]
312pub use client::Client;