aws_sdk_codecommit/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::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![forbid(unsafe_code)]
21#![warn(missing_docs)]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23//! This is the _CodeCommit API Reference_. This reference provides descriptions of the operations and data types for CodeCommit API along with usage examples.
24//!
25//! You can use the CodeCommit API to work with the following objects:
26//!
27//! Repositories, by calling the following:
28//! - BatchGetRepositories, which returns information about one or more repositories associated with your Amazon Web Services account.
29//! - CreateRepository, which creates an CodeCommit repository.
30//! - DeleteRepository, which deletes an CodeCommit repository.
31//! - GetRepository, which returns information about a specified repository.
32//! - ListRepositories, which lists all CodeCommit repositories associated with your Amazon Web Services account.
33//! - UpdateRepositoryDescription, which sets or updates the description of the repository.
34//! - UpdateRepositoryEncryptionKey, which updates the Key Management Service encryption key used to encrypt and decrypt a repository.
35//! - UpdateRepositoryName, which changes the name of the repository. If you change the name of a repository, no other users of that repository can access it until you send them the new HTTPS or SSH URL to use.
36//!
37//! Branches, by calling the following:
38//! - CreateBranch, which creates a branch in a specified repository.
39//! - DeleteBranch, which deletes the specified branch in a repository unless it is the default branch.
40//! - GetBranch, which returns information about a specified branch.
41//! - ListBranches, which lists all branches for a specified repository.
42//! - UpdateDefaultBranch, which changes the default branch for a repository.
43//!
44//! Files, by calling the following:
45//! - DeleteFile, which deletes the content of a specified file from a specified branch.
46//! - GetBlob, which returns the base-64 encoded content of an individual Git blob object in a repository.
47//! - GetFile, which returns the base-64 encoded content of a specified file.
48//! - GetFolder, which returns the contents of a specified folder or directory.
49//! - ListFileCommitHistory, which retrieves a list of commits and changes to a specified file.
50//! - PutFile, which adds or modifies a single file in a specified repository and branch.
51//!
52//! Commits, by calling the following:
53//! - BatchGetCommits, which returns information about one or more commits in a repository.
54//! - CreateCommit, which creates a commit for changes to a repository.
55//! - GetCommit, which returns information about a commit, including commit messages and author and committer information.
56//! - GetDifferences, which returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference).
57//!
58//! Merges, by calling the following:
59//! - BatchDescribeMergeConflicts, which returns information about conflicts in a merge between commits in a repository.
60//! - CreateUnreferencedMergeCommit, which creates an unreferenced commit between two branches or commits for the purpose of comparing them and identifying any potential conflicts.
61//! - DescribeMergeConflicts, which returns information about merge conflicts between the base, source, and destination versions of a file in a potential merge.
62//! - GetMergeCommit, which returns information about the merge between a source and destination commit.
63//! - GetMergeConflicts, which returns information about merge conflicts between the source and destination branch in a pull request.
64//! - GetMergeOptions, which returns information about the available merge options between two branches or commit specifiers.
65//! - MergeBranchesByFastForward, which merges two branches using the fast-forward merge option.
66//! - MergeBranchesBySquash, which merges two branches using the squash merge option.
67//! - MergeBranchesByThreeWay, which merges two branches using the three-way merge option.
68//!
69//! Pull requests, by calling the following:
70//! - CreatePullRequest, which creates a pull request in a specified repository.
71//! - CreatePullRequestApprovalRule, which creates an approval rule for a specified pull request.
72//! - DeletePullRequestApprovalRule, which deletes an approval rule for a specified pull request.
73//! - DescribePullRequestEvents, which returns information about one or more pull request events.
74//! - EvaluatePullRequestApprovalRules, which evaluates whether a pull request has met all the conditions specified in its associated approval rules.
75//! - GetCommentsForPullRequest, which returns information about comments on a specified pull request.
76//! - GetPullRequest, which returns information about a specified pull request.
77//! - GetPullRequestApprovalStates, which returns information about the approval states for a specified pull request.
78//! - GetPullRequestOverrideState, which returns information about whether approval rules have been set aside (overriden) for a pull request, and if so, the Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.
79//! - ListPullRequests, which lists all pull requests for a repository.
80//! - MergePullRequestByFastForward, which merges the source destination branch of a pull request into the specified destination branch for that pull request using the fast-forward merge option.
81//! - MergePullRequestBySquash, which merges the source destination branch of a pull request into the specified destination branch for that pull request using the squash merge option.
82//! - MergePullRequestByThreeWay, which merges the source destination branch of a pull request into the specified destination branch for that pull request using the three-way merge option.
83//! - OverridePullRequestApprovalRules, which sets aside all approval rule requirements for a pull request.
84//! - PostCommentForPullRequest, which posts a comment to a pull request at the specified line, file, or request.
85//! - UpdatePullRequestApprovalRuleContent, which updates the structure of an approval rule for a pull request.
86//! - UpdatePullRequestApprovalState, which updates the state of an approval on a pull request.
87//! - UpdatePullRequestDescription, which updates the description of a pull request.
88//! - UpdatePullRequestStatus, which updates the status of a pull request.
89//! - UpdatePullRequestTitle, which updates the title of a pull request.
90//!
91//! Approval rule templates, by calling the following:
92//! - AssociateApprovalRuleTemplateWithRepository, which associates a template with a specified repository. After the template is associated with a repository, CodeCommit creates approval rules that match the template conditions on every pull request created in the specified repository.
93//! - BatchAssociateApprovalRuleTemplateWithRepositories, which associates a template with one or more specified repositories. After the template is associated with a repository, CodeCommit creates approval rules that match the template conditions on every pull request created in the specified repositories.
94//! - BatchDisassociateApprovalRuleTemplateFromRepositories, which removes the association between a template and specified repositories so that approval rules based on the template are not automatically created when pull requests are created in those repositories.
95//! - CreateApprovalRuleTemplate, which creates a template for approval rules that can then be associated with one or more repositories in your Amazon Web Services account.
96//! - DeleteApprovalRuleTemplate, which deletes the specified template. It does not remove approval rules on pull requests already created with the template.
97//! - DisassociateApprovalRuleTemplateFromRepository, which removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository.
98//! - GetApprovalRuleTemplate, which returns information about an approval rule template.
99//! - ListApprovalRuleTemplates, which lists all approval rule templates in the Amazon Web Services Region in your Amazon Web Services account.
100//! - ListAssociatedApprovalRuleTemplatesForRepository, which lists all approval rule templates that are associated with a specified repository.
101//! - ListRepositoriesForApprovalRuleTemplate, which lists all repositories associated with the specified approval rule template.
102//! - UpdateApprovalRuleTemplateDescription, which updates the description of an approval rule template.
103//! - UpdateApprovalRuleTemplateName, which updates the name of an approval rule template.
104//! - UpdateApprovalRuleTemplateContent, which updates the content of an approval rule template.
105//!
106//! Comments in a repository, by calling the following:
107//! - DeleteCommentContent, which deletes the content of a comment on a commit in a repository.
108//! - GetComment, which returns information about a comment on a commit.
109//! - GetCommentReactions, which returns information about emoji reactions to comments.
110//! - GetCommentsForComparedCommit, which returns information about comments on the comparison between two commit specifiers in a repository.
111//! - PostCommentForComparedCommit, which creates a comment on the comparison between two commit specifiers in a repository.
112//! - PostCommentReply, which creates a reply to a comment.
113//! - PutCommentReaction, which creates or updates an emoji reaction to a comment.
114//! - UpdateComment, which updates the content of a comment on a commit in a repository.
115//!
116//! Tags used to tag resources in CodeCommit (not Git tags), by calling the following:
117//! - ListTagsForResource, which gets information about Amazon Web Servicestags for a specified Amazon Resource Name (ARN) in CodeCommit.
118//! - TagResource, which adds or updates tags for a resource in CodeCommit.
119//! - UntagResource, which removes tags for a resource in CodeCommit.
120//!
121//! Triggers, by calling the following:
122//! - GetRepositoryTriggers, which returns information about triggers configured for a repository.
123//! - PutRepositoryTriggers, which replaces all triggers for a repository and can be used to create or delete triggers.
124//! - TestRepositoryTriggers, which tests the functionality of a repository trigger by sending data to the trigger target.
125//!
126//! For information about how to use CodeCommit, see the [CodeCommit User Guide](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html).
127//!
128//! ## Getting Started
129//!
130//! > Examples are available for many services and operations, check out the
131//! > [usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1).
132//!
133//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio)
134//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-codecommit` to
135//! your project, add the following to your **Cargo.toml** file:
136//!
137//! ```toml
138//! [dependencies]
139//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] }
140//! aws-sdk-codecommit = "1.95.0"
141//! tokio = { version = "1", features = ["full"] }
142//! ```
143//!
144//! Then in code, a client can be created with the following:
145//!
146//! ```rust,no_run
147//! use aws_sdk_codecommit as codecommit;
148//!
149//! #[::tokio::main]
150//! async fn main() -> Result<(), codecommit::Error> {
151//! let config = aws_config::load_from_env().await;
152//! let client = aws_sdk_codecommit::Client::new(&config);
153//!
154//! // ... make some calls with the client
155//!
156//! Ok(())
157//! }
158//! ```
159//!
160//! See the [client documentation](https://docs.rs/aws-sdk-codecommit/latest/aws_sdk_codecommit/client/struct.Client.html)
161//! for information on what calls can be made, and the inputs and outputs for each of those calls.
162//!
163//! ## Using the SDK
164//!
165//! Until the SDK is released, we will be adding information about using the SDK to the
166//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest
167//! additional sections for the guide by opening an issue and describing what you are trying to do.
168//!
169//! ## Getting Help
170//!
171//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions
172//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests
173//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/)
174//! * [Usage examples](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1)
175//!
176//!
177//! # Crate Organization
178//!
179//! The entry point for most customers will be [`Client`], which exposes one method for each API
180//! offered by AWS CodeCommit. The return value of each of these methods is a "fluent builder",
181//! where the different inputs for that API are added by builder-style function call chaining,
182//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in
183//! either a successful output or a [`SdkError`](crate::error::SdkError).
184//!
185//! Some of these API inputs may be structs or enums to provide more complex structured information.
186//! These structs and enums live in [`types`](crate::types). There are some simpler types for
187//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives).
188//!
189//! All types required to configure a client via the [`Config`](crate::Config) struct live
190//! in [`config`](crate::config).
191//!
192//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule
193//! is the input, output, and error type for that API, as well as builders to construct each of those.
194//!
195//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the
196//! client can return. Any other error type can be converted to this `Error` type via the
197//! [`From`](std::convert::From) trait.
198//!
199//! The other modules within this crate are not required for normal usage.
200
201// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
202pub use error_meta::Error;
203
204#[doc(inline)]
205pub use config::Config;
206
207/// Client for calling AWS CodeCommit.
208/// ## Constructing a `Client`
209///
210/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`]
211/// crate should be used to automatically resolve this config using
212/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared
213/// across multiple different AWS SDK clients. This config resolution process can be customized
214/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses
215/// the [builder pattern] to customize the default config.
216///
217/// In the simplest case, creating a client looks as follows:
218/// ```rust,no_run
219/// # async fn wrapper() {
220/// let config = aws_config::load_from_env().await;
221/// let client = aws_sdk_codecommit::Client::new(&config);
222/// # }
223/// ```
224///
225/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that
226/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired.
227/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be
228/// done as follows:
229///
230/// ```rust,no_run
231/// # async fn wrapper() {
232/// let sdk_config = ::aws_config::load_from_env().await;
233/// let config = aws_sdk_codecommit::config::Builder::from(&sdk_config)
234/// # /*
235/// .some_service_specific_setting("value")
236/// # */
237/// .build();
238/// # }
239/// ```
240///
241/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration.
242///
243/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should
244/// be done once at application start-up.
245///
246/// [`Config`]: crate::Config
247/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html
248/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html
249/// [`aws-config` docs]: https://docs.rs/aws-config/*
250/// [`aws-config`]: https://crates.io/crates/aws-config
251/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html
252/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html
253/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder
254/// # Using the `Client`
255///
256/// A client has a function for every operation that can be performed by the service.
257/// For example, the [`AssociateApprovalRuleTemplateWithRepository`](crate::operation::associate_approval_rule_template_with_repository) operation has
258/// a [`Client::associate_approval_rule_template_with_repository`], function which returns a builder for that operation.
259/// The fluent builder ultimately has a `send()` function that returns an async future that
260/// returns a result, as illustrated below:
261///
262/// ```rust,ignore
263/// let result = client.associate_approval_rule_template_with_repository()
264/// .approval_rule_template_name("example")
265/// .send()
266/// .await;
267/// ```
268///
269/// The underlying HTTP requests that get made by this can be modified with the `customize_operation`
270/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more
271/// information.
272pub mod client;
273
274/// Configuration for AWS CodeCommit.
275pub mod config;
276
277/// Common errors and error handling utilities.
278pub mod error;
279
280mod error_meta;
281
282/// Information about this crate.
283pub mod meta;
284
285/// All operations that this crate can perform.
286pub mod operation;
287
288/// Primitives such as `Blob` or `DateTime` used by other types.
289pub mod primitives;
290
291/// Data structures used by operation inputs/outputs.
292pub mod types;
293
294pub(crate) mod client_idempotency_token;
295
296mod idempotency_token;
297
298mod observability_feature;
299
300pub(crate) mod protocol_serde;
301
302mod sdk_feature_tracker;
303
304mod serialization_settings;
305
306mod endpoint_lib;
307
308mod lens;
309
310mod serde_util;
311
312mod json_errors;
313
314#[doc(inline)]
315pub use client::Client;