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