aws_sdk_elasticache/operation/modify_global_replication_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_global_replication_group::_modify_global_replication_group_output::ModifyGlobalReplicationGroupOutputBuilder;
3
4pub use crate::operation::modify_global_replication_group::_modify_global_replication_group_input::ModifyGlobalReplicationGroupInputBuilder;
5
6impl crate::operation::modify_global_replication_group::builders::ModifyGlobalReplicationGroupInputBuilder {
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::modify_global_replication_group::ModifyGlobalReplicationGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_global_replication_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyGlobalReplicationGroup`.
24///
25/// <p>Modifies the settings for a Global datastore.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ModifyGlobalReplicationGroupFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::modify_global_replication_group::builders::ModifyGlobalReplicationGroupInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupOutput,
35        crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupError,
36    > for ModifyGlobalReplicationGroupFluentBuilder
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::modify_global_replication_group::ModifyGlobalReplicationGroupOutput,
44            crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ModifyGlobalReplicationGroupFluentBuilder {
51    /// Creates a new `ModifyGlobalReplicationGroupFluentBuilder`.
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 ModifyGlobalReplicationGroup as a reference.
60    pub fn as_input(&self) -> &crate::operation::modify_global_replication_group::builders::ModifyGlobalReplicationGroupInputBuilder {
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::modify_global_replication_group::ModifyGlobalReplicationGroupOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupError,
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::modify_global_replication_group::ModifyGlobalReplicationGroup::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroup::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::modify_global_replication_group::ModifyGlobalReplicationGroupOutput,
97        crate::operation::modify_global_replication_group::ModifyGlobalReplicationGroupError,
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 name of the Global datastore</p>
112    pub fn global_replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.global_replication_group_id(input.into());
114        self
115    }
116    /// <p>The name of the Global datastore</p>
117    pub fn set_global_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_global_replication_group_id(input);
119        self
120    }
121    /// <p>The name of the Global datastore</p>
122    pub fn get_global_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_global_replication_group_id()
124    }
125    /// <p>This parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible. Modifications to Global Replication Groups cannot be requested to be applied in PreferredMaintenceWindow.</p>
126    pub fn apply_immediately(mut self, input: bool) -> Self {
127        self.inner = self.inner.apply_immediately(input);
128        self
129    }
130    /// <p>This parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible. Modifications to Global Replication Groups cannot be requested to be applied in PreferredMaintenceWindow.</p>
131    pub fn set_apply_immediately(mut self, input: ::std::option::Option<bool>) -> Self {
132        self.inner = self.inner.set_apply_immediately(input);
133        self
134    }
135    /// <p>This parameter causes the modifications in this request and any pending modifications to be applied, asynchronously and as soon as possible. Modifications to Global Replication Groups cannot be requested to be applied in PreferredMaintenceWindow.</p>
136    pub fn get_apply_immediately(&self) -> &::std::option::Option<bool> {
137        self.inner.get_apply_immediately()
138    }
139    /// <p>A valid cache node type that you want to scale this Global datastore to.</p>
140    pub fn cache_node_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.cache_node_type(input.into());
142        self
143    }
144    /// <p>A valid cache node type that you want to scale this Global datastore to.</p>
145    pub fn set_cache_node_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_cache_node_type(input);
147        self
148    }
149    /// <p>A valid cache node type that you want to scale this Global datastore to.</p>
150    pub fn get_cache_node_type(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_cache_node_type()
152    }
153    /// <p>Modifies the engine listed in a global replication group message. The options are redis, memcached or valkey.</p>
154    pub fn engine(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.engine(input.into());
156        self
157    }
158    /// <p>Modifies the engine listed in a global replication group message. The options are redis, memcached or valkey.</p>
159    pub fn set_engine(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_engine(input);
161        self
162    }
163    /// <p>Modifies the engine listed in a global replication group message. The options are redis, memcached or valkey.</p>
164    pub fn get_engine(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_engine()
166    }
167    /// <p>The upgraded version of the cache engine to be run on the clusters in the Global datastore.</p>
168    pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.engine_version(input.into());
170        self
171    }
172    /// <p>The upgraded version of the cache engine to be run on the clusters in the Global datastore.</p>
173    pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_engine_version(input);
175        self
176    }
177    /// <p>The upgraded version of the cache engine to be run on the clusters in the Global datastore.</p>
178    pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_engine_version()
180    }
181    /// <p>The name of the cache parameter group to use with the Global datastore. It must be compatible with the major engine version used by the Global datastore.</p>
182    pub fn cache_parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.cache_parameter_group_name(input.into());
184        self
185    }
186    /// <p>The name of the cache parameter group to use with the Global datastore. It must be compatible with the major engine version used by the Global datastore.</p>
187    pub fn set_cache_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_cache_parameter_group_name(input);
189        self
190    }
191    /// <p>The name of the cache parameter group to use with the Global datastore. It must be compatible with the major engine version used by the Global datastore.</p>
192    pub fn get_cache_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_cache_parameter_group_name()
194    }
195    /// <p>A description of the Global datastore</p>
196    pub fn global_replication_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.global_replication_group_description(input.into());
198        self
199    }
200    /// <p>A description of the Global datastore</p>
201    pub fn set_global_replication_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_global_replication_group_description(input);
203        self
204    }
205    /// <p>A description of the Global datastore</p>
206    pub fn get_global_replication_group_description(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_global_replication_group_description()
208    }
209    /// <p>Determines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.</p>
210    pub fn automatic_failover_enabled(mut self, input: bool) -> Self {
211        self.inner = self.inner.automatic_failover_enabled(input);
212        self
213    }
214    /// <p>Determines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.</p>
215    pub fn set_automatic_failover_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
216        self.inner = self.inner.set_automatic_failover_enabled(input);
217        self
218    }
219    /// <p>Determines whether a read replica is automatically promoted to read/write primary if the existing primary encounters a failure.</p>
220    pub fn get_automatic_failover_enabled(&self) -> &::std::option::Option<bool> {
221        self.inner.get_automatic_failover_enabled()
222    }
223}