aws-sdk-ebs 1.98.0

AWS SDK for Amazon Elastic Block Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
pub struct GetSnapshotBlockOutput {
    /// <p>The size of the data in the block.</p>
    pub data_length: ::std::option::Option<i32>,
    /// <p>The data content of the block.</p>
    pub block_data: ::aws_smithy_types::byte_stream::ByteStream,
    /// <p>The checksum generated for the block, which is Base64 encoded.</p>
    pub checksum: ::std::option::Option<::std::string::String>,
    /// <p>The algorithm used to generate the checksum for the block, such as SHA256.</p>
    pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
    _request_id: Option<String>,
}
impl GetSnapshotBlockOutput {
    /// <p>The size of the data in the block.</p>
    pub fn data_length(&self) -> ::std::option::Option<i32> {
        self.data_length
    }
    /// <p>The data content of the block.</p>
    pub fn block_data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
        &self.block_data
    }
    /// <p>The checksum generated for the block, which is Base64 encoded.</p>
    pub fn checksum(&self) -> ::std::option::Option<&str> {
        self.checksum.as_deref()
    }
    /// <p>The algorithm used to generate the checksum for the block, such as SHA256.</p>
    pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
        self.checksum_algorithm.as_ref()
    }
}
impl ::std::fmt::Debug for GetSnapshotBlockOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSnapshotBlockOutput");
        formatter.field("data_length", &self.data_length);
        formatter.field("block_data", &"*** Sensitive Data Redacted ***");
        formatter.field("checksum", &self.checksum);
        formatter.field("checksum_algorithm", &self.checksum_algorithm);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetSnapshotBlockOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSnapshotBlockOutput {
    /// Creates a new builder-style object to manufacture [`GetSnapshotBlockOutput`](crate::operation::get_snapshot_block::GetSnapshotBlockOutput).
    pub fn builder() -> crate::operation::get_snapshot_block::builders::GetSnapshotBlockOutputBuilder {
        crate::operation::get_snapshot_block::builders::GetSnapshotBlockOutputBuilder::default()
    }
}

/// A builder for [`GetSnapshotBlockOutput`](crate::operation::get_snapshot_block::GetSnapshotBlockOutput).
#[derive(::std::default::Default)]
#[non_exhaustive]
pub struct GetSnapshotBlockOutputBuilder {
    pub(crate) data_length: ::std::option::Option<i32>,
    pub(crate) block_data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
    pub(crate) checksum: ::std::option::Option<::std::string::String>,
    pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
    _request_id: Option<String>,
}
impl GetSnapshotBlockOutputBuilder {
    /// <p>The size of the data in the block.</p>
    pub fn data_length(mut self, input: i32) -> Self {
        self.data_length = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size of the data in the block.</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 in the block.</p>
    pub fn get_data_length(&self) -> &::std::option::Option<i32> {
        &self.data_length
    }
    /// <p>The data content of the block.</p>
    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 content of the block.</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 content of the block.</p>
    pub fn get_block_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
        &self.block_data
    }
    /// <p>The checksum generated for the block, which is Base64 encoded.</p>
    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.checksum = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The checksum generated for the block, which is Base64 encoded.</p>
    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.checksum = input;
        self
    }
    /// <p>The checksum generated for the block, which is Base64 encoded.</p>
    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
        &self.checksum
    }
    /// <p>The algorithm used to generate the checksum for the block, such as SHA256.</p>
    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 for the block, such as SHA256.</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 for the block, such as SHA256.</p>
    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::ChecksumAlgorithm> {
        &self.checksum_algorithm
    }
    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 [`GetSnapshotBlockOutput`](crate::operation::get_snapshot_block::GetSnapshotBlockOutput).
    pub fn build(self) -> crate::operation::get_snapshot_block::GetSnapshotBlockOutput {
        crate::operation::get_snapshot_block::GetSnapshotBlockOutput {
            data_length: self.data_length,
            block_data: self.block_data.unwrap_or_default(),
            checksum: self.checksum,
            checksum_algorithm: self.checksum_algorithm,
            _request_id: self._request_id,
        }
    }
}
impl ::std::fmt::Debug for GetSnapshotBlockOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSnapshotBlockOutputBuilder");
        formatter.field("data_length", &self.data_length);
        formatter.field("block_data", &"*** Sensitive Data Redacted ***");
        formatter.field("checksum", &self.checksum);
        formatter.field("checksum_algorithm", &self.checksum_algorithm);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}