aws_sdk_redshift/operation/delete_cluster/_delete_cluster_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteClusterInput {
7 /// <p>The identifier of the cluster to be deleted.</p>
8 /// <p>Constraints:</p>
9 /// <ul>
10 /// <li>
11 /// <p>Must contain lowercase characters.</p></li>
12 /// <li>
13 /// <p>Must contain from 1 to 63 alphanumeric characters or hyphens.</p></li>
14 /// <li>
15 /// <p>First character must be a letter.</p></li>
16 /// <li>
17 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
18 /// </ul>
19 pub cluster_identifier: ::std::option::Option<::std::string::String>,
20 /// <p>Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If <code>true</code>, a final cluster snapshot is not created. If <code>false</code>, a final cluster snapshot is created before the cluster is deleted.</p><note>
21 /// <p>The <i>FinalClusterSnapshotIdentifier</i> parameter must be specified if <i>SkipFinalClusterSnapshot</i> is <code>false</code>.</p>
22 /// </note>
23 /// <p>Default: <code>false</code></p>
24 pub skip_final_cluster_snapshot: ::std::option::Option<bool>,
25 /// <p>The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, <i>SkipFinalClusterSnapshot</i> must be <code>false</code>.</p>
26 /// <p>Constraints:</p>
27 /// <ul>
28 /// <li>
29 /// <p>Must be 1 to 255 alphanumeric characters.</p></li>
30 /// <li>
31 /// <p>First character must be a letter.</p></li>
32 /// <li>
33 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
34 /// </ul>
35 pub final_cluster_snapshot_identifier: ::std::option::Option<::std::string::String>,
36 /// <p>The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.</p>
37 /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
38 /// <p>The default value is -1.</p>
39 pub final_cluster_snapshot_retention_period: ::std::option::Option<i32>,
40}
41impl DeleteClusterInput {
42 /// <p>The identifier of the cluster to be deleted.</p>
43 /// <p>Constraints:</p>
44 /// <ul>
45 /// <li>
46 /// <p>Must contain lowercase characters.</p></li>
47 /// <li>
48 /// <p>Must contain from 1 to 63 alphanumeric characters or hyphens.</p></li>
49 /// <li>
50 /// <p>First character must be a letter.</p></li>
51 /// <li>
52 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
53 /// </ul>
54 pub fn cluster_identifier(&self) -> ::std::option::Option<&str> {
55 self.cluster_identifier.as_deref()
56 }
57 /// <p>Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If <code>true</code>, a final cluster snapshot is not created. If <code>false</code>, a final cluster snapshot is created before the cluster is deleted.</p><note>
58 /// <p>The <i>FinalClusterSnapshotIdentifier</i> parameter must be specified if <i>SkipFinalClusterSnapshot</i> is <code>false</code>.</p>
59 /// </note>
60 /// <p>Default: <code>false</code></p>
61 pub fn skip_final_cluster_snapshot(&self) -> ::std::option::Option<bool> {
62 self.skip_final_cluster_snapshot
63 }
64 /// <p>The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, <i>SkipFinalClusterSnapshot</i> must be <code>false</code>.</p>
65 /// <p>Constraints:</p>
66 /// <ul>
67 /// <li>
68 /// <p>Must be 1 to 255 alphanumeric characters.</p></li>
69 /// <li>
70 /// <p>First character must be a letter.</p></li>
71 /// <li>
72 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
73 /// </ul>
74 pub fn final_cluster_snapshot_identifier(&self) -> ::std::option::Option<&str> {
75 self.final_cluster_snapshot_identifier.as_deref()
76 }
77 /// <p>The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.</p>
78 /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
79 /// <p>The default value is -1.</p>
80 pub fn final_cluster_snapshot_retention_period(&self) -> ::std::option::Option<i32> {
81 self.final_cluster_snapshot_retention_period
82 }
83}
84impl DeleteClusterInput {
85 /// Creates a new builder-style object to manufacture [`DeleteClusterInput`](crate::operation::delete_cluster::DeleteClusterInput).
86 pub fn builder() -> crate::operation::delete_cluster::builders::DeleteClusterInputBuilder {
87 crate::operation::delete_cluster::builders::DeleteClusterInputBuilder::default()
88 }
89}
90
91/// A builder for [`DeleteClusterInput`](crate::operation::delete_cluster::DeleteClusterInput).
92#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
93#[non_exhaustive]
94pub struct DeleteClusterInputBuilder {
95 pub(crate) cluster_identifier: ::std::option::Option<::std::string::String>,
96 pub(crate) skip_final_cluster_snapshot: ::std::option::Option<bool>,
97 pub(crate) final_cluster_snapshot_identifier: ::std::option::Option<::std::string::String>,
98 pub(crate) final_cluster_snapshot_retention_period: ::std::option::Option<i32>,
99}
100impl DeleteClusterInputBuilder {
101 /// <p>The identifier of the cluster to be deleted.</p>
102 /// <p>Constraints:</p>
103 /// <ul>
104 /// <li>
105 /// <p>Must contain lowercase characters.</p></li>
106 /// <li>
107 /// <p>Must contain from 1 to 63 alphanumeric characters or hyphens.</p></li>
108 /// <li>
109 /// <p>First character must be a letter.</p></li>
110 /// <li>
111 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
112 /// </ul>
113 /// This field is required.
114 pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.cluster_identifier = ::std::option::Option::Some(input.into());
116 self
117 }
118 /// <p>The identifier of the cluster to be deleted.</p>
119 /// <p>Constraints:</p>
120 /// <ul>
121 /// <li>
122 /// <p>Must contain lowercase characters.</p></li>
123 /// <li>
124 /// <p>Must contain from 1 to 63 alphanumeric characters or hyphens.</p></li>
125 /// <li>
126 /// <p>First character must be a letter.</p></li>
127 /// <li>
128 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
129 /// </ul>
130 pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.cluster_identifier = input;
132 self
133 }
134 /// <p>The identifier of the cluster to be deleted.</p>
135 /// <p>Constraints:</p>
136 /// <ul>
137 /// <li>
138 /// <p>Must contain lowercase characters.</p></li>
139 /// <li>
140 /// <p>Must contain from 1 to 63 alphanumeric characters or hyphens.</p></li>
141 /// <li>
142 /// <p>First character must be a letter.</p></li>
143 /// <li>
144 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
145 /// </ul>
146 pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
147 &self.cluster_identifier
148 }
149 /// <p>Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If <code>true</code>, a final cluster snapshot is not created. If <code>false</code>, a final cluster snapshot is created before the cluster is deleted.</p><note>
150 /// <p>The <i>FinalClusterSnapshotIdentifier</i> parameter must be specified if <i>SkipFinalClusterSnapshot</i> is <code>false</code>.</p>
151 /// </note>
152 /// <p>Default: <code>false</code></p>
153 pub fn skip_final_cluster_snapshot(mut self, input: bool) -> Self {
154 self.skip_final_cluster_snapshot = ::std::option::Option::Some(input);
155 self
156 }
157 /// <p>Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If <code>true</code>, a final cluster snapshot is not created. If <code>false</code>, a final cluster snapshot is created before the cluster is deleted.</p><note>
158 /// <p>The <i>FinalClusterSnapshotIdentifier</i> parameter must be specified if <i>SkipFinalClusterSnapshot</i> is <code>false</code>.</p>
159 /// </note>
160 /// <p>Default: <code>false</code></p>
161 pub fn set_skip_final_cluster_snapshot(mut self, input: ::std::option::Option<bool>) -> Self {
162 self.skip_final_cluster_snapshot = input;
163 self
164 }
165 /// <p>Determines whether a final snapshot of the cluster is created before Amazon Redshift deletes the cluster. If <code>true</code>, a final cluster snapshot is not created. If <code>false</code>, a final cluster snapshot is created before the cluster is deleted.</p><note>
166 /// <p>The <i>FinalClusterSnapshotIdentifier</i> parameter must be specified if <i>SkipFinalClusterSnapshot</i> is <code>false</code>.</p>
167 /// </note>
168 /// <p>Default: <code>false</code></p>
169 pub fn get_skip_final_cluster_snapshot(&self) -> &::std::option::Option<bool> {
170 &self.skip_final_cluster_snapshot
171 }
172 /// <p>The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, <i>SkipFinalClusterSnapshot</i> must be <code>false</code>.</p>
173 /// <p>Constraints:</p>
174 /// <ul>
175 /// <li>
176 /// <p>Must be 1 to 255 alphanumeric characters.</p></li>
177 /// <li>
178 /// <p>First character must be a letter.</p></li>
179 /// <li>
180 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
181 /// </ul>
182 pub fn final_cluster_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183 self.final_cluster_snapshot_identifier = ::std::option::Option::Some(input.into());
184 self
185 }
186 /// <p>The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, <i>SkipFinalClusterSnapshot</i> must be <code>false</code>.</p>
187 /// <p>Constraints:</p>
188 /// <ul>
189 /// <li>
190 /// <p>Must be 1 to 255 alphanumeric characters.</p></li>
191 /// <li>
192 /// <p>First character must be a letter.</p></li>
193 /// <li>
194 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
195 /// </ul>
196 pub fn set_final_cluster_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.final_cluster_snapshot_identifier = input;
198 self
199 }
200 /// <p>The identifier of the final snapshot that is to be created immediately before deleting the cluster. If this parameter is provided, <i>SkipFinalClusterSnapshot</i> must be <code>false</code>.</p>
201 /// <p>Constraints:</p>
202 /// <ul>
203 /// <li>
204 /// <p>Must be 1 to 255 alphanumeric characters.</p></li>
205 /// <li>
206 /// <p>First character must be a letter.</p></li>
207 /// <li>
208 /// <p>Cannot end with a hyphen or contain two consecutive hyphens.</p></li>
209 /// </ul>
210 pub fn get_final_cluster_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
211 &self.final_cluster_snapshot_identifier
212 }
213 /// <p>The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.</p>
214 /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
215 /// <p>The default value is -1.</p>
216 pub fn final_cluster_snapshot_retention_period(mut self, input: i32) -> Self {
217 self.final_cluster_snapshot_retention_period = ::std::option::Option::Some(input);
218 self
219 }
220 /// <p>The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.</p>
221 /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
222 /// <p>The default value is -1.</p>
223 pub fn set_final_cluster_snapshot_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
224 self.final_cluster_snapshot_retention_period = input;
225 self
226 }
227 /// <p>The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely.</p>
228 /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
229 /// <p>The default value is -1.</p>
230 pub fn get_final_cluster_snapshot_retention_period(&self) -> &::std::option::Option<i32> {
231 &self.final_cluster_snapshot_retention_period
232 }
233 /// Consumes the builder and constructs a [`DeleteClusterInput`](crate::operation::delete_cluster::DeleteClusterInput).
234 pub fn build(
235 self,
236 ) -> ::std::result::Result<crate::operation::delete_cluster::DeleteClusterInput, ::aws_smithy_types::error::operation::BuildError> {
237 ::std::result::Result::Ok(crate::operation::delete_cluster::DeleteClusterInput {
238 cluster_identifier: self.cluster_identifier,
239 skip_final_cluster_snapshot: self.skip_final_cluster_snapshot,
240 final_cluster_snapshot_identifier: self.final_cluster_snapshot_identifier,
241 final_cluster_snapshot_retention_period: self.final_cluster_snapshot_retention_period,
242 })
243 }
244}