// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
pub struct PutSnapshotBlockInput {
/// <p>The ID of the snapshot.</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 write 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 data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub block_data: ::aws_smithy_types::byte_stream::ByteStream,
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code></p>
pub data_length: ::std::option::Option<i32>,
/// <p>The progress of the write process, as a percentage.</p>
pub progress: ::std::option::Option<i32>,
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub checksum: ::std::option::Option<::std::string::String>,
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
}
impl PutSnapshotBlockInput {
/// <p>The ID of the snapshot.</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 write 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 data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn block_data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
&self.block_data
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code></p>
pub fn data_length(&self) -> ::std::option::Option<i32> {
self.data_length
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn progress(&self) -> ::std::option::Option<i32> {
self.progress
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub fn checksum(&self) -> ::std::option::Option<&str> {
self.checksum.as_deref()
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
self.checksum_algorithm.as_ref()
}
}
impl ::std::fmt::Debug for PutSnapshotBlockInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("PutSnapshotBlockInput");
formatter.field("snapshot_id", &self.snapshot_id);
formatter.field("block_index", &self.block_index);
formatter.field("block_data", &"*** Sensitive Data Redacted ***");
formatter.field("data_length", &self.data_length);
formatter.field("progress", &self.progress);
formatter.field("checksum", &self.checksum);
formatter.field("checksum_algorithm", &self.checksum_algorithm);
formatter.finish()
}
}
static PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$SnapshotId",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::String,
"SnapshotId",
0,
)
.with_http_label();
static PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$BlockIndex",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::Integer,
"BlockIndex",
1,
)
.with_http_label();
static PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_DATA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$BlockData",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::Blob,
"BlockData",
2,
)
.with_http_payload()
.with_streaming();
static PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$DataLength",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::Integer,
"DataLength",
3,
)
.with_http_header("x-amz-Data-Length");
static PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$Progress",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::Integer,
"Progress",
4,
)
.with_http_header("x-amz-Progress");
static PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$Checksum",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::String,
"Checksum",
5,
)
.with_http_header("x-amz-Checksum");
static PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput$ChecksumAlgorithm",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::String,
"ChecksumAlgorithm",
6,
)
.with_http_header("x-amz-Checksum-Algorithm");
static PUTSNAPSHOTBLOCKINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockInput",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockInput",
),
::aws_smithy_schema::ShapeType::Structure,
&[
&PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_DATA,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM,
&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM,
],
)
.with_http(aws_smithy_schema::traits::HttpTrait::new(
"PUT",
"/snapshots/{SnapshotId}/blocks/{BlockIndex}",
Some(201),
))
.with_no_body_members()
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("PutSnapshotBlockRequest");
impl PutSnapshotBlockInput {
/// The schema for this shape.
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTSNAPSHOTBLOCKINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for PutSnapshotBlockInput {
fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
Self::SCHEMA
}
#[allow(unused_variables, clippy::diverging_sub_expression)]
fn serialize_members(
&self,
ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
if let Some(ref val) = self.snapshot_id {
ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_SNAPSHOT_ID, val)?;
}
if let Some(ref val) = self.block_index {
ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_BLOCK_INDEX, *val)?;
}
if let Some(ref val) = self.data_length {
ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_DATA_LENGTH, *val)?;
}
if let Some(ref val) = self.progress {
ser.write_integer(&PUTSNAPSHOTBLOCKINPUT_MEMBER_PROGRESS, *val)?;
}
if let Some(ref val) = self.checksum {
ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM, val)?;
}
if let Some(ref val) = self.checksum_algorithm {
ser.write_string(&PUTSNAPSHOTBLOCKINPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
}
Ok(())
}
}
impl crate::operation::put_snapshot_block::builders::PutSnapshotBlockInputBuilder {
#[allow(
unused_variables,
unreachable_code,
clippy::single_match,
clippy::match_single_binding,
clippy::diverging_sub_expression
)]
pub(crate) fn deserialize_members(
&mut self,
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
deserializer.read_struct(&PUTSNAPSHOTBLOCKINPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.snapshot_id = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.block_index = Some(deser.read_integer(member)?);
}
}
Some(2) => {
deser.skip_value()?;
}
Some(3) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.data_length = Some(deser.read_integer(member)?);
}
}
Some(4) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.progress = Some(deser.read_integer(member)?);
}
}
Some(5) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.checksum = Some(deser.read_string(member)?);
}
}
Some(6) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
}
}
_ => {}
}
Ok(())
})
}
}
impl PutSnapshotBlockInput {
/// Deserializes this structure from a [`ShapeDeserializer`].
pub fn deserialize(
deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
let mut builder = Self::builder();
builder.deserialize_members(deserializer)?;
builder.snapshot_id = builder.snapshot_id.or(Some(String::new()));
builder.block_index = builder.block_index.or(Some(0i32));
builder.data_length = builder.data_length.or(Some(0i32));
builder.checksum = builder.checksum.or(Some(String::new()));
builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
}
}
impl PutSnapshotBlockInput {
/// Creates a new builder-style object to manufacture [`PutSnapshotBlockInput`](crate::operation::put_snapshot_block::PutSnapshotBlockInput).
pub fn builder() -> crate::operation::put_snapshot_block::builders::PutSnapshotBlockInputBuilder {
crate::operation::put_snapshot_block::builders::PutSnapshotBlockInputBuilder::default()
}
}
/// A builder for [`PutSnapshotBlockInput`](crate::operation::put_snapshot_block::PutSnapshotBlockInput).
#[derive(::std::default::Default)]
#[non_exhaustive]
pub struct PutSnapshotBlockInputBuilder {
pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
pub(crate) block_index: ::std::option::Option<i32>,
pub(crate) block_data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
pub(crate) data_length: ::std::option::Option<i32>,
pub(crate) progress: ::std::option::Option<i32>,
pub(crate) checksum: ::std::option::Option<::std::string::String>,
pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
}
impl PutSnapshotBlockInputBuilder {
/// <p>The ID of the snapshot.</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.</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.</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 write 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 write 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 write 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 data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
/// This field is required.
pub fn block_data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
self.block_data = ::std::option::Option::Some(input);
self
}
/// <p>The data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn set_block_data(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
self.block_data = input;
self
}
/// <p>The data to write to the block.</p>
/// <p>The block data is not signed as part of the Signature Version 4 signing process. As a result, you must generate and provide a Base64-encoded SHA256 checksum for the block data using the <b>x-amz-Checksum</b> header. Also, you must specify the checksum algorithm using the <b>x-amz-Checksum-Algorithm</b> header. The checksum that you provide is part of the Signature Version 4 signing process. It is validated against a checksum generated by Amazon EBS to ensure the validity and authenticity of the data. If the checksums do not correspond, the request fails. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-accessing-snapshot.html#ebsapis-using-checksums"> Using checksums with the EBS direct APIs</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
pub fn get_block_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
&self.block_data
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code></p>
/// This field is required.
pub fn data_length(mut self, input: i32) -> Self {
self.data_length = ::std::option::Option::Some(input);
self
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code></p>
pub fn set_data_length(mut self, input: ::std::option::Option<i32>) -> Self {
self.data_length = input;
self
}
/// <p>The size of the data to write to the block, in bytes. Currently, the only supported size is <code>524288</code> bytes.</p>
/// <p>Valid values: <code>524288</code></p>
pub fn get_data_length(&self) -> &::std::option::Option<i32> {
&self.data_length
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn progress(mut self, input: i32) -> Self {
self.progress = ::std::option::Option::Some(input);
self
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn set_progress(mut self, input: ::std::option::Option<i32>) -> Self {
self.progress = input;
self
}
/// <p>The progress of the write process, as a percentage.</p>
pub fn get_progress(&self) -> &::std::option::Option<i32> {
&self.progress
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
/// This field is required.
pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.checksum = ::std::option::Option::Some(input.into());
self
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.checksum = input;
self
}
/// <p>A Base64-encoded SHA256 checksum of the data. Only SHA256 checksums are supported.</p>
pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
&self.checksum
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
/// This field is required.
pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
self.checksum_algorithm = ::std::option::Option::Some(input);
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
self.checksum_algorithm = input;
self
}
/// <p>The algorithm used to generate the checksum. Currently, the only supported algorithm is <code>SHA256</code>.</p>
pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
&self.checksum_algorithm
}
/// Consumes the builder and constructs a [`PutSnapshotBlockInput`](crate::operation::put_snapshot_block::PutSnapshotBlockInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_snapshot_block::PutSnapshotBlockInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_snapshot_block::PutSnapshotBlockInput {
snapshot_id: self.snapshot_id,
block_index: self.block_index,
block_data: self.block_data.unwrap_or_default(),
data_length: self.data_length,
progress: self.progress,
checksum: self.checksum,
checksum_algorithm: self.checksum_algorithm,
})
}
}
impl ::std::fmt::Debug for PutSnapshotBlockInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("PutSnapshotBlockInputBuilder");
formatter.field("snapshot_id", &self.snapshot_id);
formatter.field("block_index", &self.block_index);
formatter.field("block_data", &"*** Sensitive Data Redacted ***");
formatter.field("data_length", &self.data_length);
formatter.field("progress", &self.progress);
formatter.field("checksum", &self.checksum);
formatter.field("checksum_algorithm", &self.checksum_algorithm);
formatter.finish()
}
}