aws_sdk_docdb/operation/switchover_global_cluster/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::switchover_global_cluster::_switchover_global_cluster_output::SwitchoverGlobalClusterOutputBuilder;
3
4pub use crate::operation::switchover_global_cluster::_switchover_global_cluster_input::SwitchoverGlobalClusterInputBuilder;
5
6impl crate::operation::switchover_global_cluster::builders::SwitchoverGlobalClusterInputBuilder {
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_global_cluster::SwitchoverGlobalClusterOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.switchover_global_cluster();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `SwitchoverGlobalCluster`.
24///
25/// <p>Switches over the specified secondary Amazon DocumentDB cluster to be the new primary Amazon DocumentDB cluster in the global database cluster.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SwitchoverGlobalClusterFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::switchover_global_cluster::builders::SwitchoverGlobalClusterInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterOutput,
35 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterError,
36 > for SwitchoverGlobalClusterFluentBuilder
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::switchover_global_cluster::SwitchoverGlobalClusterOutput,
44 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl SwitchoverGlobalClusterFluentBuilder {
51 /// Creates a new `SwitchoverGlobalClusterFluentBuilder`.
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 SwitchoverGlobalCluster as a reference.
60 pub fn as_input(&self) -> &crate::operation::switchover_global_cluster::builders::SwitchoverGlobalClusterInputBuilder {
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::switchover_global_cluster::SwitchoverGlobalClusterOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterError,
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::switchover_global_cluster::SwitchoverGlobalCluster::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::switchover_global_cluster::SwitchoverGlobalCluster::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::switchover_global_cluster::SwitchoverGlobalClusterOutput,
97 crate::operation::switchover_global_cluster::SwitchoverGlobalClusterError,
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 identifier of the Amazon DocumentDB global database cluster to switch over. The identifier is the unique key assigned by the user when the cluster is created. In other words, it's the name of the global cluster. This parameter isn’t case-sensitive.</p>
112 /// <p>Constraints:</p>
113 /// <ul>
114 /// <li>
115 /// <p>Must match the identifier of an existing global cluster (Amazon DocumentDB global database).</p></li>
116 /// <li>
117 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
118 /// </ul>
119 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
120 pub fn global_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.global_cluster_identifier(input.into());
122 self
123 }
124 /// <p>The identifier of the Amazon DocumentDB global database cluster to switch over. The identifier is the unique key assigned by the user when the cluster is created. In other words, it's the name of the global cluster. This parameter isn’t case-sensitive.</p>
125 /// <p>Constraints:</p>
126 /// <ul>
127 /// <li>
128 /// <p>Must match the identifier of an existing global cluster (Amazon DocumentDB global database).</p></li>
129 /// <li>
130 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
131 /// </ul>
132 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
133 pub fn set_global_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_global_cluster_identifier(input);
135 self
136 }
137 /// <p>The identifier of the Amazon DocumentDB global database cluster to switch over. The identifier is the unique key assigned by the user when the cluster is created. In other words, it's the name of the global cluster. This parameter isn’t case-sensitive.</p>
138 /// <p>Constraints:</p>
139 /// <ul>
140 /// <li>
141 /// <p>Must match the identifier of an existing global cluster (Amazon DocumentDB global database).</p></li>
142 /// <li>
143 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
144 /// </ul>
145 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
146 pub fn get_global_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_global_cluster_identifier()
148 }
149 /// <p>The identifier of the secondary Amazon DocumentDB cluster to promote to the new primary for the global database cluster. Use the Amazon Resource Name (ARN) for the identifier so that Amazon DocumentDB can locate the cluster in its Amazon Web Services region.</p>
150 /// <p>Constraints:</p>
151 /// <ul>
152 /// <li>
153 /// <p>Must match the identifier of an existing secondary cluster.</p></li>
154 /// <li>
155 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
156 /// </ul>
157 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
158 pub fn target_db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.target_db_cluster_identifier(input.into());
160 self
161 }
162 /// <p>The identifier of the secondary Amazon DocumentDB cluster to promote to the new primary for the global database cluster. Use the Amazon Resource Name (ARN) for the identifier so that Amazon DocumentDB can locate the cluster in its Amazon Web Services region.</p>
163 /// <p>Constraints:</p>
164 /// <ul>
165 /// <li>
166 /// <p>Must match the identifier of an existing secondary cluster.</p></li>
167 /// <li>
168 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
169 /// </ul>
170 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
171 pub fn set_target_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.inner = self.inner.set_target_db_cluster_identifier(input);
173 self
174 }
175 /// <p>The identifier of the secondary Amazon DocumentDB cluster to promote to the new primary for the global database cluster. Use the Amazon Resource Name (ARN) for the identifier so that Amazon DocumentDB can locate the cluster in its Amazon Web Services region.</p>
176 /// <p>Constraints:</p>
177 /// <ul>
178 /// <li>
179 /// <p>Must match the identifier of an existing secondary cluster.</p></li>
180 /// <li>
181 /// <p>Minimum length of 1. Maximum length of 255.</p></li>
182 /// </ul>
183 /// <p>Pattern: <code>\[A-Za-z\]\[0-9A-Za-z-:._\]*</code></p>
184 pub fn get_target_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
185 self.inner.get_target_db_cluster_identifier()
186 }
187}