#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub struct GetChunkOutput {
pub data: ::aws_smithy_types::byte_stream::ByteStream,
pub length: i64,
pub checksum: ::std::string::String,
pub checksum_algorithm: crate::types::DataChecksumAlgorithm,
_request_id: Option<String>,
}
impl GetChunkOutput {
pub fn data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
&self.data
}
pub fn length(&self) -> i64 {
self.length
}
pub fn checksum(&self) -> &str {
use std::ops::Deref;
self.checksum.deref()
}
pub fn checksum_algorithm(&self) -> &crate::types::DataChecksumAlgorithm {
&self.checksum_algorithm
}
}
impl ::aws_types::request_id::RequestId for GetChunkOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetChunkOutput {
pub fn builder() -> crate::operation::get_chunk::builders::GetChunkOutputBuilder {
crate::operation::get_chunk::builders::GetChunkOutputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::default::Default, ::std::fmt::Debug)]
pub struct GetChunkOutputBuilder {
pub(crate) data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
pub(crate) length: ::std::option::Option<i64>,
pub(crate) checksum: ::std::option::Option<::std::string::String>,
pub(crate) checksum_algorithm: ::std::option::Option<crate::types::DataChecksumAlgorithm>,
_request_id: Option<String>,
}
impl GetChunkOutputBuilder {
pub fn data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
self.data = ::std::option::Option::Some(input);
self
}
pub fn set_data(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
self.data = input;
self
}
pub fn get_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
&self.data
}
pub fn length(mut self, input: i64) -> Self {
self.length = ::std::option::Option::Some(input);
self
}
pub fn set_length(mut self, input: ::std::option::Option<i64>) -> Self {
self.length = input;
self
}
pub fn get_length(&self) -> &::std::option::Option<i64> {
&self.length
}
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::DataChecksumAlgorithm) -> Self {
self.checksum_algorithm = ::std::option::Option::Some(input);
self
}
pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::DataChecksumAlgorithm>) -> Self {
self.checksum_algorithm = input;
self
}
pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::DataChecksumAlgorithm> {
&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) -> ::std::result::Result<crate::operation::get_chunk::GetChunkOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_chunk::GetChunkOutput {
data: self.data.unwrap_or_default(),
length: self.length.unwrap_or_default(),
checksum: self.checksum.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"checksum",
"checksum was not specified but it is required when building GetChunkOutput",
)
})?,
checksum_algorithm: self.checksum_algorithm.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"checksum_algorithm",
"checksum_algorithm was not specified but it is required when building GetChunkOutput",
)
})?,
_request_id: self._request_id,
})
}
}