aws_sdk_rds/operation/modify_current_db_cluster_capacity/
_modify_current_db_cluster_capacity_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyCurrentDbClusterCapacityInput {
6    /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
7    /// <p>Constraints:</p>
8    /// <ul>
9    /// <li>
10    /// <p>Must match the identifier of an existing DB cluster.</p></li>
11    /// </ul>
12    pub db_cluster_identifier: ::std::option::Option<::std::string::String>,
13    /// <p>The DB cluster capacity.</p>
14    /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
15    /// <p>Constraints:</p>
16    /// <ul>
17    /// <li>
18    /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
19    /// <li>
20    /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
21    /// </ul>
22    pub capacity: ::std::option::Option<i32>,
23    /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
24    /// <p>Specify a value between 10 and 600 seconds.</p>
25    pub seconds_before_timeout: ::std::option::Option<i32>,
26    /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
27    /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
28    /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
29    pub timeout_action: ::std::option::Option<::std::string::String>,
30}
31impl ModifyCurrentDbClusterCapacityInput {
32    /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
33    /// <p>Constraints:</p>
34    /// <ul>
35    /// <li>
36    /// <p>Must match the identifier of an existing DB cluster.</p></li>
37    /// </ul>
38    pub fn db_cluster_identifier(&self) -> ::std::option::Option<&str> {
39        self.db_cluster_identifier.as_deref()
40    }
41    /// <p>The DB cluster capacity.</p>
42    /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
43    /// <p>Constraints:</p>
44    /// <ul>
45    /// <li>
46    /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
47    /// <li>
48    /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
49    /// </ul>
50    pub fn capacity(&self) -> ::std::option::Option<i32> {
51        self.capacity
52    }
53    /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
54    /// <p>Specify a value between 10 and 600 seconds.</p>
55    pub fn seconds_before_timeout(&self) -> ::std::option::Option<i32> {
56        self.seconds_before_timeout
57    }
58    /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
59    /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
60    /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
61    pub fn timeout_action(&self) -> ::std::option::Option<&str> {
62        self.timeout_action.as_deref()
63    }
64}
65impl ModifyCurrentDbClusterCapacityInput {
66    /// Creates a new builder-style object to manufacture [`ModifyCurrentDbClusterCapacityInput`](crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityInput).
67    pub fn builder() -> crate::operation::modify_current_db_cluster_capacity::builders::ModifyCurrentDbClusterCapacityInputBuilder {
68        crate::operation::modify_current_db_cluster_capacity::builders::ModifyCurrentDbClusterCapacityInputBuilder::default()
69    }
70}
71
72/// A builder for [`ModifyCurrentDbClusterCapacityInput`](crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct ModifyCurrentDbClusterCapacityInputBuilder {
76    pub(crate) db_cluster_identifier: ::std::option::Option<::std::string::String>,
77    pub(crate) capacity: ::std::option::Option<i32>,
78    pub(crate) seconds_before_timeout: ::std::option::Option<i32>,
79    pub(crate) timeout_action: ::std::option::Option<::std::string::String>,
80}
81impl ModifyCurrentDbClusterCapacityInputBuilder {
82    /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
83    /// <p>Constraints:</p>
84    /// <ul>
85    /// <li>
86    /// <p>Must match the identifier of an existing DB cluster.</p></li>
87    /// </ul>
88    /// This field is required.
89    pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.db_cluster_identifier = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
94    /// <p>Constraints:</p>
95    /// <ul>
96    /// <li>
97    /// <p>Must match the identifier of an existing DB cluster.</p></li>
98    /// </ul>
99    pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.db_cluster_identifier = input;
101        self
102    }
103    /// <p>The DB cluster identifier for the cluster being modified. This parameter isn't case-sensitive.</p>
104    /// <p>Constraints:</p>
105    /// <ul>
106    /// <li>
107    /// <p>Must match the identifier of an existing DB cluster.</p></li>
108    /// </ul>
109    pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
110        &self.db_cluster_identifier
111    }
112    /// <p>The DB cluster capacity.</p>
113    /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
114    /// <p>Constraints:</p>
115    /// <ul>
116    /// <li>
117    /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
118    /// <li>
119    /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
120    /// </ul>
121    pub fn capacity(mut self, input: i32) -> Self {
122        self.capacity = ::std::option::Option::Some(input);
123        self
124    }
125    /// <p>The DB cluster capacity.</p>
126    /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
127    /// <p>Constraints:</p>
128    /// <ul>
129    /// <li>
130    /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
131    /// <li>
132    /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
133    /// </ul>
134    pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
135        self.capacity = input;
136        self
137    }
138    /// <p>The DB cluster capacity.</p>
139    /// <p>When you change the capacity of a paused Aurora Serverless v1 DB cluster, it automatically resumes.</p>
140    /// <p>Constraints:</p>
141    /// <ul>
142    /// <li>
143    /// <p>For Aurora MySQL, valid capacity values are <code>1</code>, <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>128</code>, and <code>256</code>.</p></li>
144    /// <li>
145    /// <p>For Aurora PostgreSQL, valid capacity values are <code>2</code>, <code>4</code>, <code>8</code>, <code>16</code>, <code>32</code>, <code>64</code>, <code>192</code>, and <code>384</code>.</p></li>
146    /// </ul>
147    pub fn get_capacity(&self) -> &::std::option::Option<i32> {
148        &self.capacity
149    }
150    /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
151    /// <p>Specify a value between 10 and 600 seconds.</p>
152    pub fn seconds_before_timeout(mut self, input: i32) -> Self {
153        self.seconds_before_timeout = ::std::option::Option::Some(input);
154        self
155    }
156    /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
157    /// <p>Specify a value between 10 and 600 seconds.</p>
158    pub fn set_seconds_before_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
159        self.seconds_before_timeout = input;
160        self
161    }
162    /// <p>The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300.</p>
163    /// <p>Specify a value between 10 and 600 seconds.</p>
164    pub fn get_seconds_before_timeout(&self) -> &::std::option::Option<i32> {
165        &self.seconds_before_timeout
166    }
167    /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
168    /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
169    /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
170    pub fn timeout_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.timeout_action = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
175    /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
176    /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
177    pub fn set_timeout_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.timeout_action = input;
179        self
180    }
181    /// <p>The action to take when the timeout is reached, either <code>ForceApplyCapacityChange</code> or <code>RollbackCapacityChange</code>.</p>
182    /// <p><code>ForceApplyCapacityChange</code>, the default, sets the capacity to the specified value as soon as possible.</p>
183    /// <p><code>RollbackCapacityChange</code> ignores the capacity change if a scaling point isn't found in the timeout period.</p>
184    pub fn get_timeout_action(&self) -> &::std::option::Option<::std::string::String> {
185        &self.timeout_action
186    }
187    /// Consumes the builder and constructs a [`ModifyCurrentDbClusterCapacityInput`](crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityInput).
188    pub fn build(
189        self,
190    ) -> ::std::result::Result<
191        crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityInput,
192        ::aws_smithy_types::error::operation::BuildError,
193    > {
194        ::std::result::Result::Ok(
195            crate::operation::modify_current_db_cluster_capacity::ModifyCurrentDbClusterCapacityInput {
196                db_cluster_identifier: self.db_cluster_identifier,
197                capacity: self.capacity,
198                seconds_before_timeout: self.seconds_before_timeout,
199                timeout_action: self.timeout_action,
200            },
201        )
202    }
203}