aws-sdk-appconfig 1.103.0

AWS SDK for Amazon AppConfig
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_configuration_profile::_create_configuration_profile_input::CreateConfigurationProfileInputBuilder;

pub use crate::operation::create_configuration_profile::_create_configuration_profile_output::CreateConfigurationProfileOutputBuilder;

impl crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_configuration_profile();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateConfigurationProfile`.
///
/// <p>Creates a configuration profile, which is information that enables AppConfig to access the configuration source. Valid configuration sources include the following:</p>
/// <ul>
/// <li>
/// <p>Configuration data in YAML, JSON, and other formats stored in the AppConfig hosted configuration store</p></li>
/// <li>
/// <p>Configuration data stored as objects in an Amazon Simple Storage Service (Amazon S3) bucket</p></li>
/// <li>
/// <p>Pipelines stored in CodePipeline</p></li>
/// <li>
/// <p>Secrets stored in Secrets Manager</p></li>
/// <li>
/// <p>Standard and secure string parameters stored in Amazon Web Services Systems Manager Parameter Store</p></li>
/// <li>
/// <p>Configuration data in SSM documents stored in the Systems Manager document store</p></li>
/// </ul>
/// <p>A configuration profile includes the following information:</p>
/// <ul>
/// <li>
/// <p>The URI location of the configuration data.</p></li>
/// <li>
/// <p>The Identity and Access Management (IAM) role that provides access to the configuration data.</p></li>
/// <li>
/// <p>A validator for the configuration data. Available validators include either a JSON Schema or an Amazon Web Services Lambda function.</p></li>
/// </ul>
/// <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>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateConfigurationProfileFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
        crate::operation::create_configuration_profile::CreateConfigurationProfileError,
    > for CreateConfigurationProfileFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateConfigurationProfileFluentBuilder {
    /// Creates a new `CreateConfigurationProfileFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateConfigurationProfile as a reference.
    pub fn as_input(&self) -> &crate::operation::create_configuration_profile::builders::CreateConfigurationProfileInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_configuration_profile::CreateConfigurationProfileError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_configuration_profile::CreateConfigurationProfile::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_configuration_profile::CreateConfigurationProfile::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_configuration_profile::CreateConfigurationProfileOutput,
        crate::operation::create_configuration_profile::CreateConfigurationProfileError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The application ID.</p>
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.application_id(input.into());
        self
    }
    /// <p>The application ID.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_application_id(input);
        self
    }
    /// <p>The application ID.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_application_id()
    }
    /// <p>A name for the configuration profile.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>A name for the configuration profile.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>A name for the configuration profile.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>A description of the configuration profile.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description of the configuration profile.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description of the configuration profile.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>A URI to locate the configuration. You can specify the following:</p>
    /// <ul>
    /// <li>
    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
    /// <li>
    /// <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>
    /// <li>
    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
    /// .
    /// </pipeline></p></li>
    /// <li>
    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
    /// .
    /// </secret></p></li>
    /// <li>
    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
    /// /
    /// <objectkey>
    /// </objectkey>
    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn location_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.location_uri(input.into());
        self
    }
    /// <p>A URI to locate the configuration. You can specify the following:</p>
    /// <ul>
    /// <li>
    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
    /// <li>
    /// <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>
    /// <li>
    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
    /// .
    /// </pipeline></p></li>
    /// <li>
    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
    /// .
    /// </secret></p></li>
    /// <li>
    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
    /// /
    /// <objectkey>
    /// </objectkey>
    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn set_location_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_location_uri(input);
        self
    }
    /// <p>A URI to locate the configuration. You can specify the following:</p>
    /// <ul>
    /// <li>
    /// <p>For the AppConfig hosted configuration store and for feature flags, specify <code>hosted</code>.</p></li>
    /// <li>
    /// <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>
    /// <li>
    /// <p>For an Amazon Web Services CodePipeline pipeline, specify the URI in the following format: <code>codepipeline</code>://<pipeline name>
    /// .
    /// </pipeline></p></li>
    /// <li>
    /// <p>For an Secrets Manager secret, specify the URI in the following format: <code>secretsmanager</code>://<secret name>
    /// .
    /// </secret></p></li>
    /// <li>
    /// <p>For an Amazon S3 object, specify the URI in the following format: <code>s3://<bucket>
    /// /
    /// <objectkey>
    /// </objectkey>
    /// </bucket></code>. Here is an example: <code>s3://amzn-s3-demo-bucket/my-app/us-east-1/my-config.json</code></p></li>
    /// <li>
    /// <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>
    /// </ul>
    pub fn get_location_uri(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_location_uri()
    }
    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
    /// <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>
    /// </important>
    pub fn retrieval_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.retrieval_role_arn(input.into());
        self
    }
    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
    /// <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>
    /// </important>
    pub fn set_retrieval_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_retrieval_role_arn(input);
        self
    }
    /// <p>The ARN of an IAM role with permission to access the configuration at the specified <code>LocationUri</code>.</p><important>
    /// <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>
    /// </important>
    pub fn get_retrieval_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_retrieval_role_arn()
    }
    ///
    /// Appends an item to `Validators`.
    ///
    /// To override the contents of this collection use [`set_validators`](Self::set_validators).
    ///
    /// <p>A list of methods for validating the configuration.</p>
    pub fn validators(mut self, input: crate::types::Validator) -> Self {
        self.inner = self.inner.validators(input);
        self
    }
    /// <p>A list of methods for validating the configuration.</p>
    pub fn set_validators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Validator>>) -> Self {
        self.inner = self.inner.set_validators(input);
        self
    }
    /// <p>A list of methods for validating the configuration.</p>
    pub fn get_validators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Validator>> {
        self.inner.get_validators()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <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>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <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>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <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>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    /// <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>
    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
    /// <p><code>AWS.Freeform</code></p>
    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.r#type(input.into());
        self
    }
    /// <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>
    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
    /// <p><code>AWS.Freeform</code></p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_type(input);
        self
    }
    /// <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>
    /// <p><code>AWS.AppConfig.FeatureFlags</code></p>
    /// <p><code>AWS.Freeform</code></p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_type()
    }
    /// <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>
    pub fn kms_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.kms_key_identifier(input.into());
        self
    }
    /// <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>
    pub fn set_kms_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_kms_key_identifier(input);
        self
    }
    /// <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>
    pub fn get_kms_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_kms_key_identifier()
    }
}