aws_sdk_redshift/operation/resize_cluster/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::resize_cluster::_resize_cluster_output::ResizeClusterOutputBuilder;
3
4pub use crate::operation::resize_cluster::_resize_cluster_input::ResizeClusterInputBuilder;
5
6impl crate::operation::resize_cluster::builders::ResizeClusterInputBuilder {
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::resize_cluster::ResizeClusterOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::resize_cluster::ResizeClusterError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.resize_cluster();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ResizeCluster`.
24///
25/// <p>Changes the size of the cluster. You can change the cluster's type, or change the number or type of nodes. The default behavior is to use the elastic resize method. With an elastic resize, your cluster is available for read and write operations more quickly than with the classic resize method.</p>
26/// <p>Elastic resize operations have the following restrictions:</p>
27/// <ul>
28/// <li>
29/// <p>You can only resize clusters of the following types:</p>
30/// <ul>
31/// <li>
32/// <p>dc2.large</p></li>
33/// <li>
34/// <p>dc2.8xlarge</p></li>
35/// <li>
36/// <p>ra3.large</p></li>
37/// <li>
38/// <p>ra3.xlplus</p></li>
39/// <li>
40/// <p>ra3.4xlarge</p></li>
41/// <li>
42/// <p>ra3.16xlarge</p></li>
43/// </ul></li>
44/// <li>
45/// <p>The type of nodes that you add must match the node type for the cluster.</p></li>
46/// </ul>
47#[derive(::std::clone::Clone, ::std::fmt::Debug)]
48pub struct ResizeClusterFluentBuilder {
49    handle: ::std::sync::Arc<crate::client::Handle>,
50    inner: crate::operation::resize_cluster::builders::ResizeClusterInputBuilder,
51    config_override: ::std::option::Option<crate::config::Builder>,
52}
53impl
54    crate::client::customize::internal::CustomizableSend<
55        crate::operation::resize_cluster::ResizeClusterOutput,
56        crate::operation::resize_cluster::ResizeClusterError,
57    > for ResizeClusterFluentBuilder
58{
59    fn send(
60        self,
61        config_override: crate::config::Builder,
62    ) -> crate::client::customize::internal::BoxFuture<
63        crate::client::customize::internal::SendResult<
64            crate::operation::resize_cluster::ResizeClusterOutput,
65            crate::operation::resize_cluster::ResizeClusterError,
66        >,
67    > {
68        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
69    }
70}
71impl ResizeClusterFluentBuilder {
72    /// Creates a new `ResizeClusterFluentBuilder`.
73    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
74        Self {
75            handle,
76            inner: ::std::default::Default::default(),
77            config_override: ::std::option::Option::None,
78        }
79    }
80    /// Access the ResizeCluster as a reference.
81    pub fn as_input(&self) -> &crate::operation::resize_cluster::builders::ResizeClusterInputBuilder {
82        &self.inner
83    }
84    /// Sends the request and returns the response.
85    ///
86    /// If an error occurs, an `SdkError` will be returned with additional details that
87    /// can be matched against.
88    ///
89    /// By default, any retryable failures will be retried twice. Retry behavior
90    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
91    /// set when configuring the client.
92    pub async fn send(
93        self,
94    ) -> ::std::result::Result<
95        crate::operation::resize_cluster::ResizeClusterOutput,
96        ::aws_smithy_runtime_api::client::result::SdkError<
97            crate::operation::resize_cluster::ResizeClusterError,
98            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
99        >,
100    > {
101        let input = self
102            .inner
103            .build()
104            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
105        let runtime_plugins = crate::operation::resize_cluster::ResizeCluster::operation_runtime_plugins(
106            self.handle.runtime_plugins.clone(),
107            &self.handle.conf,
108            self.config_override,
109        );
110        crate::operation::resize_cluster::ResizeCluster::orchestrate(&runtime_plugins, input).await
111    }
112
113    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
114    pub fn customize(
115        self,
116    ) -> crate::client::customize::CustomizableOperation<
117        crate::operation::resize_cluster::ResizeClusterOutput,
118        crate::operation::resize_cluster::ResizeClusterError,
119        Self,
120    > {
121        crate::client::customize::CustomizableOperation::new(self)
122    }
123    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
124        self.set_config_override(::std::option::Option::Some(config_override.into()));
125        self
126    }
127
128    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
129        self.config_override = config_override;
130        self
131    }
132    /// <p>The unique identifier for the cluster to resize.</p>
133    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.cluster_identifier(input.into());
135        self
136    }
137    /// <p>The unique identifier for the cluster to resize.</p>
138    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_cluster_identifier(input);
140        self
141    }
142    /// <p>The unique identifier for the cluster to resize.</p>
143    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_cluster_identifier()
145    }
146    /// <p>The new cluster type for the specified cluster.</p>
147    pub fn cluster_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.cluster_type(input.into());
149        self
150    }
151    /// <p>The new cluster type for the specified cluster.</p>
152    pub fn set_cluster_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_cluster_type(input);
154        self
155    }
156    /// <p>The new cluster type for the specified cluster.</p>
157    pub fn get_cluster_type(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_cluster_type()
159    }
160    /// <p>The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.</p>
161    pub fn node_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.node_type(input.into());
163        self
164    }
165    /// <p>The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.</p>
166    pub fn set_node_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_node_type(input);
168        self
169    }
170    /// <p>The new node type for the nodes you are adding. If not specified, the cluster's current node type is used.</p>
171    pub fn get_node_type(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_node_type()
173    }
174    /// <p>The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.</p>
175    pub fn number_of_nodes(mut self, input: i32) -> Self {
176        self.inner = self.inner.number_of_nodes(input);
177        self
178    }
179    /// <p>The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.</p>
180    pub fn set_number_of_nodes(mut self, input: ::std::option::Option<i32>) -> Self {
181        self.inner = self.inner.set_number_of_nodes(input);
182        self
183    }
184    /// <p>The new number of nodes for the cluster. If not specified, the cluster's current number of nodes is used.</p>
185    pub fn get_number_of_nodes(&self) -> &::std::option::Option<i32> {
186        self.inner.get_number_of_nodes()
187    }
188    /// <p>A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to <code>false</code>, the resize type is elastic.</p>
189    pub fn classic(mut self, input: bool) -> Self {
190        self.inner = self.inner.classic(input);
191        self
192    }
193    /// <p>A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to <code>false</code>, the resize type is elastic.</p>
194    pub fn set_classic(mut self, input: ::std::option::Option<bool>) -> Self {
195        self.inner = self.inner.set_classic(input);
196        self
197    }
198    /// <p>A boolean value indicating whether the resize operation is using the classic resize process. If you don't provide this parameter or set the value to <code>false</code>, the resize type is elastic.</p>
199    pub fn get_classic(&self) -> &::std::option::Option<bool> {
200        self.inner.get_classic()
201    }
202    /// <p>The identifier of the reserved node.</p>
203    pub fn reserved_node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.reserved_node_id(input.into());
205        self
206    }
207    /// <p>The identifier of the reserved node.</p>
208    pub fn set_reserved_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_reserved_node_id(input);
210        self
211    }
212    /// <p>The identifier of the reserved node.</p>
213    pub fn get_reserved_node_id(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_reserved_node_id()
215    }
216    /// <p>The identifier of the target reserved node offering.</p>
217    pub fn target_reserved_node_offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.inner = self.inner.target_reserved_node_offering_id(input.into());
219        self
220    }
221    /// <p>The identifier of the target reserved node offering.</p>
222    pub fn set_target_reserved_node_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.inner = self.inner.set_target_reserved_node_offering_id(input);
224        self
225    }
226    /// <p>The identifier of the target reserved node offering.</p>
227    pub fn get_target_reserved_node_offering_id(&self) -> &::std::option::Option<::std::string::String> {
228        self.inner.get_target_reserved_node_offering_id()
229    }
230}