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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes a snapshot.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateSnapshotOutput {
/// <p>The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
#[doc(hidden)]
pub data_encryption_key_id: std::option::Option<std::string::String>,
/// <p>The description for the snapshot.</p>
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
/// <p>Indicates whether the snapshot is encrypted.</p>
#[doc(hidden)]
pub encrypted: std::option::Option<bool>,
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume encryption key for the parent volume.</p>
#[doc(hidden)]
pub kms_key_id: std::option::Option<std::string::String>,
/// <p>The ID of the Amazon Web Services account that owns the EBS snapshot.</p>
#[doc(hidden)]
pub owner_id: std::option::Option<std::string::String>,
/// <p>The progress of the snapshot, as a percentage.</p>
#[doc(hidden)]
pub progress: std::option::Option<std::string::String>,
/// <p>The ID of the snapshot. Each snapshot receives a unique identifier when it is created.</p>
#[doc(hidden)]
pub snapshot_id: std::option::Option<std::string::String>,
/// <p>The time stamp when the snapshot was initiated.</p>
#[doc(hidden)]
pub start_time: std::option::Option<aws_smithy_types::DateTime>,
/// <p>The snapshot state.</p>
#[doc(hidden)]
pub state: std::option::Option<crate::types::SnapshotState>,
/// <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
#[doc(hidden)]
pub state_message: std::option::Option<std::string::String>,
/// <p>The ID of the volume that was used to create the snapshot. Snapshots created by the <code>CopySnapshot</code> action have an arbitrary volume ID that should not be used for any purpose.</p>
#[doc(hidden)]
pub volume_id: std::option::Option<std::string::String>,
/// <p>The size of the volume, in GiB.</p>
#[doc(hidden)]
pub volume_size: std::option::Option<i32>,
/// <p>The Amazon Web Services owner alias, from an Amazon-maintained list (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using the IAM console.</p>
#[doc(hidden)]
pub owner_alias: std::option::Option<std::string::String>,
/// <p>The ARN of the Outpost on which the snapshot is stored. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html">Amazon EBS local snapshots on Outposts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
#[doc(hidden)]
pub outpost_arn: std::option::Option<std::string::String>,
/// <p>Any tags assigned to the snapshot.</p>
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::types::Tag>>,
/// <p>The storage tier in which the snapshot is stored. <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and that it must be restored before it can be used.</p>
#[doc(hidden)]
pub storage_tier: std::option::Option<crate::types::StorageTier>,
/// <p>Only for archived snapshots that are temporarily restored. Indicates the date and time when a temporarily restored snapshot will be automatically re-archived.</p>
#[doc(hidden)]
pub restore_expiry_time: std::option::Option<aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateSnapshotOutput {
/// <p>The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn data_encryption_key_id(&self) -> std::option::Option<&str> {
self.data_encryption_key_id.as_deref()
}
/// <p>The description for the snapshot.</p>
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
/// <p>Indicates whether the snapshot is encrypted.</p>
pub fn encrypted(&self) -> std::option::Option<bool> {
self.encrypted
}
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume encryption key for the parent volume.</p>
pub fn kms_key_id(&self) -> std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The ID of the Amazon Web Services account that owns the EBS snapshot.</p>
pub fn owner_id(&self) -> std::option::Option<&str> {
self.owner_id.as_deref()
}
/// <p>The progress of the snapshot, as a percentage.</p>
pub fn progress(&self) -> std::option::Option<&str> {
self.progress.as_deref()
}
/// <p>The ID of the snapshot. Each snapshot receives a unique identifier when it is created.</p>
pub fn snapshot_id(&self) -> std::option::Option<&str> {
self.snapshot_id.as_deref()
}
/// <p>The time stamp when the snapshot was initiated.</p>
pub fn start_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>The snapshot state.</p>
pub fn state(&self) -> std::option::Option<&crate::types::SnapshotState> {
self.state.as_ref()
}
/// <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn state_message(&self) -> std::option::Option<&str> {
self.state_message.as_deref()
}
/// <p>The ID of the volume that was used to create the snapshot. Snapshots created by the <code>CopySnapshot</code> action have an arbitrary volume ID that should not be used for any purpose.</p>
pub fn volume_id(&self) -> std::option::Option<&str> {
self.volume_id.as_deref()
}
/// <p>The size of the volume, in GiB.</p>
pub fn volume_size(&self) -> std::option::Option<i32> {
self.volume_size
}
/// <p>The Amazon Web Services owner alias, from an Amazon-maintained list (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using the IAM console.</p>
pub fn owner_alias(&self) -> std::option::Option<&str> {
self.owner_alias.as_deref()
}
/// <p>The ARN of the Outpost on which the snapshot is stored. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html">Amazon EBS local snapshots on Outposts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn outpost_arn(&self) -> std::option::Option<&str> {
self.outpost_arn.as_deref()
}
/// <p>Any tags assigned to the snapshot.</p>
pub fn tags(&self) -> std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
/// <p>The storage tier in which the snapshot is stored. <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and that it must be restored before it can be used.</p>
pub fn storage_tier(&self) -> std::option::Option<&crate::types::StorageTier> {
self.storage_tier.as_ref()
}
/// <p>Only for archived snapshots that are temporarily restored. Indicates the date and time when a temporarily restored snapshot will be automatically re-archived.</p>
pub fn restore_expiry_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.restore_expiry_time.as_ref()
}
}
impl aws_http::request_id::RequestId for CreateSnapshotOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateSnapshotOutput {
/// Creates a new builder-style object to manufacture [`CreateSnapshotOutput`](crate::operation::create_snapshot::CreateSnapshotOutput).
pub fn builder() -> crate::operation::create_snapshot::builders::CreateSnapshotOutputBuilder {
crate::operation::create_snapshot::builders::CreateSnapshotOutputBuilder::default()
}
}
/// A builder for [`CreateSnapshotOutput`](crate::operation::create_snapshot::CreateSnapshotOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateSnapshotOutputBuilder {
pub(crate) data_encryption_key_id: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) encrypted: std::option::Option<bool>,
pub(crate) kms_key_id: std::option::Option<std::string::String>,
pub(crate) owner_id: std::option::Option<std::string::String>,
pub(crate) progress: std::option::Option<std::string::String>,
pub(crate) snapshot_id: std::option::Option<std::string::String>,
pub(crate) start_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) state: std::option::Option<crate::types::SnapshotState>,
pub(crate) state_message: std::option::Option<std::string::String>,
pub(crate) volume_id: std::option::Option<std::string::String>,
pub(crate) volume_size: std::option::Option<i32>,
pub(crate) owner_alias: std::option::Option<std::string::String>,
pub(crate) outpost_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::types::Tag>>,
pub(crate) storage_tier: std::option::Option<crate::types::StorageTier>,
pub(crate) restore_expiry_time: std::option::Option<aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl CreateSnapshotOutputBuilder {
/// <p>The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn data_encryption_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.data_encryption_key_id = Some(input.into());
self
}
/// <p>The data encryption key identifier for the snapshot. This value is a unique identifier that corresponds to the data encryption key that was used to encrypt the original volume or snapshot copy. Because data encryption keys are inherited by volumes created from snapshots, and vice versa, if snapshots share the same data encryption key identifier, then they belong to the same volume/snapshot lineage. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn set_data_encryption_key_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.data_encryption_key_id = input;
self
}
/// <p>The description for the snapshot.</p>
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
/// <p>The description for the snapshot.</p>
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
/// <p>Indicates whether the snapshot is encrypted.</p>
pub fn encrypted(mut self, input: bool) -> Self {
self.encrypted = Some(input);
self
}
/// <p>Indicates whether the snapshot is encrypted.</p>
pub fn set_encrypted(mut self, input: std::option::Option<bool>) -> Self {
self.encrypted = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume encryption key for the parent volume.</p>
pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
self.kms_key_id = Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) KMS key that was used to protect the volume encryption key for the parent 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 ID of the Amazon Web Services account that owns the EBS snapshot.</p>
pub fn owner_id(mut self, input: impl Into<std::string::String>) -> Self {
self.owner_id = Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services account that owns the EBS snapshot.</p>
pub fn set_owner_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.owner_id = input;
self
}
/// <p>The progress of the snapshot, as a percentage.</p>
pub fn progress(mut self, input: impl Into<std::string::String>) -> Self {
self.progress = Some(input.into());
self
}
/// <p>The progress of the snapshot, as a percentage.</p>
pub fn set_progress(mut self, input: std::option::Option<std::string::String>) -> Self {
self.progress = input;
self
}
/// <p>The ID of the snapshot. Each snapshot receives a unique identifier when it is created.</p>
pub fn snapshot_id(mut self, input: impl Into<std::string::String>) -> Self {
self.snapshot_id = Some(input.into());
self
}
/// <p>The ID of the snapshot. Each snapshot receives a unique identifier when it is created.</p>
pub fn set_snapshot_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.snapshot_id = input;
self
}
/// <p>The time stamp when the snapshot was initiated.</p>
pub fn start_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_time = Some(input);
self
}
/// <p>The time stamp when the snapshot was initiated.</p>
pub fn set_start_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_time = input;
self
}
/// <p>The snapshot state.</p>
pub fn state(mut self, input: crate::types::SnapshotState) -> Self {
self.state = Some(input);
self
}
/// <p>The snapshot state.</p>
pub fn set_state(mut self, input: std::option::Option<crate::types::SnapshotState>) -> Self {
self.state = input;
self
}
/// <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn state_message(mut self, input: impl Into<std::string::String>) -> Self {
self.state_message = Some(input.into());
self
}
/// <p>Encrypted Amazon EBS snapshots are copied asynchronously. If a snapshot copy operation fails (for example, if the proper Key Management Service (KMS) permissions are not obtained) this field displays error state details to help you diagnose why the error occurred. This parameter is only returned by <code>DescribeSnapshots</code>.</p>
pub fn set_state_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.state_message = input;
self
}
/// <p>The ID of the volume that was used to create the snapshot. Snapshots created by the <code>CopySnapshot</code> action have an arbitrary volume ID that should not be used for any purpose.</p>
pub fn volume_id(mut self, input: impl Into<std::string::String>) -> Self {
self.volume_id = Some(input.into());
self
}
/// <p>The ID of the volume that was used to create the snapshot. Snapshots created by the <code>CopySnapshot</code> action have an arbitrary volume ID that should not be used for any purpose.</p>
pub fn set_volume_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.volume_id = input;
self
}
/// <p>The size of the volume, in GiB.</p>
pub fn volume_size(mut self, input: i32) -> Self {
self.volume_size = Some(input);
self
}
/// <p>The size of the volume, in GiB.</p>
pub fn set_volume_size(mut self, input: std::option::Option<i32>) -> Self {
self.volume_size = input;
self
}
/// <p>The Amazon Web Services owner alias, from an Amazon-maintained list (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using the IAM console.</p>
pub fn owner_alias(mut self, input: impl Into<std::string::String>) -> Self {
self.owner_alias = Some(input.into());
self
}
/// <p>The Amazon Web Services owner alias, from an Amazon-maintained list (<code>amazon</code>). This is not the user-configured Amazon Web Services account alias set using the IAM console.</p>
pub fn set_owner_alias(mut self, input: std::option::Option<std::string::String>) -> Self {
self.owner_alias = input;
self
}
/// <p>The ARN of the Outpost on which the snapshot is stored. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html">Amazon EBS local snapshots on Outposts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn outpost_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.outpost_arn = Some(input.into());
self
}
/// <p>The ARN of the Outpost on which the snapshot is stored. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html">Amazon EBS local snapshots on Outposts</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn set_outpost_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.outpost_arn = input;
self
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>Any tags assigned to the snapshot.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
/// <p>Any tags assigned to the snapshot.</p>
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::types::Tag>>,
) -> Self {
self.tags = input;
self
}
/// <p>The storage tier in which the snapshot is stored. <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and that it must be restored before it can be used.</p>
pub fn storage_tier(mut self, input: crate::types::StorageTier) -> Self {
self.storage_tier = Some(input);
self
}
/// <p>The storage tier in which the snapshot is stored. <code>standard</code> indicates that the snapshot is stored in the standard snapshot storage tier and that it is ready for use. <code>archive</code> indicates that the snapshot is currently archived and that it must be restored before it can be used.</p>
pub fn set_storage_tier(
mut self,
input: std::option::Option<crate::types::StorageTier>,
) -> Self {
self.storage_tier = input;
self
}
/// <p>Only for archived snapshots that are temporarily restored. Indicates the date and time when a temporarily restored snapshot will be automatically re-archived.</p>
pub fn restore_expiry_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.restore_expiry_time = Some(input);
self
}
/// <p>Only for archived snapshots that are temporarily restored. Indicates the date and time when a temporarily restored snapshot will be automatically re-archived.</p>
pub fn set_restore_expiry_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.restore_expiry_time = input;
self
}
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 [`CreateSnapshotOutput`](crate::operation::create_snapshot::CreateSnapshotOutput).
pub fn build(self) -> crate::operation::create_snapshot::CreateSnapshotOutput {
crate::operation::create_snapshot::CreateSnapshotOutput {
data_encryption_key_id: self.data_encryption_key_id,
description: self.description,
encrypted: self.encrypted,
kms_key_id: self.kms_key_id,
owner_id: self.owner_id,
progress: self.progress,
snapshot_id: self.snapshot_id,
start_time: self.start_time,
state: self.state,
state_message: self.state_message,
volume_id: self.volume_id,
volume_size: self.volume_size,
owner_alias: self.owner_alias,
outpost_arn: self.outpost_arn,
tags: self.tags,
storage_tier: self.storage_tier,
restore_expiry_time: self.restore_expiry_time,
_request_id: self._request_id,
}
}
}