#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BackupObject {
pub name: ::std::string::String,
pub chunks_count: ::std::option::Option<i64>,
pub metadata_string: ::std::option::Option<::std::string::String>,
pub object_checksum: ::std::string::String,
pub object_checksum_algorithm: crate::types::SummaryChecksumAlgorithm,
pub object_token: ::std::string::String,
}
impl BackupObject {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn chunks_count(&self) -> ::std::option::Option<i64> {
self.chunks_count
}
pub fn metadata_string(&self) -> ::std::option::Option<&str> {
self.metadata_string.as_deref()
}
pub fn object_checksum(&self) -> &str {
use std::ops::Deref;
self.object_checksum.deref()
}
pub fn object_checksum_algorithm(&self) -> &crate::types::SummaryChecksumAlgorithm {
&self.object_checksum_algorithm
}
pub fn object_token(&self) -> &str {
use std::ops::Deref;
self.object_token.deref()
}
}
impl BackupObject {
pub fn builder() -> crate::types::builders::BackupObjectBuilder {
crate::types::builders::BackupObjectBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct BackupObjectBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) chunks_count: ::std::option::Option<i64>,
pub(crate) metadata_string: ::std::option::Option<::std::string::String>,
pub(crate) object_checksum: ::std::option::Option<::std::string::String>,
pub(crate) object_checksum_algorithm: ::std::option::Option<crate::types::SummaryChecksumAlgorithm>,
pub(crate) object_token: ::std::option::Option<::std::string::String>,
}
impl BackupObjectBuilder {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn chunks_count(mut self, input: i64) -> Self {
self.chunks_count = ::std::option::Option::Some(input);
self
}
pub fn set_chunks_count(mut self, input: ::std::option::Option<i64>) -> Self {
self.chunks_count = input;
self
}
pub fn get_chunks_count(&self) -> &::std::option::Option<i64> {
&self.chunks_count
}
pub fn metadata_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.metadata_string = ::std::option::Option::Some(input.into());
self
}
pub fn set_metadata_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.metadata_string = input;
self
}
pub fn get_metadata_string(&self) -> &::std::option::Option<::std::string::String> {
&self.metadata_string
}
pub fn object_checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.object_checksum = ::std::option::Option::Some(input.into());
self
}
pub fn set_object_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.object_checksum = input;
self
}
pub fn get_object_checksum(&self) -> &::std::option::Option<::std::string::String> {
&self.object_checksum
}
pub fn object_checksum_algorithm(mut self, input: crate::types::SummaryChecksumAlgorithm) -> Self {
self.object_checksum_algorithm = ::std::option::Option::Some(input);
self
}
pub fn set_object_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::SummaryChecksumAlgorithm>) -> Self {
self.object_checksum_algorithm = input;
self
}
pub fn get_object_checksum_algorithm(&self) -> &::std::option::Option<crate::types::SummaryChecksumAlgorithm> {
&self.object_checksum_algorithm
}
pub fn object_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.object_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_object_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.object_token = input;
self
}
pub fn get_object_token(&self) -> &::std::option::Option<::std::string::String> {
&self.object_token
}
pub fn build(self) -> ::std::result::Result<crate::types::BackupObject, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::BackupObject {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building BackupObject",
)
})?,
chunks_count: self.chunks_count,
metadata_string: self.metadata_string,
object_checksum: self.object_checksum.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"object_checksum",
"object_checksum was not specified but it is required when building BackupObject",
)
})?,
object_checksum_algorithm: self.object_checksum_algorithm.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"object_checksum_algorithm",
"object_checksum_algorithm was not specified but it is required when building BackupObject",
)
})?,
object_token: self.object_token.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"object_token",
"object_token was not specified but it is required when building BackupObject",
)
})?,
})
}
}