aws_sdk_ec2/operation/modify_volume/_modify_volume_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 ModifyVolumeInput {
6 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
7 pub dry_run: ::std::option::Option<bool>,
8 /// <p>The ID of the volume.</p>
9 pub volume_id: ::std::option::Option<::std::string::String>,
10 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
11 /// <p>The following are the supported volumes sizes for each volume type:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>gp2</code>: 1 - 16,384 GiB</p></li>
15 /// <li>
16 /// <p><code>gp3</code>: 1 - 65,536 GiB</p></li>
17 /// <li>
18 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
19 /// <li>
20 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
21 /// <li>
22 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
23 /// <li>
24 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
25 /// </ul>
26 /// <p>Default: The existing size is retained.</p>
27 pub size: ::std::option::Option<i32>,
28 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
29 /// <p>Default: The existing type is retained.</p>
30 pub volume_type: ::std::option::Option<crate::types::VolumeType>,
31 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
32 /// <p>The following are the supported values for each volume type:</p>
33 /// <ul>
34 /// <li>
35 /// <p><code>gp3</code>: 3,000 - 80,000 IOPS</p></li>
36 /// <li>
37 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
38 /// <li>
39 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
40 /// </ul><note>
41 /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
42 /// </note>
43 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
44 pub iops: ::std::option::Option<i32>,
45 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 2,000.</p>
46 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
47 /// <p>Valid Range: Minimum value of 125. Maximum value of 2,000.</p>
48 pub throughput: ::std::option::Option<i32>,
49 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
50 pub multi_attach_enabled: ::std::option::Option<bool>,
51}
52impl ModifyVolumeInput {
53 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
54 pub fn dry_run(&self) -> ::std::option::Option<bool> {
55 self.dry_run
56 }
57 /// <p>The ID of the volume.</p>
58 pub fn volume_id(&self) -> ::std::option::Option<&str> {
59 self.volume_id.as_deref()
60 }
61 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
62 /// <p>The following are the supported volumes sizes for each volume type:</p>
63 /// <ul>
64 /// <li>
65 /// <p><code>gp2</code>: 1 - 16,384 GiB</p></li>
66 /// <li>
67 /// <p><code>gp3</code>: 1 - 65,536 GiB</p></li>
68 /// <li>
69 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
70 /// <li>
71 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
72 /// <li>
73 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
74 /// <li>
75 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
76 /// </ul>
77 /// <p>Default: The existing size is retained.</p>
78 pub fn size(&self) -> ::std::option::Option<i32> {
79 self.size
80 }
81 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
82 /// <p>Default: The existing type is retained.</p>
83 pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
84 self.volume_type.as_ref()
85 }
86 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
87 /// <p>The following are the supported values for each volume type:</p>
88 /// <ul>
89 /// <li>
90 /// <p><code>gp3</code>: 3,000 - 80,000 IOPS</p></li>
91 /// <li>
92 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
93 /// <li>
94 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
95 /// </ul><note>
96 /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
97 /// </note>
98 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
99 pub fn iops(&self) -> ::std::option::Option<i32> {
100 self.iops
101 }
102 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 2,000.</p>
103 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
104 /// <p>Valid Range: Minimum value of 125. Maximum value of 2,000.</p>
105 pub fn throughput(&self) -> ::std::option::Option<i32> {
106 self.throughput
107 }
108 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
109 pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
110 self.multi_attach_enabled
111 }
112}
113impl ModifyVolumeInput {
114 /// Creates a new builder-style object to manufacture [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
115 pub fn builder() -> crate::operation::modify_volume::builders::ModifyVolumeInputBuilder {
116 crate::operation::modify_volume::builders::ModifyVolumeInputBuilder::default()
117 }
118}
119
120/// A builder for [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
121#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
122#[non_exhaustive]
123pub struct ModifyVolumeInputBuilder {
124 pub(crate) dry_run: ::std::option::Option<bool>,
125 pub(crate) volume_id: ::std::option::Option<::std::string::String>,
126 pub(crate) size: ::std::option::Option<i32>,
127 pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
128 pub(crate) iops: ::std::option::Option<i32>,
129 pub(crate) throughput: ::std::option::Option<i32>,
130 pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
131}
132impl ModifyVolumeInputBuilder {
133 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
134 pub fn dry_run(mut self, input: bool) -> Self {
135 self.dry_run = ::std::option::Option::Some(input);
136 self
137 }
138 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
139 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
140 self.dry_run = input;
141 self
142 }
143 /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
144 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
145 &self.dry_run
146 }
147 /// <p>The ID of the volume.</p>
148 /// This field is required.
149 pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.volume_id = ::std::option::Option::Some(input.into());
151 self
152 }
153 /// <p>The ID of the volume.</p>
154 pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.volume_id = input;
156 self
157 }
158 /// <p>The ID of the volume.</p>
159 pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
160 &self.volume_id
161 }
162 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
163 /// <p>The following are the supported volumes sizes for each volume type:</p>
164 /// <ul>
165 /// <li>
166 /// <p><code>gp2</code>: 1 - 16,384 GiB</p></li>
167 /// <li>
168 /// <p><code>gp3</code>: 1 - 65,536 GiB</p></li>
169 /// <li>
170 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
171 /// <li>
172 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
173 /// <li>
174 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
175 /// <li>
176 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
177 /// </ul>
178 /// <p>Default: The existing size is retained.</p>
179 pub fn size(mut self, input: i32) -> Self {
180 self.size = ::std::option::Option::Some(input);
181 self
182 }
183 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
184 /// <p>The following are the supported volumes sizes for each volume type:</p>
185 /// <ul>
186 /// <li>
187 /// <p><code>gp2</code>: 1 - 16,384 GiB</p></li>
188 /// <li>
189 /// <p><code>gp3</code>: 1 - 65,536 GiB</p></li>
190 /// <li>
191 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
192 /// <li>
193 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
194 /// <li>
195 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
196 /// <li>
197 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
198 /// </ul>
199 /// <p>Default: The existing size is retained.</p>
200 pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
201 self.size = input;
202 self
203 }
204 /// <p>The target size of the volume, in GiB. The target volume size must be greater than or equal to the existing size of the volume.</p>
205 /// <p>The following are the supported volumes sizes for each volume type:</p>
206 /// <ul>
207 /// <li>
208 /// <p><code>gp2</code>: 1 - 16,384 GiB</p></li>
209 /// <li>
210 /// <p><code>gp3</code>: 1 - 65,536 GiB</p></li>
211 /// <li>
212 /// <p><code>io1</code>: 4 - 16,384 GiB</p></li>
213 /// <li>
214 /// <p><code>io2</code>: 4 - 65,536 GiB</p></li>
215 /// <li>
216 /// <p><code>st1</code> and <code>sc1</code>: 125 - 16,384 GiB</p></li>
217 /// <li>
218 /// <p><code>standard</code>: 1 - 1024 GiB</p></li>
219 /// </ul>
220 /// <p>Default: The existing size is retained.</p>
221 pub fn get_size(&self) -> &::std::option::Option<i32> {
222 &self.size
223 }
224 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
225 /// <p>Default: The existing type is retained.</p>
226 pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
227 self.volume_type = ::std::option::Option::Some(input);
228 self
229 }
230 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
231 /// <p>Default: The existing type is retained.</p>
232 pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
233 self.volume_type = input;
234 self
235 }
236 /// <p>The target EBS volume type of the volume. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volume-types.html">Amazon EBS volume types</a> in the <i>Amazon EBS User Guide</i>.</p>
237 /// <p>Default: The existing type is retained.</p>
238 pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
239 &self.volume_type
240 }
241 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
242 /// <p>The following are the supported values for each volume type:</p>
243 /// <ul>
244 /// <li>
245 /// <p><code>gp3</code>: 3,000 - 80,000 IOPS</p></li>
246 /// <li>
247 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
248 /// <li>
249 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
250 /// </ul><note>
251 /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
252 /// </note>
253 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
254 pub fn iops(mut self, input: i32) -> Self {
255 self.iops = ::std::option::Option::Some(input);
256 self
257 }
258 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
259 /// <p>The following are the supported values for each volume type:</p>
260 /// <ul>
261 /// <li>
262 /// <p><code>gp3</code>: 3,000 - 80,000 IOPS</p></li>
263 /// <li>
264 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
265 /// <li>
266 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
267 /// </ul><note>
268 /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
269 /// </note>
270 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
271 pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
272 self.iops = input;
273 self
274 }
275 /// <p>The target IOPS rate of the volume. This parameter is valid only for <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes.</p>
276 /// <p>The following are the supported values for each volume type:</p>
277 /// <ul>
278 /// <li>
279 /// <p><code>gp3</code>: 3,000 - 80,000 IOPS</p></li>
280 /// <li>
281 /// <p><code>io1</code>: 100 - 64,000 IOPS</p></li>
282 /// <li>
283 /// <p><code>io2</code>: 100 - 256,000 IOPS</p></li>
284 /// </ul><note>
285 /// <p><a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.</p>
286 /// </note>
287 /// <p>Default: The existing value is retained if you keep the same volume type. If you change the volume type to <code>io1</code>, <code>io2</code>, or <code>gp3</code>, the default is 3,000.</p>
288 pub fn get_iops(&self) -> &::std::option::Option<i32> {
289 &self.iops
290 }
291 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 2,000.</p>
292 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
293 /// <p>Valid Range: Minimum value of 125. Maximum value of 2,000.</p>
294 pub fn throughput(mut self, input: i32) -> Self {
295 self.throughput = ::std::option::Option::Some(input);
296 self
297 }
298 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 2,000.</p>
299 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
300 /// <p>Valid Range: Minimum value of 125. Maximum value of 2,000.</p>
301 pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
302 self.throughput = input;
303 self
304 }
305 /// <p>The target throughput of the volume, in MiB/s. This parameter is valid only for <code>gp3</code> volumes. The maximum value is 2,000.</p>
306 /// <p>Default: The existing value is retained if the source and target volume type is <code>gp3</code>. Otherwise, the default value is 125.</p>
307 /// <p>Valid Range: Minimum value of 125. Maximum value of 2,000.</p>
308 pub fn get_throughput(&self) -> &::std::option::Option<i32> {
309 &self.throughput
310 }
311 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
312 pub fn multi_attach_enabled(mut self, input: bool) -> Self {
313 self.multi_attach_enabled = ::std::option::Option::Some(input);
314 self
315 }
316 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
317 pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
318 self.multi_attach_enabled = input;
319 self
320 }
321 /// <p>Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, you can attach the volume to up to 16 <a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html"> Nitro-based instances</a> in the same Availability Zone. This parameter is supported with <code>io1</code> and <code>io2</code> volumes only. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes-multi.html"> Amazon EBS Multi-Attach</a> in the <i>Amazon EBS User Guide</i>.</p>
322 pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
323 &self.multi_attach_enabled
324 }
325 /// Consumes the builder and constructs a [`ModifyVolumeInput`](crate::operation::modify_volume::ModifyVolumeInput).
326 pub fn build(
327 self,
328 ) -> ::std::result::Result<crate::operation::modify_volume::ModifyVolumeInput, ::aws_smithy_types::error::operation::BuildError> {
329 ::std::result::Result::Ok(crate::operation::modify_volume::ModifyVolumeInput {
330 dry_run: self.dry_run,
331 volume_id: self.volume_id,
332 size: self.size,
333 volume_type: self.volume_type,
334 iops: self.iops,
335 throughput: self.throughput,
336 multi_attach_enabled: self.multi_attach_enabled,
337 })
338 }
339}