aws_sdk_codecommit/operation/create_repository/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_repository::_create_repository_output::CreateRepositoryOutputBuilder;
3
4pub use crate::operation::create_repository::_create_repository_input::CreateRepositoryInputBuilder;
5
6impl crate::operation::create_repository::builders::CreateRepositoryInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_repository::CreateRepositoryOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_repository::CreateRepositoryError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_repository();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateRepository`.
24///
25/// <p>Creates a new, empty repository.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateRepositoryFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_repository::builders::CreateRepositoryInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_repository::CreateRepositoryOutput,
35 crate::operation::create_repository::CreateRepositoryError,
36 > for CreateRepositoryFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_repository::CreateRepositoryOutput,
44 crate::operation::create_repository::CreateRepositoryError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateRepositoryFluentBuilder {
51 /// Creates a new `CreateRepositoryFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateRepository as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_repository::builders::CreateRepositoryInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_repository::CreateRepositoryOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_repository::CreateRepositoryError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_repository::CreateRepository::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_repository::CreateRepository::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_repository::CreateRepositoryOutput,
97 crate::operation::create_repository::CreateRepositoryError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of the new repository to be created.</p><note>
112 /// <p>The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the <i>CodeCommit User Guide</i>. The suffix .git is prohibited.</p>
113 /// </note>
114 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.repository_name(input.into());
116 self
117 }
118 /// <p>The name of the new repository to be created.</p><note>
119 /// <p>The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the <i>CodeCommit User Guide</i>. The suffix .git is prohibited.</p>
120 /// </note>
121 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_repository_name(input);
123 self
124 }
125 /// <p>The name of the new repository to be created.</p><note>
126 /// <p>The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the <i>CodeCommit User Guide</i>. The suffix .git is prohibited.</p>
127 /// </note>
128 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
129 self.inner.get_repository_name()
130 }
131 /// <p>A comment or description about the new repository.</p><note>
132 /// <p>The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.</p>
133 /// </note>
134 pub fn repository_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.repository_description(input.into());
136 self
137 }
138 /// <p>A comment or description about the new repository.</p><note>
139 /// <p>The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.</p>
140 /// </note>
141 pub fn set_repository_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_repository_description(input);
143 self
144 }
145 /// <p>A comment or description about the new repository.</p><note>
146 /// <p>The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.</p>
147 /// </note>
148 pub fn get_repository_description(&self) -> &::std::option::Option<::std::string::String> {
149 self.inner.get_repository_description()
150 }
151 ///
152 /// Adds a key-value pair to `tags`.
153 ///
154 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
155 ///
156 /// <p>One or more tag key-value pairs to use when tagging this repository.</p>
157 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.inner = self.inner.tags(k.into(), v.into());
159 self
160 }
161 /// <p>One or more tag key-value pairs to use when tagging this repository.</p>
162 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
163 self.inner = self.inner.set_tags(input);
164 self
165 }
166 /// <p>One or more tag key-value pairs to use when tagging this repository.</p>
167 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
168 self.inner.get_tags()
169 }
170 /// <p>The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in the <i>Key Management Service API Reference</i>.</p>
171 /// <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>
172 pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.inner = self.inner.kms_key_id(input.into());
174 self
175 }
176 /// <p>The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in the <i>Key Management Service API Reference</i>.</p>
177 /// <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>
178 pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.inner = self.inner.set_kms_key_id(input);
180 self
181 }
182 /// <p>The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId">KeyId</a> in the Decrypt API description in the <i>Key Management Service API Reference</i>.</p>
183 /// <p>If no key is specified, the default <code>aws/codecommit</code> Amazon Web Services managed key is used.</p>
184 pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
185 self.inner.get_kms_key_id()
186 }
187}