aws_sdk_organizations/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//! Organizations is a web service that enables you to consolidate your multiple Amazon Web Services accounts into an _organization_ and centrally manage your accounts and their resources.
23//!
24//! This guide provides descriptions of the Organizations operations. For more information about using this service, see the [Organizations User Guide](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html).
25//!
26//! __Support and feedback for Organizations__
27//!
28//! We welcome your feedback. You can post your feedback and questions in the [Organizations support forum](https://forums.aws.amazon.com/forum.jspa?forumID=219). For more information about the Amazon Web Services Support forums, see [Forums Help](https://forums.aws.amazon.com/help.jspa).
29//!
30//! __Endpoint to call When using the CLI or the Amazon Web Services SDK__
31//!
32//! For the current release of Organizations, specify the us-east-1 region for all Amazon Web Services API and CLI calls made from the commercial Amazon Web Services Regions outside of China. If calling from one of the Amazon Web Services Regions in China, then specify cn-northwest-1. You can do this in the CLI by using these parameters and commands:
33//! - Use the following parameter with each command to specify both the endpoint and its region: --endpoint-url https://organizations.us-east-1.amazonaws.com _(from commercial Amazon Web Services Regions outside of China)_ or --endpoint-url https://organizations.cn-northwest-1.amazonaws.com.cn _(from Amazon Web Services Regions in China)_
34//! - Use the default endpoint, but configure your default region with this command: aws configure set default.region us-east-1 _(from commercial Amazon Web Services Regions outside of China)_ or aws configure set default.region cn-northwest-1 _(from Amazon Web Services Regions in China)_
35//! - Use the following parameter with each command to specify the endpoint: --region us-east-1 _(from commercial Amazon Web Services Regions outside of China)_ or --region cn-northwest-1 _(from Amazon Web Services Regions in China)_
36//!
37//! __Recording API Requests__
38//!
39//! Organizations supports CloudTrail, a service that records Amazon Web Services API calls for your Amazon Web Services account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can determine which requests the Organizations service received, who made the request and when, and so on. For more about Organizations and its support for CloudTrail, see [Logging Organizations API calls with CloudTrail](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration) in the _Organizations User Guide_. To learn more about CloudTrail, including how to turn it on and find your log files, see the [CloudTrail User Guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
40//!
41//! ## Getting Started
42//!
43//! > Examples are available for many services and operations, check out the
44//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
45//!
46//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
47//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-organizations` to
48//! your project, add the following to your **Cargo.toml** file:
49//!
50//! ```toml
51//! [dependencies]
52//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
53//! aws-sdk-organizations = "1.106.0"
54//! tokio = { version = "1", features = ["full"] }
55//! ```
56//!
57//! Then in code, a client can be created with the following:
58//!
59//! ```rust,no_run
60//! use aws_sdk_organizations as organizations;
61//!
62//! #[::tokio::main]
63//! async fn main() -> Result<(), organizations::Error> {
64//! let config = aws_config::load_from_env().await;
65//! let client = aws_sdk_organizations::Client::new(&config);
66//!
67//! // ... make some calls with the client
68//!
69//! Ok(())
70//! }
71//! ```
72//!
73//! See the [client documentation](https://docs.rs/aws-sdk-organizations/latest/aws_sdk_organizations/client/struct.Client.html)
74//! for information on what calls can be made, and the inputs and outputs for each of those calls.
75//!
76//! ## Using the SDK
77//!
78//! Until the SDK is released, we will be adding information about using the SDK to the
79//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
80//! additional sections for the guide by opening an issue and describing what you are trying to do.
81//!
82//! ## Getting Help
83//!
84//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
85//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
86//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
87//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
88//!
89//!
90//! # Crate Organization
91//!
92//! The entry point for most customers will be [`Client`], which exposes one method for each API
93//! offered by AWS Organizations. The return value of each of these methods is a "fluent builder",
94//! where the different inputs for that API are added by builder-style function call chaining,
95//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
96//! either a successful output or a [`SdkError`](crate::error::SdkError).
97//!
98//! Some of these API inputs may be structs or enums to provide more complex structured information.
99//! These structs and enums live in [`types`](crate::types). There are some simpler types for
100//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
101//!
102//! All types required to configure a client via the [`Config`](crate::Config) struct live
103//! in [`config`](crate::config).
104//!
105//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
106//! is the input, output, and error type for that API, as well as builders to construct each of those.
107//!
108//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
109//! client can return. Any other error type can be converted to this `Error` type via the
110//! [`From`](std::convert::From) trait.
111//!
112//! The other modules within this crate are not required for normal usage.
113
114// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
115pub use error_meta::Error;
116
117#[doc(inline)]
118pub use config::Config;
119
120/// Client for calling AWS Organizations.
121/// ## Constructing a `Client`
122///
123/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
124/// crate should be used to automatically resolve this config using
125/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
126/// across multiple different AWS SDK clients. This config resolution process can be customized
127/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
128/// the [builder pattern] to customize the default config.
129///
130/// In the simplest case, creating a client looks as follows:
131/// ```rust,no_run
132/// # async fn wrapper() {
133/// let config = aws_config::load_from_env().await;
134/// let client = aws_sdk_organizations::Client::new(&config);
135/// # }
136/// ```
137///
138/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
139/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
140/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
141/// done as follows:
142///
143/// ```rust,no_run
144/// # async fn wrapper() {
145/// let sdk_config = ::aws_config::load_from_env().await;
146/// let config = aws_sdk_organizations::config::Builder::from(&sdk_config)
147/// # /*
148/// .some_service_specific_setting("value")
149/// # */
150/// .build();
151/// # }
152/// ```
153///
154/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
155///
156/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
157/// be done once at application start-up.
158///
159/// [`Config`]: crate::Config
160/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
161/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
162/// [`aws-config` docs]: https://docs.rs/aws-config/*
163/// [`aws-config`]: https://crates.io/crates/aws-config
164/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
165/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
166/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
167/// # Using the `Client`
168///
169/// A client has a function for every operation that can be performed by the service.
170/// For example, the [`AcceptHandshake`](crate::operation::accept_handshake) operation has
171/// a [`Client::accept_handshake`], function which returns a builder for that operation.
172/// The fluent builder ultimately has a `send()` function that returns an async future that
173/// returns a result, as illustrated below:
174///
175/// ```rust,ignore
176/// let result = client.accept_handshake()
177/// .handshake_id("example")
178/// .send()
179/// .await;
180/// ```
181///
182/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
183/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
184/// information.
185pub mod client;
186
187/// Configuration for AWS Organizations.
188pub mod config;
189
190/// Common errors and error handling utilities.
191pub mod error;
192
193mod error_meta;
194
195/// Information about this crate.
196pub mod meta;
197
198/// All operations that this crate can perform.
199pub mod operation;
200
201/// Primitives such as `Blob` or `DateTime` used by other types.
202pub mod primitives;
203
204/// Data structures used by operation inputs/outputs.
205pub mod types;
206
207pub(crate) mod protocol_serde;
208
209mod sdk_feature_tracker;
210
211mod serialization_settings;
212
213mod endpoint_lib;
214
215mod lens;
216
217mod json_errors;
218
219mod serde_util;
220
221#[doc(inline)]
222pub use client::Client;