aws_sdk_resiliencehub/operation/add_draft_app_version_resource_mappings/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_draft_app_version_resource_mappings::_add_draft_app_version_resource_mappings_output::AddDraftAppVersionResourceMappingsOutputBuilder;
3
4pub use crate::operation::add_draft_app_version_resource_mappings::_add_draft_app_version_resource_mappings_input::AddDraftAppVersionResourceMappingsInputBuilder;
5
6impl crate::operation::add_draft_app_version_resource_mappings::builders::AddDraftAppVersionResourceMappingsInputBuilder {
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::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.add_draft_app_version_resource_mappings();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AddDraftAppVersionResourceMappings`.
24///
25/// <p>Adds the source of resource-maps to the draft version of an application. During assessment, Resilience Hub will use these resource-maps to resolve the latest physical ID for each resource in the application template. For more information about different types of resources supported by Resilience Hub and how to add them in your application, see <a href="https://docs.aws.amazon.com/resilience-hub/latest/userguide/how-app-manage.html">Step 2: How is your application managed?</a> in the Resilience Hub User Guide.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct AddDraftAppVersionResourceMappingsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::add_draft_app_version_resource_mappings::builders::AddDraftAppVersionResourceMappingsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsOutput,
35        crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsError,
36    > for AddDraftAppVersionResourceMappingsFluentBuilder
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::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsOutput,
44            crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl AddDraftAppVersionResourceMappingsFluentBuilder {
51    /// Creates a new `AddDraftAppVersionResourceMappingsFluentBuilder`.
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 AddDraftAppVersionResourceMappings as a reference.
60    pub fn as_input(&self) -> &crate::operation::add_draft_app_version_resource_mappings::builders::AddDraftAppVersionResourceMappingsInputBuilder {
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::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsError,
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 =
85            crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappings::operation_runtime_plugins(
86                self.handle.runtime_plugins.clone(),
87                &self.handle.conf,
88                self.config_override,
89            );
90        crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappings::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsOutput,
98        crate::operation::add_draft_app_version_resource_mappings::AddDraftAppVersionResourceMappingsError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
113    pub fn app_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.app_arn(input.into());
115        self
116    }
117    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
118    pub fn set_app_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_app_arn(input);
120        self
121    }
122    /// <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
123    pub fn get_app_arn(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_app_arn()
125    }
126    ///
127    /// Appends an item to `resourceMappings`.
128    ///
129    /// To override the contents of this collection use [`set_resource_mappings`](Self::set_resource_mappings).
130    ///
131    /// <p>Mappings used to map logical resources from the template to physical resources. You can use the mapping type <code>CFN_STACK</code> if the application template uses a logical stack name. Or you can map individual resources by using the mapping type <code>RESOURCE</code>. We recommend using the mapping type <code>CFN_STACK</code> if the application is backed by a CloudFormation stack.</p>
132    pub fn resource_mappings(mut self, input: crate::types::ResourceMapping) -> Self {
133        self.inner = self.inner.resource_mappings(input);
134        self
135    }
136    /// <p>Mappings used to map logical resources from the template to physical resources. You can use the mapping type <code>CFN_STACK</code> if the application template uses a logical stack name. Or you can map individual resources by using the mapping type <code>RESOURCE</code>. We recommend using the mapping type <code>CFN_STACK</code> if the application is backed by a CloudFormation stack.</p>
137    pub fn set_resource_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceMapping>>) -> Self {
138        self.inner = self.inner.set_resource_mappings(input);
139        self
140    }
141    /// <p>Mappings used to map logical resources from the template to physical resources. You can use the mapping type <code>CFN_STACK</code> if the application template uses a logical stack name. Or you can map individual resources by using the mapping type <code>RESOURCE</code>. We recommend using the mapping type <code>CFN_STACK</code> if the application is backed by a CloudFormation stack.</p>
142    pub fn get_resource_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceMapping>> {
143        self.inner.get_resource_mappings()
144    }
145}