aws_sdk_ecr/operation/create_repository_creation_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_repository_creation_template::_create_repository_creation_template_output::CreateRepositoryCreationTemplateOutputBuilder;
3
4pub use crate::operation::create_repository_creation_template::_create_repository_creation_template_input::CreateRepositoryCreationTemplateInputBuilder;
5
6impl crate::operation::create_repository_creation_template::builders::CreateRepositoryCreationTemplateInputBuilder {
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_creation_template::CreateRepositoryCreationTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_repository_creation_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateRepositoryCreationTemplate`.
24///
25/// <p>Creates a repository creation template. This template is used to define the settings for repositories created by Amazon ECR on your behalf. For example, repositories created through pull through cache actions. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-creation-templates.html">Private repository creation templates</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateRepositoryCreationTemplateFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_repository_creation_template::builders::CreateRepositoryCreationTemplateInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateOutput,
35        crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateError,
36    > for CreateRepositoryCreationTemplateFluentBuilder
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_creation_template::CreateRepositoryCreationTemplateOutput,
44            crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateRepositoryCreationTemplateFluentBuilder {
51    /// Creates a new `CreateRepositoryCreationTemplateFluentBuilder`.
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 CreateRepositoryCreationTemplate as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_repository_creation_template::builders::CreateRepositoryCreationTemplateInputBuilder {
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_creation_template::CreateRepositoryCreationTemplateOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateError,
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_creation_template::CreateRepositoryCreationTemplate::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplate::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_creation_template::CreateRepositoryCreationTemplateOutput,
97        crate::operation::create_repository_creation_template::CreateRepositoryCreationTemplateError,
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 to associate with the template. 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>. Similarly, a prefix of <code>prod/team</code> would apply to all repositories beginning with <code>prod/team/</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><important>
113    /// <p>There is always an assumed <code>/</code> applied to the end of the prefix. If you specify <code>ecr-public</code> as the prefix, Amazon ECR treats that as <code>ecr-public/</code>. When using a pull through cache rule, the repository prefix you specify during rule creation is what you should specify as your repository creation template prefix as well.</p>
114    /// </important>
115    pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.prefix(input.into());
117        self
118    }
119    /// <p>The repository namespace prefix to associate with the template. 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>. Similarly, a prefix of <code>prod/team</code> would apply to all repositories beginning with <code>prod/team/</code>.</p>
120    /// <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><important>
121    /// <p>There is always an assumed <code>/</code> applied to the end of the prefix. If you specify <code>ecr-public</code> as the prefix, Amazon ECR treats that as <code>ecr-public/</code>. When using a pull through cache rule, the repository prefix you specify during rule creation is what you should specify as your repository creation template prefix as well.</p>
122    /// </important>
123    pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_prefix(input);
125        self
126    }
127    /// <p>The repository namespace prefix to associate with the template. 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>. Similarly, a prefix of <code>prod/team</code> would apply to all repositories beginning with <code>prod/team/</code>.</p>
128    /// <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><important>
129    /// <p>There is always an assumed <code>/</code> applied to the end of the prefix. If you specify <code>ecr-public</code> as the prefix, Amazon ECR treats that as <code>ecr-public/</code>. When using a pull through cache rule, the repository prefix you specify during rule creation is what you should specify as your repository creation template prefix as well.</p>
130    /// </important>
131    pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_prefix()
133    }
134    /// <p>A description for the repository creation template.</p>
135    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.description(input.into());
137        self
138    }
139    /// <p>A description for the repository creation template.</p>
140    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_description(input);
142        self
143    }
144    /// <p>A description for the repository creation template.</p>
145    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_description()
147    }
148    /// <p>The encryption configuration to use for repositories created using the template.</p>
149    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfigurationForRepositoryCreationTemplate) -> Self {
150        self.inner = self.inner.encryption_configuration(input);
151        self
152    }
153    /// <p>The encryption configuration to use for repositories created using the template.</p>
154    pub fn set_encryption_configuration(
155        mut self,
156        input: ::std::option::Option<crate::types::EncryptionConfigurationForRepositoryCreationTemplate>,
157    ) -> Self {
158        self.inner = self.inner.set_encryption_configuration(input);
159        self
160    }
161    /// <p>The encryption configuration to use for repositories created using the template.</p>
162    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfigurationForRepositoryCreationTemplate> {
163        self.inner.get_encryption_configuration()
164    }
165    ///
166    /// Appends an item to `resourceTags`.
167    ///
168    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
169    ///
170    /// <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>
171    pub fn resource_tags(mut self, input: crate::types::Tag) -> Self {
172        self.inner = self.inner.resource_tags(input);
173        self
174    }
175    /// <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>
176    pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
177        self.inner = self.inner.set_resource_tags(input);
178        self
179    }
180    /// <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>
181    pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
182        self.inner.get_resource_tags()
183    }
184    /// <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>
185    pub fn image_tag_mutability(mut self, input: crate::types::ImageTagMutability) -> Self {
186        self.inner = self.inner.image_tag_mutability(input);
187        self
188    }
189    /// <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>
190    pub fn set_image_tag_mutability(mut self, input: ::std::option::Option<crate::types::ImageTagMutability>) -> Self {
191        self.inner = self.inner.set_image_tag_mutability(input);
192        self
193    }
194    /// <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>
195    pub fn get_image_tag_mutability(&self) -> &::std::option::Option<crate::types::ImageTagMutability> {
196        self.inner.get_image_tag_mutability()
197    }
198    ///
199    /// Appends an item to `imageTagMutabilityExclusionFilters`.
200    ///
201    /// To override the contents of this collection use [`set_image_tag_mutability_exclusion_filters`](Self::set_image_tag_mutability_exclusion_filters).
202    ///
203    /// <p>Creates a repository creation template with a list of filters that define which image tags can override the default image tag mutability setting.</p>
204    pub fn image_tag_mutability_exclusion_filters(mut self, input: crate::types::ImageTagMutabilityExclusionFilter) -> Self {
205        self.inner = self.inner.image_tag_mutability_exclusion_filters(input);
206        self
207    }
208    /// <p>Creates a repository creation template with a list of filters that define which image tags can override the default image tag mutability setting.</p>
209    pub fn set_image_tag_mutability_exclusion_filters(
210        mut self,
211        input: ::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>>,
212    ) -> Self {
213        self.inner = self.inner.set_image_tag_mutability_exclusion_filters(input);
214        self
215    }
216    /// <p>Creates a repository creation template with a list of filters that define which image tags can override the default image tag mutability setting.</p>
217    pub fn get_image_tag_mutability_exclusion_filters(
218        &self,
219    ) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageTagMutabilityExclusionFilter>> {
220        self.inner.get_image_tag_mutability_exclusion_filters()
221    }
222    /// <p>The repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
223    pub fn repository_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.inner = self.inner.repository_policy(input.into());
225        self
226    }
227    /// <p>The repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
228    pub fn set_repository_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_repository_policy(input);
230        self
231    }
232    /// <p>The repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.</p>
233    pub fn get_repository_policy(&self) -> &::std::option::Option<::std::string::String> {
234        self.inner.get_repository_policy()
235    }
236    /// <p>The lifecycle policy to use for repositories created using the template.</p>
237    pub fn lifecycle_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.lifecycle_policy(input.into());
239        self
240    }
241    /// <p>The lifecycle policy to use for repositories created using the template.</p>
242    pub fn set_lifecycle_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.inner = self.inner.set_lifecycle_policy(input);
244        self
245    }
246    /// <p>The lifecycle policy to use for repositories created using the template.</p>
247    pub fn get_lifecycle_policy(&self) -> &::std::option::Option<::std::string::String> {
248        self.inner.get_lifecycle_policy()
249    }
250    ///
251    /// Appends an item to `appliedFor`.
252    ///
253    /// To override the contents of this collection use [`set_applied_for`](Self::set_applied_for).
254    ///
255    /// <p>A 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>
256    pub fn applied_for(mut self, input: crate::types::RctAppliedFor) -> Self {
257        self.inner = self.inner.applied_for(input);
258        self
259    }
260    /// <p>A 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>
261    pub fn set_applied_for(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RctAppliedFor>>) -> Self {
262        self.inner = self.inner.set_applied_for(input);
263        self
264    }
265    /// <p>A 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>
266    pub fn get_applied_for(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RctAppliedFor>> {
267        self.inner.get_applied_for()
268    }
269    /// <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>
270    pub fn custom_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.custom_role_arn(input.into());
272        self
273    }
274    /// <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>
275    pub fn set_custom_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.inner = self.inner.set_custom_role_arn(input);
277        self
278    }
279    /// <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>
280    pub fn get_custom_role_arn(&self) -> &::std::option::Option<::std::string::String> {
281        self.inner.get_custom_role_arn()
282    }
283}