aws_sdk_rds/operation/switchover_blue_green_deployment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::switchover_blue_green_deployment::_switchover_blue_green_deployment_output::SwitchoverBlueGreenDeploymentOutputBuilder;
3
4pub use crate::operation::switchover_blue_green_deployment::_switchover_blue_green_deployment_input::SwitchoverBlueGreenDeploymentInputBuilder;
5
6impl crate::operation::switchover_blue_green_deployment::builders::SwitchoverBlueGreenDeploymentInputBuilder {
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::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.switchover_blue_green_deployment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SwitchoverBlueGreenDeployment`.
24///
25/// <p>Switches over a blue/green deployment.</p>
26/// <p>Before you switch over, production traffic is routed to the databases in the blue environment. After you switch over, production traffic is routed to the databases in the green environment.</p>
27/// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments.html">Using Amazon RDS Blue/Green Deployments for database updates</a> in the <i>Amazon RDS User Guide</i> and <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/blue-green-deployments.html">Using Amazon RDS Blue/Green Deployments for database updates</a> in the <i>Amazon Aurora User Guide</i>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct SwitchoverBlueGreenDeploymentFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::switchover_blue_green_deployment::builders::SwitchoverBlueGreenDeploymentInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentOutput,
37        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentError,
38    > for SwitchoverBlueGreenDeploymentFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentOutput,
46            crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl SwitchoverBlueGreenDeploymentFluentBuilder {
53    /// Creates a new `SwitchoverBlueGreenDeploymentFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the SwitchoverBlueGreenDeployment as a reference.
62    pub fn as_input(&self) -> &crate::operation::switchover_blue_green_deployment::builders::SwitchoverBlueGreenDeploymentInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeployment::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeployment::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentOutput,
99        crate::operation::switchover_blue_green_deployment::SwitchoverBlueGreenDeploymentError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The resource ID of the blue/green deployment.</p>
114    /// <p>Constraints:</p>
115    /// <ul>
116    /// <li>
117    /// <p>Must match an existing blue/green deployment resource ID.</p></li>
118    /// </ul>
119    pub fn blue_green_deployment_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.blue_green_deployment_identifier(input.into());
121        self
122    }
123    /// <p>The resource ID of the blue/green deployment.</p>
124    /// <p>Constraints:</p>
125    /// <ul>
126    /// <li>
127    /// <p>Must match an existing blue/green deployment resource ID.</p></li>
128    /// </ul>
129    pub fn set_blue_green_deployment_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_blue_green_deployment_identifier(input);
131        self
132    }
133    /// <p>The resource ID of the blue/green deployment.</p>
134    /// <p>Constraints:</p>
135    /// <ul>
136    /// <li>
137    /// <p>Must match an existing blue/green deployment resource ID.</p></li>
138    /// </ul>
139    pub fn get_blue_green_deployment_identifier(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_blue_green_deployment_identifier()
141    }
142    /// <p>The amount of time, in seconds, for the switchover to complete.</p>
143    /// <p>Default: 300</p>
144    /// <p>If the switchover takes longer than the specified duration, then any changes are rolled back, and no changes are made to the environments.</p>
145    pub fn switchover_timeout(mut self, input: i32) -> Self {
146        self.inner = self.inner.switchover_timeout(input);
147        self
148    }
149    /// <p>The amount of time, in seconds, for the switchover to complete.</p>
150    /// <p>Default: 300</p>
151    /// <p>If the switchover takes longer than the specified duration, then any changes are rolled back, and no changes are made to the environments.</p>
152    pub fn set_switchover_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
153        self.inner = self.inner.set_switchover_timeout(input);
154        self
155    }
156    /// <p>The amount of time, in seconds, for the switchover to complete.</p>
157    /// <p>Default: 300</p>
158    /// <p>If the switchover takes longer than the specified duration, then any changes are rolled back, and no changes are made to the environments.</p>
159    pub fn get_switchover_timeout(&self) -> &::std::option::Option<i32> {
160        self.inner.get_switchover_timeout()
161    }
162}