#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutSnapshotBlockOutput {
pub checksum: ::std::option::Option<::std::string::String>,
pub checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
_request_id: Option<String>,
}
impl PutSnapshotBlockOutput {
pub fn checksum(&self) -> ::std::option::Option<&str> {
self.checksum.as_deref()
}
pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> {
self.checksum_algorithm.as_ref()
}
}
static PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockOutput$Checksum",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockOutput",
),
::aws_smithy_schema::ShapeType::String,
"Checksum",
0,
)
.with_http_header("x-amz-Checksum");
static PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockOutput$ChecksumAlgorithm",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockOutput",
),
::aws_smithy_schema::ShapeType::String,
"ChecksumAlgorithm",
1,
)
.with_http_header("x-amz-Checksum-Algorithm");
static PUTSNAPSHOTBLOCKOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
::aws_smithy_schema::ShapeId::from_parts(
"com.amazonaws.ebs.synthetic#PutSnapshotBlockOutput",
"com.amazonaws.ebs.synthetic",
"PutSnapshotBlockOutput",
),
::aws_smithy_schema::ShapeType::Structure,
&[&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM, &PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM],
)
.with_original_name("PutSnapshotBlockResponse");
impl PutSnapshotBlockOutput {
pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PUTSNAPSHOTBLOCKOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for PutSnapshotBlockOutput {
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.checksum {
ser.write_string(&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM, val)?;
}
if let Some(ref val) = self.checksum_algorithm {
ser.write_string(&PUTSNAPSHOTBLOCKOUTPUT_MEMBER_CHECKSUM_ALGORITHM, val.as_str())?;
}
Ok(())
}
}
impl crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder {
#[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(&PUTSNAPSHOTBLOCKOUTPUT_SCHEMA, &mut |member, deser| {
match member.member_index() {
Some(0) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.checksum = Some(deser.read_string(member)?);
}
}
Some(1) => {
if deser.is_null() {
deser.read_null()?;
} else {
self.checksum_algorithm = Some(crate::types::ChecksumAlgorithm::from(deser.read_string(member)?.as_str()));
}
}
_ => {}
}
Ok(())
})
}
}
impl PutSnapshotBlockOutput {
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)?;
Ok(builder.build())
}
}
impl ::aws_types::request_id::RequestId for PutSnapshotBlockOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl PutSnapshotBlockOutput {
pub fn builder() -> crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder {
crate::operation::put_snapshot_block::builders::PutSnapshotBlockOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutSnapshotBlockOutputBuilder {
pub(crate) checksum: ::std::option::Option<::std::string::String>,
pub(crate) checksum_algorithm: ::std::option::Option<crate::types::ChecksumAlgorithm>,
_request_id: Option<String>,
}
impl PutSnapshotBlockOutputBuilder {
pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.checksum = ::std::option::Option::Some(input.into());
self
}
pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.checksum = input;
self
}
pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
&self.checksum
}
pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self {
self.checksum_algorithm = ::std::option::Option::Some(input);
self
}
pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::ChecksumAlgorithm>) -> Self {
self.checksum_algorithm = input;
self
}
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
}
pub fn build(self) -> crate::operation::put_snapshot_block::PutSnapshotBlockOutput {
crate::operation::put_snapshot_block::PutSnapshotBlockOutput {
checksum: self.checksum,
checksum_algorithm: self.checksum_algorithm,
_request_id: self._request_id,
}
}
}