Skip to main content

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