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