aws_sdk_elasticbeanstalk/operation/swap_environment_cnames/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::swap_environment_cnames::_swap_environment_cnames_output::SwapEnvironmentCnamEsOutputBuilder;
3
4pub use crate::operation::swap_environment_cnames::_swap_environment_cnames_input::SwapEnvironmentCnamEsInputBuilder;
5
6impl crate::operation::swap_environment_cnames::builders::SwapEnvironmentCnamEsInputBuilder {
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::swap_environment_cnames::SwapEnvironmentCnamEsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.swap_environment_cnames();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SwapEnvironmentCNAMEs`.
24///
25/// <p>Swaps the CNAMEs of two environments.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SwapEnvironmentCNAMEsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::swap_environment_cnames::builders::SwapEnvironmentCnamEsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::swap_environment_cnames::SwapEnvironmentCnamEsOutput,
35        crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEsError,
36    > for SwapEnvironmentCNAMEsFluentBuilder
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::swap_environment_cnames::SwapEnvironmentCnamEsOutput,
44            crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SwapEnvironmentCNAMEsFluentBuilder {
51    /// Creates a new `SwapEnvironmentCNAMEsFluentBuilder`.
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 SwapEnvironmentCNAMEs as a reference.
60    pub fn as_input(&self) -> &crate::operation::swap_environment_cnames::builders::SwapEnvironmentCnamEsInputBuilder {
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::swap_environment_cnames::SwapEnvironmentCnamEsOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEsError,
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::swap_environment_cnames::SwapEnvironmentCNAMEs::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEs::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::swap_environment_cnames::SwapEnvironmentCnamEsOutput,
97        crate::operation::swap_environment_cnames::SwapEnvironmentCNAMEsError,
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 ID of the source environment.</p>
112    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentId</code>, you must specify the <code>DestinationEnvironmentId</code>.</p>
113    pub fn source_environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.source_environment_id(input.into());
115        self
116    }
117    /// <p>The ID of the source environment.</p>
118    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentId</code>, you must specify the <code>DestinationEnvironmentId</code>.</p>
119    pub fn set_source_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_source_environment_id(input);
121        self
122    }
123    /// <p>The ID of the source environment.</p>
124    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentId</code>, you must specify the <code>DestinationEnvironmentId</code>.</p>
125    pub fn get_source_environment_id(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_source_environment_id()
127    }
128    /// <p>The name of the source environment.</p>
129    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentName</code>, you must specify the <code>DestinationEnvironmentName</code>.</p>
130    pub fn source_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.source_environment_name(input.into());
132        self
133    }
134    /// <p>The name of the source environment.</p>
135    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentName</code>, you must specify the <code>DestinationEnvironmentName</code>.</p>
136    pub fn set_source_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_source_environment_name(input);
138        self
139    }
140    /// <p>The name of the source environment.</p>
141    /// <p>Condition: You must specify at least the <code>SourceEnvironmentID</code> or the <code>SourceEnvironmentName</code>. You may also specify both. If you specify the <code>SourceEnvironmentName</code>, you must specify the <code>DestinationEnvironmentName</code>.</p>
142    pub fn get_source_environment_name(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_source_environment_name()
144    }
145    /// <p>The ID of the destination environment.</p>
146    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentId</code> with the <code>DestinationEnvironmentId</code>.</p>
147    pub fn destination_environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.destination_environment_id(input.into());
149        self
150    }
151    /// <p>The ID of the destination environment.</p>
152    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentId</code> with the <code>DestinationEnvironmentId</code>.</p>
153    pub fn set_destination_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_destination_environment_id(input);
155        self
156    }
157    /// <p>The ID of the destination environment.</p>
158    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentId</code> with the <code>DestinationEnvironmentId</code>.</p>
159    pub fn get_destination_environment_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_destination_environment_id()
161    }
162    /// <p>The name of the destination environment.</p>
163    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentName</code> with the <code>DestinationEnvironmentName</code>.</p>
164    pub fn destination_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.destination_environment_name(input.into());
166        self
167    }
168    /// <p>The name of the destination environment.</p>
169    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentName</code> with the <code>DestinationEnvironmentName</code>.</p>
170    pub fn set_destination_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_destination_environment_name(input);
172        self
173    }
174    /// <p>The name of the destination environment.</p>
175    /// <p>Condition: You must specify at least the <code>DestinationEnvironmentID</code> or the <code>DestinationEnvironmentName</code>. You may also specify both. You must specify the <code>SourceEnvironmentName</code> with the <code>DestinationEnvironmentName</code>.</p>
176    pub fn get_destination_environment_name(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_destination_environment_name()
178    }
179}