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