aws-sdk-ebs 0.0.24-alpha

AWS SDK for Amazon Elastic Block Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn deser_payload_get_snapshot_block_get_snapshot_block_output_block_data(
    body: &mut aws_smithy_http::body::SdkBody,
) -> std::result::Result<
    aws_smithy_http::byte_stream::ByteStream,
    crate::error::GetSnapshotBlockError,
> {
    // replace the body with an empty body
    let body = std::mem::replace(body, aws_smithy_http::body::SdkBody::taken());
    Ok(aws_smithy_http::byte_stream::ByteStream::new(body))
}

pub fn deser_header_get_snapshot_block_get_snapshot_block_output_checksum(
    header_map: &http::HeaderMap,
) -> std::result::Result<
    std::option::Option<std::string::String>,
    aws_smithy_http::header::ParseError,
> {
    let headers = header_map.get_all("x-amz-Checksum").iter();
    aws_smithy_http::header::one_or_none(headers)
}

pub fn deser_header_get_snapshot_block_get_snapshot_block_output_checksum_algorithm(
    header_map: &http::HeaderMap,
) -> std::result::Result<
    std::option::Option<crate::model::ChecksumAlgorithm>,
    aws_smithy_http::header::ParseError,
> {
    let headers = header_map.get_all("x-amz-Checksum-Algorithm").iter();
    aws_smithy_http::header::one_or_none(headers)
}

pub fn deser_header_get_snapshot_block_get_snapshot_block_output_data_length(
    header_map: &http::HeaderMap,
) -> std::result::Result<std::option::Option<i32>, aws_smithy_http::header::ParseError> {
    let headers = header_map.get_all("x-amz-Data-Length").iter();
    let var_1 = aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
    if var_1.len() > 1 {
        Err(aws_smithy_http::header::ParseError::new_with_message(
            format!("expected one item but found {}", var_1.len()),
        ))
    } else {
        let mut var_1 = var_1;
        Ok(var_1.pop())
    }
}

pub fn deser_header_put_snapshot_block_put_snapshot_block_output_checksum(
    header_map: &http::HeaderMap,
) -> std::result::Result<
    std::option::Option<std::string::String>,
    aws_smithy_http::header::ParseError,
> {
    let headers = header_map.get_all("x-amz-Checksum").iter();
    aws_smithy_http::header::one_or_none(headers)
}

pub fn deser_header_put_snapshot_block_put_snapshot_block_output_checksum_algorithm(
    header_map: &http::HeaderMap,
) -> std::result::Result<
    std::option::Option<crate::model::ChecksumAlgorithm>,
    aws_smithy_http::header::ParseError,
> {
    let headers = header_map.get_all("x-amz-Checksum-Algorithm").iter();
    aws_smithy_http::header::one_or_none(headers)
}