aws_sdk_appconfig/operation/create_configuration_profile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_configuration_profile::_create_configuration_profile_output::CreateConfigurationProfileOutputBuilder;
3
4pub use crate::operation::create_configuration_profile::_create_configuration_profile_input::CreateConfigurationProfileInputBuilder;
5
6impl crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder {
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_configuration_profile::CreateConfigurationProfileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_configuration_profile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateConfigurationProfile`.
24///
25/// <p>Creates a configuration profile, which is information that enables AppConfig to access the configuration source. Valid configuration sources include the following:</p>
26/// <ul>
27/// <li>
28/// <p>Configuration data in YAML, JSON, and other formats stored in the AppConfig hosted configuration store</p></li>
29/// <li>
30/// <p>Configuration data stored as objects in an Amazon Simple Storage Service (Amazon S3) bucket</p></li>
31/// <li>
32/// <p>Pipelines stored in CodePipeline</p></li>
33/// <li>
34/// <p>Secrets stored in Secrets Manager</p></li>
35/// <li>
36/// <p>Standard and secure string parameters stored in Amazon Web Services Systems Manager Parameter Store</p></li>
37/// <li>
38/// <p>Configuration data in SSM documents stored in the Systems Manager document store</p></li>
39/// </ul>
40/// <p>A configuration profile includes the following information:</p>
41/// <ul>
42/// <li>
43/// <p>The URI location of the configuration data.</p></li>
44/// <li>
45/// <p>The Identity and Access Management (IAM) role that provides access to the configuration data.</p></li>
46/// <li>
47/// <p>A validator for the configuration data. Available validators include either a JSON Schema or an Amazon Web Services Lambda function.</p></li>
48/// </ul>
49/// <p>For more information, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-creating-configuration-and-profile.html">Create a Configuration and a Configuration Profile</a> in the <i>AppConfig User Guide</i>.</p>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct CreateConfigurationProfileFluentBuilder {
52    handle: ::std::sync::Arc<crate::client::Handle>,
53    inner: crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder,
54    config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57    crate::client::customize::internal::CustomizableSend<
58        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
59        crate::operation::create_configuration_profile::CreateConfigurationProfileError,
60    > for CreateConfigurationProfileFluentBuilder
61{
62    fn send(
63        self,
64        config_override: crate::config::Builder,
65    ) -> crate::client::customize::internal::BoxFuture<
66        crate::client::customize::internal::SendResult<
67            crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
68            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
69        >,
70    > {
71        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72    }
73}
74impl CreateConfigurationProfileFluentBuilder {
75    /// Creates a new `CreateConfigurationProfileFluentBuilder`.
76    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
77        Self {
78            handle,
79            inner: ::std::default::Default::default(),
80            config_override: ::std::option::Option::None,
81        }
82    }
83    /// Access the CreateConfigurationProfile as a reference.
84    pub fn as_input(&self) -> &crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder {
85        &self.inner
86    }
87    /// Sends the request and returns the response.
88    ///
89    /// If an error occurs, an `SdkError` will be returned with additional details that
90    /// can be matched against.
91    ///
92    /// By default, any retryable failures will be retried twice. Retry behavior
93    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
94    /// set when configuring the client.
95    pub async fn send(
96        self,
97    ) -> ::std::result::Result<
98        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
99        ::aws_smithy_runtime_api::client::result::SdkError<
100            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
101            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
102        >,
103    > {
104        let input = self
105            .inner
106            .build()
107            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
108        let runtime_plugins = crate::operation::create_configuration_profile::CreateConfigurationProfile::operation_runtime_plugins(
109            self.handle.runtime_plugins.clone(),
110            &self.handle.conf,
111            self.config_override,
112        );
113        crate::operation::create_configuration_profile::CreateConfigurationProfile::orchestrate(&runtime_plugins, input).await
114    }
115
116    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
117    pub fn customize(
118        self,
119    ) -> crate::client::customize::CustomizableOperation<
120        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
121        crate::operation::create_configuration_profile::CreateConfigurationProfileError,
122        Self,
123    > {
124        crate::client::customize::CustomizableOperation::new(self)
125    }
126    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
127        self.set_config_override(::std::option::Option::Some(config_override.into()));
128        self
129    }
130
131    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
132        self.config_override = config_override;
133        self
134    }
135    /// <p>The application ID.</p>
136    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.application_id(input.into());
138        self
139    }
140    /// <p>The application ID.</p>
141    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_application_id(input);
143        self
144    }
145    /// <p>The application ID.</p>
146    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_application_id()
148    }
149    /// <p>A name for the configuration profile.</p>
150    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.name(input.into());
152        self
153    }
154    /// <p>A name for the configuration profile.</p>
155    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_name(input);
157        self
158    }
159    /// <p>A name for the configuration profile.</p>
160    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_name()
162    }
163    /// <p>A description of the configuration profile.</p>
164    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.description(input.into());
166        self
167    }
168    /// <p>A description of the configuration profile.</p>
169    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_description(input);
171        self
172    }
173    /// <p>A description of the configuration profile.</p>
174    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_description()
176    }
177    /// <p>A URI to locate the configuration. You can specify the following:</p>
178    /// <ul>
179    /// <li>
180    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
181    /// <li>
182    /// <p>For an Amazon Web Services Systems Manager Parameter Store parameter, specify either the parameter name in the format <code>ssm-parameter://<parameter name></parameter></code> or the ARN.</p></li>
183    /// <li>
184    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
185    /// .
186    /// </pipeline></p></li>
187    /// <li>
188    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
189    /// .
190    /// </secret></p></li>
191    /// <li>
192    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
193    /// /
194    /// <objectkey>
195    /// </objectkey>
196    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
197    /// <li>
198    /// <p>For an SSM document, specify either the document name in the format <code>ssm-document://<document name></document></code> or the Amazon Resource Name (ARN).</p></li>
199    /// </ul>
200    pub fn location_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.inner = self.inner.location_uri(input.into());
202        self
203    }
204    /// <p>A URI to locate the configuration. You can specify the following:</p>
205    /// <ul>
206    /// <li>
207    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
208    /// <li>
209    /// <p>For an Amazon Web Services Systems Manager Parameter Store parameter, specify either the parameter name in the format <code>ssm-parameter://<parameter name></parameter></code> or the ARN.</p></li>
210    /// <li>
211    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
212    /// .
213    /// </pipeline></p></li>
214    /// <li>
215    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
216    /// .
217    /// </secret></p></li>
218    /// <li>
219    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
220    /// /
221    /// <objectkey>
222    /// </objectkey>
223    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
224    /// <li>
225    /// <p>For an SSM document, specify either the document name in the format <code>ssm-document://<document name></document></code> or the Amazon Resource Name (ARN).</p></li>
226    /// </ul>
227    pub fn set_location_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.inner = self.inner.set_location_uri(input);
229        self
230    }
231    /// <p>A URI to locate the configuration. You can specify the following:</p>
232    /// <ul>
233    /// <li>
234    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
235    /// <li>
236    /// <p>For an Amazon Web Services Systems Manager Parameter Store parameter, specify either the parameter name in the format <code>ssm-parameter://<parameter name></parameter></code> or the ARN.</p></li>
237    /// <li>
238    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
239    /// .
240    /// </pipeline></p></li>
241    /// <li>
242    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
243    /// .
244    /// </secret></p></li>
245    /// <li>
246    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
247    /// /
248    /// <objectkey>
249    /// </objectkey>
250    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
251    /// <li>
252    /// <p>For an SSM document, specify either the document name in the format <code>ssm-document://<document name></document></code> or the Amazon Resource Name (ARN).</p></li>
253    /// </ul>
254    pub fn get_location_uri(&self) -> &::std::option::Option<::std::string::String> {
255        self.inner.get_location_uri()
256    }
257    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
258    /// <p>A retrieval role ARN is not required for configurations stored in CodePipeline or the AppConfig hosted configuration store. It is required for all other sources that store your configuration.</p>
259    /// </important>
260    pub fn retrieval_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261        self.inner = self.inner.retrieval_role_arn(input.into());
262        self
263    }
264    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
265    /// <p>A retrieval role ARN is not required for configurations stored in CodePipeline or the AppConfig hosted configuration store. It is required for all other sources that store your configuration.</p>
266    /// </important>
267    pub fn set_retrieval_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.inner = self.inner.set_retrieval_role_arn(input);
269        self
270    }
271    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
272    /// <p>A retrieval role ARN is not required for configurations stored in CodePipeline or the AppConfig hosted configuration store. It is required for all other sources that store your configuration.</p>
273    /// </important>
274    pub fn get_retrieval_role_arn(&self) -> &::std::option::Option<::std::string::String> {
275        self.inner.get_retrieval_role_arn()
276    }
277    ///
278    /// Appends an item to `Validators`.
279    ///
280    /// To override the contents of this collection use [`set_validators`](Self::set_validators).
281    ///
282    /// <p>A list of methods for validating the configuration.</p>
283    pub fn validators(mut self, input: crate::types::Validator) -> Self {
284        self.inner = self.inner.validators(input);
285        self
286    }
287    /// <p>A list of methods for validating the configuration.</p>
288    pub fn set_validators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Validator>>) -> Self {
289        self.inner = self.inner.set_validators(input);
290        self
291    }
292    /// <p>A list of methods for validating the configuration.</p>
293    pub fn get_validators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Validator>> {
294        self.inner.get_validators()
295    }
296    ///
297    /// Adds a key-value pair to `Tags`.
298    ///
299    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
300    ///
301    /// <p>Metadata to assign to the configuration profile. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
302    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
303        self.inner = self.inner.tags(k.into(), v.into());
304        self
305    }
306    /// <p>Metadata to assign to the configuration profile. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
307    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
308        self.inner = self.inner.set_tags(input);
309        self
310    }
311    /// <p>Metadata to assign to the configuration profile. Tags help organize and categorize your AppConfig resources. Each tag consists of a key and an optional value, both of which you define.</p>
312    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
313        self.inner.get_tags()
314    }
315    /// <p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p>
316    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
317    /// <p><code>AWS.Freeform</code></p>
318    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.inner = self.inner.r#type(input.into());
320        self
321    }
322    /// <p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p>
323    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
324    /// <p><code>AWS.Freeform</code></p>
325    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
326        self.inner = self.inner.set_type(input);
327        self
328    }
329    /// <p>The type of configurations contained in the profile. AppConfig supports <code>feature flags</code> and <code>freeform</code> configurations. We recommend you create feature flag configurations to enable or disable new features and freeform configurations to distribute configurations to an application. When calling this API, enter one of the following values for <code>Type</code>:</p>
330    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
331    /// <p><code>AWS.Freeform</code></p>
332    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
333        self.inner.get_type()
334    }
335    /// <p>The identifier for an Key Management Service key to encrypt new configuration data versions in the AppConfig hosted configuration store. This attribute is only used for <code>hosted</code> configuration types. The identifier can be an KMS key ID, alias, or the Amazon Resource Name (ARN) of the key ID or alias. To encrypt data managed in other configuration stores, see the documentation for how to specify an KMS key for that particular service.</p>
336    pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
337        self.inner = self.inner.kms_key_identifier(input.into());
338        self
339    }
340    /// <p>The identifier for an Key Management Service key to encrypt new configuration data versions in the AppConfig hosted configuration store. This attribute is only used for <code>hosted</code> configuration types. The identifier can be an KMS key ID, alias, or the Amazon Resource Name (ARN) of the key ID or alias. To encrypt data managed in other configuration stores, see the documentation for how to specify an KMS key for that particular service.</p>
341    pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
342        self.inner = self.inner.set_kms_key_identifier(input);
343        self
344    }
345    /// <p>The identifier for an Key Management Service key to encrypt new configuration data versions in the AppConfig hosted configuration store. This attribute is only used for <code>hosted</code> configuration types. The identifier can be an KMS key ID, alias, or the Amazon Resource Name (ARN) of the key ID or alias. To encrypt data managed in other configuration stores, see the documentation for how to specify an KMS key for that particular service.</p>
346    pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
347        self.inner.get_kms_key_identifier()
348    }
349}