aws_sdk_ecr/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 repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html">Amazon ECR repositories</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</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 Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.</p>
112 pub fn registry_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.registry_id(input.into());
114 self
115 }
116 /// <p>The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.</p>
117 pub fn set_registry_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_registry_id(input);
119 self
120 }
121 /// <p>The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.</p>
122 pub fn get_registry_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_registry_id()
124 }
125 /// <p>The name to use for the repository. The repository name may be specified on its own (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>
126 /// <p>The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.</p>
127 pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.repository_name(input.into());
129 self
130 }
131 /// <p>The name to use for the repository. The repository name may be specified on its own (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>
132 /// <p>The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.</p>
133 pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_repository_name(input);
135 self
136 }
137 /// <p>The name to use for the repository. The repository name may be specified on its own (such as <code>nginx-web-app</code>) or it can be prepended with a namespace to group the repository into a category (such as <code>project-a/nginx-web-app</code>).</p>
138 /// <p>The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.</p>
139 pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_repository_name()
141 }
142 ///
143 /// Appends an item to `tags`.
144 ///
145 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
146 ///
147 /// <p>The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
148 pub fn tags(mut self, input: crate::types::Tag) -> Self {
149 self.inner = self.inner.tags(input);
150 self
151 }
152 /// <p>The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
153 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
154 self.inner = self.inner.set_tags(input);
155 self
156 }
157 /// <p>The metadata that you apply to the repository to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
158 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
159 self.inner.get_tags()
160 }
161 /// <p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
162 pub fn image_tag_mutability(mut self, input: crate::types::ImageTagMutability) -> Self {
163 self.inner = self.inner.image_tag_mutability(input);
164 self
165 }
166 /// <p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
167 pub fn set_image_tag_mutability(mut self, input: ::std::option::Option<crate::types::ImageTagMutability>) -> Self {
168 self.inner = self.inner.set_image_tag_mutability(input);
169 self
170 }
171 /// <p>The tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
172 pub fn get_image_tag_mutability(&self) -> &::std::option::Option<crate::types::ImageTagMutability> {
173 self.inner.get_image_tag_mutability()
174 }
175 ///
176 /// Appends an item to `imageTagMutabilityExclusionFilters`.
177 ///
178 /// To override the contents of this collection use [`set_image_tag_mutability_exclusion_filters`](Self::set_image_tag_mutability_exclusion_filters).
179 ///
180 /// <p>Creates a repository with a list of filters that define which image tags can override the default image tag mutability setting.</p>
181 pub fn image_tag_mutability_exclusion_filters(mut self, input: crate::types::ImageTagMutabilityExclusionFilter) -> Self {
182 self.inner = self.inner.image_tag_mutability_exclusion_filters(input);
183 self
184 }
185 /// <p>Creates a repository with a list of filters that define which image tags can override the default image tag mutability setting.</p>
186 pub fn set_image_tag_mutability_exclusion_filters(
187 mut self,
188 input: ::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>>,
189 ) -> Self {
190 self.inner = self.inner.set_image_tag_mutability_exclusion_filters(input);
191 self
192 }
193 /// <p>Creates a repository with a list of filters that define which image tags can override the default image tag mutability setting.</p>
194 pub fn get_image_tag_mutability_exclusion_filters(
195 &self,
196 ) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>> {
197 self.inner.get_image_tag_mutability_exclusion_filters()
198 }
199 /// <p>The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
200 pub fn image_scanning_configuration(mut self, input: crate::types::ImageScanningConfiguration) -> Self {
201 self.inner = self.inner.image_scanning_configuration(input);
202 self
203 }
204 /// <p>The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
205 pub fn set_image_scanning_configuration(mut self, input: ::std::option::Option<crate::types::ImageScanningConfiguration>) -> Self {
206 self.inner = self.inner.set_image_scanning_configuration(input);
207 self
208 }
209 /// <p>The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.</p>
210 pub fn get_image_scanning_configuration(&self) -> &::std::option::Option<crate::types::ImageScanningConfiguration> {
211 self.inner.get_image_scanning_configuration()
212 }
213 /// <p>The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.</p>
214 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
215 self.inner = self.inner.encryption_configuration(input);
216 self
217 }
218 /// <p>The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.</p>
219 pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
220 self.inner = self.inner.set_encryption_configuration(input);
221 self
222 }
223 /// <p>The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.</p>
224 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
225 self.inner.get_encryption_configuration()
226 }
227}