Skip to main content

aws_sdk_cloudformation/operation/set_type_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_type_configuration::_set_type_configuration_input::SetTypeConfigurationInputBuilder;
3
4pub use crate::operation::set_type_configuration::_set_type_configuration_output::SetTypeConfigurationOutputBuilder;
5
6impl crate::operation::set_type_configuration::builders::SetTypeConfigurationInputBuilder {
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::set_type_configuration::SetTypeConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::set_type_configuration::SetTypeConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.set_type_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SetTypeConfiguration`.
24///
25/// <p>Specifies the configuration data for a CloudFormation extension, such as a resource or Hook, in the given account and Region.</p>
26/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-set-configuration.html">Edit configuration data for extensions in your account</a> in the <i>CloudFormation User Guide</i>.</p>
27/// <p>To view the current configuration data for an extension, refer to the <code>ConfigurationSchema</code> element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>.</p><important>
28/// <p>It's strongly recommended that you use dynamic references to restrict sensitive configuration definitions, such as third-party credentials. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html">Specify values stored in other services using dynamic references</a> in the <i>CloudFormation User Guide</i>.</p>
29/// </important>
30/// <p>For more information about setting the configuration data for resource types, see <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-model.html#resource-type-howto-configuration">Defining the account-level configuration of an extension</a> in the <i>CloudFormation Command Line Interface (CLI) User Guide</i>. For more information about setting the configuration data for Hooks, see the <a href="https://docs.aws.amazon.com/cloudformation-cli/latest/hooks-userguide/what-is-cloudformation-hooks.html">CloudFormation Hooks User Guide</a>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct SetTypeConfigurationFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::set_type_configuration::builders::SetTypeConfigurationInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::set_type_configuration::SetTypeConfigurationOutput,
40        crate::operation::set_type_configuration::SetTypeConfigurationError,
41    > for SetTypeConfigurationFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::set_type_configuration::SetTypeConfigurationOutput,
49            crate::operation::set_type_configuration::SetTypeConfigurationError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl SetTypeConfigurationFluentBuilder {
56    /// Creates a new `SetTypeConfigurationFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the SetTypeConfiguration as a reference.
65    pub fn as_input(&self) -> &crate::operation::set_type_configuration::builders::SetTypeConfigurationInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::set_type_configuration::SetTypeConfigurationOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::set_type_configuration::SetTypeConfigurationError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::set_type_configuration::SetTypeConfiguration::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::set_type_configuration::SetTypeConfiguration::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::set_type_configuration::SetTypeConfigurationOutput,
102        crate::operation::set_type_configuration::SetTypeConfigurationError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The Amazon Resource Name (ARN) for the extension in this account and Region.</p>
117    /// <p>For public extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html">ActivateType</a> API operation in this account and Region. For private extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a> API operation in this account and Region.</p>
118    /// <p>Do not include the extension versions suffix at the end of the ARN. You can set the configuration for an extension, but not for a specific extension version.</p>
119    pub fn type_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.type_arn(input.into());
121        self
122    }
123    /// <p>The Amazon Resource Name (ARN) for the extension in this account and Region.</p>
124    /// <p>For public extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html">ActivateType</a> API operation in this account and Region. For private extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a> API operation in this account and Region.</p>
125    /// <p>Do not include the extension versions suffix at the end of the ARN. You can set the configuration for an extension, but not for a specific extension version.</p>
126    pub fn set_type_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_type_arn(input);
128        self
129    }
130    /// <p>The Amazon Resource Name (ARN) for the extension in this account and Region.</p>
131    /// <p>For public extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html">ActivateType</a> API operation in this account and Region. For private extensions, this will be the ARN assigned when you call the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html">RegisterType</a> API operation in this account and Region.</p>
132    /// <p>Do not include the extension versions suffix at the end of the ARN. You can set the configuration for an extension, but not for a specific extension version.</p>
133    pub fn get_type_arn(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_type_arn()
135    }
136    /// <p>The configuration data for the extension in this account and Region.</p>
137    /// <p>The configuration data must be formatted as JSON and validate against the extension's schema returned in the <code>Schema</code> response element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>.</p>
138    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.configuration(input.into());
140        self
141    }
142    /// <p>The configuration data for the extension in this account and Region.</p>
143    /// <p>The configuration data must be formatted as JSON and validate against the extension's schema returned in the <code>Schema</code> response element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>.</p>
144    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_configuration(input);
146        self
147    }
148    /// <p>The configuration data for the extension in this account and Region.</p>
149    /// <p>The configuration data must be formatted as JSON and validate against the extension's schema returned in the <code>Schema</code> response element of <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeType.html">DescribeType</a>.</p>
150    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_configuration()
152    }
153    /// <p>An alias by which to refer to this extension configuration data.</p>
154    /// <p>Conditional: Specifying a configuration alias is required when setting a configuration for a resource type extension.</p>
155    pub fn configuration_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.configuration_alias(input.into());
157        self
158    }
159    /// <p>An alias by which to refer to this extension configuration data.</p>
160    /// <p>Conditional: Specifying a configuration alias is required when setting a configuration for a resource type extension.</p>
161    pub fn set_configuration_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_configuration_alias(input);
163        self
164    }
165    /// <p>An alias by which to refer to this extension configuration data.</p>
166    /// <p>Conditional: Specifying a configuration alias is required when setting a configuration for a resource type extension.</p>
167    pub fn get_configuration_alias(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_configuration_alias()
169    }
170    /// <p>The name of the extension.</p>
171    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
172    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.type_name(input.into());
174        self
175    }
176    /// <p>The name of the extension.</p>
177    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
178    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_type_name(input);
180        self
181    }
182    /// <p>The name of the extension.</p>
183    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
184    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
185        self.inner.get_type_name()
186    }
187    /// <p>The type of extension.</p>
188    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
189    pub fn r#type(mut self, input: crate::types::ThirdPartyType) -> Self {
190        self.inner = self.inner.r#type(input);
191        self
192    }
193    /// <p>The type of extension.</p>
194    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
195    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ThirdPartyType>) -> Self {
196        self.inner = self.inner.set_type(input);
197        self
198    }
199    /// <p>The type of extension.</p>
200    /// <p>Conditional: You must specify <code>ConfigurationArn</code>, or <code>Type</code> and <code>TypeName</code>.</p>
201    pub fn get_type(&self) -> &::std::option::Option<crate::types::ThirdPartyType> {
202        self.inner.get_type()
203    }
204}