1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes a volume.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateVolumeOutput {
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Information about the volume attachments.</p>
pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
/// <p>The Availability Zone for the volume.</p>
pub availability_zone: ::std::option::Option<::std::string::String>,
/// <p>The time stamp when volume creation was initiated.</p>
pub create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>Indicates whether the volume is encrypted.</p>
pub encrypted: ::std::option::Option<bool>,
/// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
pub kms_key_id: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
pub outpost_arn: ::std::option::Option<::std::string::String>,
/// <p>The size of the volume, in GiBs.</p>
pub size: ::std::option::Option<i32>,
/// <p>The snapshot from which the volume was created, if applicable.</p>
pub snapshot_id: ::std::option::Option<::std::string::String>,
/// <p>The volume state.</p>
pub state: ::std::option::Option<crate::types::VolumeState>,
/// <p>The ID of the volume.</p>
pub volume_id: ::std::option::Option<::std::string::String>,
/// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
pub iops: ::std::option::Option<i32>,
/// <p>Any tags assigned to the volume.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>The volume type.</p>
pub volume_type: ::std::option::Option<crate::types::VolumeType>,
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Indicates whether the volume was created using fast snapshot restore.</p>
pub fast_restored: ::std::option::Option<bool>,
/// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
pub multi_attach_enabled: ::std::option::Option<bool>,
/// <p>The throughput that the volume supports, in MiB/s.</p>
pub throughput: ::std::option::Option<i32>,
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Reserved for future use.</p>
pub sse_type: ::std::option::Option<crate::types::SseType>,
_request_id: Option<String>,
}
impl CreateVolumeOutput {
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Information about the volume attachments.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attachments.is_none()`.
pub fn attachments(&self) -> &[crate::types::VolumeAttachment] {
self.attachments.as_deref().unwrap_or_default()
}
/// <p>The Availability Zone for the volume.</p>
pub fn availability_zone(&self) -> ::std::option::Option<&str> {
self.availability_zone.as_deref()
}
/// <p>The time stamp when volume creation was initiated.</p>
pub fn create_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.create_time.as_ref()
}
/// <p>Indicates whether the volume is encrypted.</p>
pub fn encrypted(&self) -> ::std::option::Option<bool> {
self.encrypted
}
/// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
pub fn outpost_arn(&self) -> ::std::option::Option<&str> {
self.outpost_arn.as_deref()
}
/// <p>The size of the volume, in GiBs.</p>
pub fn size(&self) -> ::std::option::Option<i32> {
self.size
}
/// <p>The snapshot from which the volume was created, if applicable.</p>
pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
self.snapshot_id.as_deref()
}
/// <p>The volume state.</p>
pub fn state(&self) -> ::std::option::Option<&crate::types::VolumeState> {
self.state.as_ref()
}
/// <p>The ID of the volume.</p>
pub fn volume_id(&self) -> ::std::option::Option<&str> {
self.volume_id.as_deref()
}
/// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
pub fn iops(&self) -> ::std::option::Option<i32> {
self.iops
}
/// <p>Any tags assigned to the volume.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>The volume type.</p>
pub fn volume_type(&self) -> ::std::option::Option<&crate::types::VolumeType> {
self.volume_type.as_ref()
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Indicates whether the volume was created using fast snapshot restore.</p>
pub fn fast_restored(&self) -> ::std::option::Option<bool> {
self.fast_restored
}
/// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
pub fn multi_attach_enabled(&self) -> ::std::option::Option<bool> {
self.multi_attach_enabled
}
/// <p>The throughput that the volume supports, in MiB/s.</p>
pub fn throughput(&self) -> ::std::option::Option<i32> {
self.throughput
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Reserved for future use.</p>
pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
self.sse_type.as_ref()
}
}
impl ::aws_types::request_id::RequestId for CreateVolumeOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateVolumeOutput {
/// Creates a new builder-style object to manufacture [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
pub fn builder() -> crate::operation::create_volume::builders::CreateVolumeOutputBuilder {
crate::operation::create_volume::builders::CreateVolumeOutputBuilder::default()
}
}
/// A builder for [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateVolumeOutputBuilder {
pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>,
pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
pub(crate) create_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) encrypted: ::std::option::Option<bool>,
pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
pub(crate) outpost_arn: ::std::option::Option<::std::string::String>,
pub(crate) size: ::std::option::Option<i32>,
pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<crate::types::VolumeState>,
pub(crate) volume_id: ::std::option::Option<::std::string::String>,
pub(crate) iops: ::std::option::Option<i32>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) volume_type: ::std::option::Option<crate::types::VolumeType>,
pub(crate) fast_restored: ::std::option::Option<bool>,
pub(crate) multi_attach_enabled: ::std::option::Option<bool>,
pub(crate) throughput: ::std::option::Option<i32>,
pub(crate) sse_type: ::std::option::Option<crate::types::SseType>,
_request_id: Option<String>,
}
impl CreateVolumeOutputBuilder {
/// Appends an item to `attachments`.
///
/// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
///
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Information about the volume attachments.</p>
pub fn attachments(mut self, input: crate::types::VolumeAttachment) -> Self {
let mut v = self.attachments.unwrap_or_default();
v.push(input);
self.attachments = ::std::option::Option::Some(v);
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Information about the volume attachments.</p>
pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>>) -> Self {
self.attachments = input;
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Information about the volume attachments.</p>
pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VolumeAttachment>> {
&self.attachments
}
/// <p>The Availability Zone for the volume.</p>
pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.availability_zone = ::std::option::Option::Some(input.into());
self
}
/// <p>The Availability Zone for the volume.</p>
pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.availability_zone = input;
self
}
/// <p>The Availability Zone for the volume.</p>
pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
&self.availability_zone
}
/// <p>The time stamp when volume creation was initiated.</p>
pub fn create_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.create_time = ::std::option::Option::Some(input);
self
}
/// <p>The time stamp when volume creation was initiated.</p>
pub fn set_create_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.create_time = input;
self
}
/// <p>The time stamp when volume creation was initiated.</p>
pub fn get_create_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.create_time
}
/// <p>Indicates whether the volume is encrypted.</p>
pub fn encrypted(mut self, input: bool) -> Self {
self.encrypted = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether the volume is encrypted.</p>
pub fn set_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
self.encrypted = input;
self
}
/// <p>Indicates whether the volume is encrypted.</p>
pub fn get_encrypted(&self) -> &::std::option::Option<bool> {
&self.encrypted
}
/// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the KMS key that was used to protect the volume encryption key for the volume.</p>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_id
}
/// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
pub fn outpost_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.outpost_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
pub fn set_outpost_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.outpost_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the Outpost.</p>
pub fn get_outpost_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.outpost_arn
}
/// <p>The size of the volume, in GiBs.</p>
pub fn size(mut self, input: i32) -> Self {
self.size = ::std::option::Option::Some(input);
self
}
/// <p>The size of the volume, in GiBs.</p>
pub fn set_size(mut self, input: ::std::option::Option<i32>) -> Self {
self.size = input;
self
}
/// <p>The size of the volume, in GiBs.</p>
pub fn get_size(&self) -> &::std::option::Option<i32> {
&self.size
}
/// <p>The snapshot from which the volume was created, if applicable.</p>
pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.snapshot_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The snapshot from which the volume was created, if applicable.</p>
pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.snapshot_id = input;
self
}
/// <p>The snapshot from which the volume was created, if applicable.</p>
pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
&self.snapshot_id
}
/// <p>The volume state.</p>
pub fn state(mut self, input: crate::types::VolumeState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The volume state.</p>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::VolumeState>) -> Self {
self.state = input;
self
}
/// <p>The volume state.</p>
pub fn get_state(&self) -> &::std::option::Option<crate::types::VolumeState> {
&self.state
}
/// <p>The ID of the volume.</p>
pub fn volume_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.volume_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the volume.</p>
pub fn set_volume_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.volume_id = input;
self
}
/// <p>The ID of the volume.</p>
pub fn get_volume_id(&self) -> &::std::option::Option<::std::string::String> {
&self.volume_id
}
/// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
pub fn iops(mut self, input: i32) -> Self {
self.iops = ::std::option::Option::Some(input);
self
}
/// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
pub fn set_iops(mut self, input: ::std::option::Option<i32>) -> Self {
self.iops = input;
self
}
/// <p>The number of I/O operations per second (IOPS). For <code>gp3</code>, <code>io1</code>, and <code>io2</code> volumes, this represents the number of IOPS that are provisioned for the volume. For <code>gp2</code> volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.</p>
pub fn get_iops(&self) -> &::std::option::Option<i32> {
&self.iops
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>Any tags assigned to the volume.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>Any tags assigned to the volume.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>Any tags assigned to the volume.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// <p>The volume type.</p>
pub fn volume_type(mut self, input: crate::types::VolumeType) -> Self {
self.volume_type = ::std::option::Option::Some(input);
self
}
/// <p>The volume type.</p>
pub fn set_volume_type(mut self, input: ::std::option::Option<crate::types::VolumeType>) -> Self {
self.volume_type = input;
self
}
/// <p>The volume type.</p>
pub fn get_volume_type(&self) -> &::std::option::Option<crate::types::VolumeType> {
&self.volume_type
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Indicates whether the volume was created using fast snapshot restore.</p>
pub fn fast_restored(mut self, input: bool) -> Self {
self.fast_restored = ::std::option::Option::Some(input);
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Indicates whether the volume was created using fast snapshot restore.</p>
pub fn set_fast_restored(mut self, input: ::std::option::Option<bool>) -> Self {
self.fast_restored = input;
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Indicates whether the volume was created using fast snapshot restore.</p>
pub fn get_fast_restored(&self) -> &::std::option::Option<bool> {
&self.fast_restored
}
/// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
pub fn multi_attach_enabled(mut self, input: bool) -> Self {
self.multi_attach_enabled = ::std::option::Option::Some(input);
self
}
/// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
pub fn set_multi_attach_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.multi_attach_enabled = input;
self
}
/// <p>Indicates whether Amazon EBS Multi-Attach is enabled.</p>
pub fn get_multi_attach_enabled(&self) -> &::std::option::Option<bool> {
&self.multi_attach_enabled
}
/// <p>The throughput that the volume supports, in MiB/s.</p>
pub fn throughput(mut self, input: i32) -> Self {
self.throughput = ::std::option::Option::Some(input);
self
}
/// <p>The throughput that the volume supports, in MiB/s.</p>
pub fn set_throughput(mut self, input: ::std::option::Option<i32>) -> Self {
self.throughput = input;
self
}
/// <p>The throughput that the volume supports, in MiB/s.</p>
pub fn get_throughput(&self) -> &::std::option::Option<i32> {
&self.throughput
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Reserved for future use.</p>
pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
self.sse_type = ::std::option::Option::Some(input);
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Reserved for future use.</p>
pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
self.sse_type = input;
self
}
/// <note>
/// <p>This parameter is not returned by CreateVolume.</p>
/// </note>
/// <p>Reserved for future use.</p>
pub fn get_sse_type(&self) -> &::std::option::Option<crate::types::SseType> {
&self.sse_type
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`CreateVolumeOutput`](crate::operation::create_volume::CreateVolumeOutput).
pub fn build(self) -> crate::operation::create_volume::CreateVolumeOutput {
crate::operation::create_volume::CreateVolumeOutput {
attachments: self.attachments,
availability_zone: self.availability_zone,
create_time: self.create_time,
encrypted: self.encrypted,
kms_key_id: self.kms_key_id,
outpost_arn: self.outpost_arn,
size: self.size,
snapshot_id: self.snapshot_id,
state: self.state,
volume_id: self.volume_id,
iops: self.iops,
tags: self.tags,
volume_type: self.volume_type,
fast_restored: self.fast_restored,
multi_attach_enabled: self.multi_attach_enabled,
throughput: self.throughput,
sse_type: self.sse_type,
_request_id: self._request_id,
}
}
}