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