aws_sdk_ecr/operation/update_repository_creation_template/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_repository_creation_template::_update_repository_creation_template_output::UpdateRepositoryCreationTemplateOutputBuilder;
3
4pub use crate::operation::update_repository_creation_template::_update_repository_creation_template_input::UpdateRepositoryCreationTemplateInputBuilder;
5
6impl crate::operation::update_repository_creation_template::builders::UpdateRepositoryCreationTemplateInputBuilder {
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::update_repository_creation_template::UpdateRepositoryCreationTemplateOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_repository_creation_template();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateRepositoryCreationTemplate`.
24///
25/// <p>Updates an existing repository creation template.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateRepositoryCreationTemplateFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_repository_creation_template::builders::UpdateRepositoryCreationTemplateInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateOutput,
35 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateError,
36 > for UpdateRepositoryCreationTemplateFluentBuilder
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::update_repository_creation_template::UpdateRepositoryCreationTemplateOutput,
44 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateRepositoryCreationTemplateFluentBuilder {
51 /// Creates a new `UpdateRepositoryCreationTemplateFluentBuilder`.
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 UpdateRepositoryCreationTemplate as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_repository_creation_template::builders::UpdateRepositoryCreationTemplateInputBuilder {
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::update_repository_creation_template::UpdateRepositoryCreationTemplateOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateError,
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::update_repository_creation_template::UpdateRepositoryCreationTemplate::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplate::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::update_repository_creation_template::UpdateRepositoryCreationTemplateOutput,
97 crate::operation::update_repository_creation_template::UpdateRepositoryCreationTemplateError,
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 repository namespace prefix that matches an existing repository creation template in the registry. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of <code>prod</code> would apply to all repositories beginning with <code>prod/</code>. This includes a repository named <code>prod/team1</code> as well as a repository named <code>prod/repository1</code>.</p>
112 /// <p>To apply a template to all repositories in your registry that don't have an associated creation template, you can use <code>ROOT</code> as the prefix.</p>
113 pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.prefix(input.into());
115 self
116 }
117 /// <p>The repository namespace prefix that matches an existing repository creation template in the registry. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of <code>prod</code> would apply to all repositories beginning with <code>prod/</code>. This includes a repository named <code>prod/team1</code> as well as a repository named <code>prod/repository1</code>.</p>
118 /// <p>To apply a template to all repositories in your registry that don't have an associated creation template, you can use <code>ROOT</code> as the prefix.</p>
119 pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_prefix(input);
121 self
122 }
123 /// <p>The repository namespace prefix that matches an existing repository creation template in the registry. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of <code>prod</code> would apply to all repositories beginning with <code>prod/</code>. This includes a repository named <code>prod/team1</code> as well as a repository named <code>prod/repository1</code>.</p>
124 /// <p>To apply a template to all repositories in your registry that don't have an associated creation template, you can use <code>ROOT</code> as the prefix.</p>
125 pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_prefix()
127 }
128 /// <p>A description for the repository creation template.</p>
129 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.description(input.into());
131 self
132 }
133 /// <p>A description for the repository creation template.</p>
134 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_description(input);
136 self
137 }
138 /// <p>A description for the repository creation template.</p>
139 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_description()
141 }
142 /// <p>The encryption configuration to associate with the repository creation template.</p>
143 pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfigurationForRepositoryCreationTemplate) -> Self {
144 self.inner = self.inner.encryption_configuration(input);
145 self
146 }
147 /// <p>The encryption configuration to associate with the repository creation template.</p>
148 pub fn set_encryption_configuration(
149 mut self,
150 input: ::std::option::Option<crate::types::EncryptionConfigurationForRepositoryCreationTemplate>,
151 ) -> Self {
152 self.inner = self.inner.set_encryption_configuration(input);
153 self
154 }
155 /// <p>The encryption configuration to associate with the repository creation template.</p>
156 pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfigurationForRepositoryCreationTemplate> {
157 self.inner.get_encryption_configuration()
158 }
159 ///
160 /// Appends an item to `resourceTags`.
161 ///
162 /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
163 ///
164 /// <p>The metadata to apply to the repository to help you categorize and organize. 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>
165 pub fn resource_tags(mut self, input: crate::types::Tag) -> Self {
166 self.inner = self.inner.resource_tags(input);
167 self
168 }
169 /// <p>The metadata to apply to the repository to help you categorize and organize. 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>
170 pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
171 self.inner = self.inner.set_resource_tags(input);
172 self
173 }
174 /// <p>The metadata to apply to the repository to help you categorize and organize. 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>
175 pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
176 self.inner.get_resource_tags()
177 }
178 /// <p>Updates 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>
179 pub fn image_tag_mutability(mut self, input: crate::types::ImageTagMutability) -> Self {
180 self.inner = self.inner.image_tag_mutability(input);
181 self
182 }
183 /// <p>Updates 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>
184 pub fn set_image_tag_mutability(mut self, input: ::std::option::Option<crate::types::ImageTagMutability>) -> Self {
185 self.inner = self.inner.set_image_tag_mutability(input);
186 self
187 }
188 /// <p>Updates 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>
189 pub fn get_image_tag_mutability(&self) -> &::std::option::Option<crate::types::ImageTagMutability> {
190 self.inner.get_image_tag_mutability()
191 }
192 ///
193 /// Appends an item to `imageTagMutabilityExclusionFilters`.
194 ///
195 /// To override the contents of this collection use [`set_image_tag_mutability_exclusion_filters`](Self::set_image_tag_mutability_exclusion_filters).
196 ///
197 /// <p>Updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>
198 pub fn image_tag_mutability_exclusion_filters(mut self, input: crate::types::ImageTagMutabilityExclusionFilter) -> Self {
199 self.inner = self.inner.image_tag_mutability_exclusion_filters(input);
200 self
201 }
202 /// <p>Updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>
203 pub fn set_image_tag_mutability_exclusion_filters(
204 mut self,
205 input: ::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>>,
206 ) -> Self {
207 self.inner = self.inner.set_image_tag_mutability_exclusion_filters(input);
208 self
209 }
210 /// <p>Updates a repository with filters that define which image tags can override the default image tag mutability setting.</p>
211 pub fn get_image_tag_mutability_exclusion_filters(
212 &self,
213 ) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>> {
214 self.inner.get_image_tag_mutability_exclusion_filters()
215 }
216 /// <p>Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
217 pub fn repository_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.inner = self.inner.repository_policy(input.into());
219 self
220 }
221 /// <p>Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
222 pub fn set_repository_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223 self.inner = self.inner.set_repository_policy(input);
224 self
225 }
226 /// <p>Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
227 pub fn get_repository_policy(&self) -> &::std::option::Option<::std::string::String> {
228 self.inner.get_repository_policy()
229 }
230 /// <p>Updates the lifecycle policy associated with the specified repository creation template.</p>
231 pub fn lifecycle_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.inner = self.inner.lifecycle_policy(input.into());
233 self
234 }
235 /// <p>Updates the lifecycle policy associated with the specified repository creation template.</p>
236 pub fn set_lifecycle_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.inner = self.inner.set_lifecycle_policy(input);
238 self
239 }
240 /// <p>Updates the lifecycle policy associated with the specified repository creation template.</p>
241 pub fn get_lifecycle_policy(&self) -> &::std::option::Option<::std::string::String> {
242 self.inner.get_lifecycle_policy()
243 }
244 ///
245 /// Appends an item to `appliedFor`.
246 ///
247 /// To override the contents of this collection use [`set_applied_for`](Self::set_applied_for).
248 ///
249 /// <p>Updates the list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The two supported scenarios are <code>PULL_THROUGH_CACHE</code> and <code>REPLICATION</code></p>
250 pub fn applied_for(mut self, input: crate::types::RctAppliedFor) -> Self {
251 self.inner = self.inner.applied_for(input);
252 self
253 }
254 /// <p>Updates the list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The two supported scenarios are <code>PULL_THROUGH_CACHE</code> and <code>REPLICATION</code></p>
255 pub fn set_applied_for(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RctAppliedFor>>) -> Self {
256 self.inner = self.inner.set_applied_for(input);
257 self
258 }
259 /// <p>Updates the list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The two supported scenarios are <code>PULL_THROUGH_CACHE</code> and <code>REPLICATION</code></p>
260 pub fn get_applied_for(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RctAppliedFor>> {
261 self.inner.get_applied_for()
262 }
263 /// <p>The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.</p>
264 pub fn custom_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265 self.inner = self.inner.custom_role_arn(input.into());
266 self
267 }
268 /// <p>The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.</p>
269 pub fn set_custom_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270 self.inner = self.inner.set_custom_role_arn(input);
271 self
272 }
273 /// <p>The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.</p>
274 pub fn get_custom_role_arn(&self) -> &::std::option::Option<::std::string::String> {
275 self.inner.get_custom_role_arn()
276 }
277}