#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SigningImageFormat {
pub supported_formats: ::std::vec::Vec<crate::types::ImageFormat>,
pub default_format: crate::types::ImageFormat,
}
impl SigningImageFormat {
pub fn supported_formats(&self) -> &[crate::types::ImageFormat] {
use std::ops::Deref;
self.supported_formats.deref()
}
pub fn default_format(&self) -> &crate::types::ImageFormat {
&self.default_format
}
}
impl SigningImageFormat {
pub fn builder() -> crate::types::builders::SigningImageFormatBuilder {
crate::types::builders::SigningImageFormatBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SigningImageFormatBuilder {
pub(crate) supported_formats: ::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>>,
pub(crate) default_format: ::std::option::Option<crate::types::ImageFormat>,
}
impl SigningImageFormatBuilder {
pub fn supported_formats(mut self, input: crate::types::ImageFormat) -> Self {
let mut v = self.supported_formats.unwrap_or_default();
v.push(input);
self.supported_formats = ::std::option::Option::Some(v);
self
}
pub fn set_supported_formats(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>>) -> Self {
self.supported_formats = input;
self
}
pub fn get_supported_formats(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ImageFormat>> {
&self.supported_formats
}
pub fn default_format(mut self, input: crate::types::ImageFormat) -> Self {
self.default_format = ::std::option::Option::Some(input);
self
}
pub fn set_default_format(mut self, input: ::std::option::Option<crate::types::ImageFormat>) -> Self {
self.default_format = input;
self
}
pub fn get_default_format(&self) -> &::std::option::Option<crate::types::ImageFormat> {
&self.default_format
}
pub fn build(self) -> ::std::result::Result<crate::types::SigningImageFormat, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::SigningImageFormat {
supported_formats: self.supported_formats.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"supported_formats",
"supported_formats was not specified but it is required when building SigningImageFormat",
)
})?,
default_format: self.default_format.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"default_format",
"default_format was not specified but it is required when building SigningImageFormat",
)
})?,
})
}
}