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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetSnapshotBlockInput {
/// <p>The ID of the snapshot containing the block from which to get data.</p><important>
/// <p>If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// </important>
pub snapshot_id: ::std::option::Option<::std::string::String>,
/// <p>The block index of the block in which to read the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub block_index: ::std::option::Option<i32>,
/// <p>The block token of the block from which to get data. You can obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub block_token: ::std::option::Option<::std::string::String>,
}
impl GetSnapshotBlockInput {
/// <p>The ID of the snapshot containing the block from which to get data.</p><important>
/// <p>If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// </important>
pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
self.snapshot_id.as_deref()
}
/// <p>The block index of the block in which to read the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub fn block_index(&self) -> ::std::option::Option<i32> {
self.block_index
}
/// <p>The block token of the block from which to get data. You can obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn block_token(&self) -> ::std::option::Option<&str> {
self.block_token.as_deref()
}
}
impl GetSnapshotBlockInput {
/// Creates a new builder-style object to manufacture [`GetSnapshotBlockInput`](crate::operation::get_snapshot_block::GetSnapshotBlockInput).
pub fn builder() -> crate::operation::get_snapshot_block::builders::GetSnapshotBlockInputBuilder {
crate::operation::get_snapshot_block::builders::GetSnapshotBlockInputBuilder::default()
}
}
/// A builder for [`GetSnapshotBlockInput`](crate::operation::get_snapshot_block::GetSnapshotBlockInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetSnapshotBlockInputBuilder {
pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
pub(crate) block_index: ::std::option::Option<i32>,
pub(crate) block_token: ::std::option::Option<::std::string::String>,
}
impl GetSnapshotBlockInputBuilder {
/// <p>The ID of the snapshot containing the block from which to get data.</p><important>
/// <p>If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// </important>
/// This field is required.
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 ID of the snapshot containing the block from which to get data.</p><important>
/// <p>If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// </important>
pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.snapshot_id = input;
self
}
/// <p>The ID of the snapshot containing the block from which to get data.</p><important>
/// <p>If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebsapis-using-encryption.html"> Using encryption</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// </important>
pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
&self.snapshot_id
}
/// <p>The block index of the block in which to read the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
/// This field is required.
pub fn block_index(mut self, input: i32) -> Self {
self.block_index = ::std::option::Option::Some(input);
self
}
/// <p>The block index of the block in which to read the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub fn set_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
self.block_index = input;
self
}
/// <p>The block index of the block in which to read the data. A block index is a logical index in units of <code>512</code> KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/<code>524288</code>). The logical offset of the data must be <code>512</code> KiB aligned.</p>
pub fn get_block_index(&self) -> &::std::option::Option<i32> {
&self.block_index
}
/// <p>The block token of the block from which to get data. You can obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
/// This field is required.
pub fn block_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.block_token = ::std::option::Option::Some(input.into());
self
}
/// <p>The block token of the block from which to get data. You can obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn set_block_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.block_token = input;
self
}
/// <p>The block token of the block from which to get data. You can obtain the <code>BlockToken</code> by running the <code>ListChangedBlocks</code> or <code>ListSnapshotBlocks</code> operations.</p>
pub fn get_block_token(&self) -> &::std::option::Option<::std::string::String> {
&self.block_token
}
/// Consumes the builder and constructs a [`GetSnapshotBlockInput`](crate::operation::get_snapshot_block::GetSnapshotBlockInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_snapshot_block::GetSnapshotBlockInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_snapshot_block::GetSnapshotBlockInput {
snapshot_id: self.snapshot_id,
block_index: self.block_index,
block_token: self.block_token,
})
}
}