#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Content {
pub data: ::std::string::String,
pub charset: ::std::option::Option<::std::string::String>,
}
impl Content {
pub fn data(&self) -> &str {
use std::ops::Deref;
self.data.deref()
}
pub fn charset(&self) -> ::std::option::Option<&str> {
self.charset.as_deref()
}
}
impl Content {
pub fn builder() -> crate::types::builders::ContentBuilder {
crate::types::builders::ContentBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ContentBuilder {
pub(crate) data: ::std::option::Option<::std::string::String>,
pub(crate) charset: ::std::option::Option<::std::string::String>,
}
impl ContentBuilder {
pub fn data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.data = ::std::option::Option::Some(input.into());
self
}
pub fn set_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.data = input;
self
}
pub fn get_data(&self) -> &::std::option::Option<::std::string::String> {
&self.data
}
pub fn charset(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.charset = ::std::option::Option::Some(input.into());
self
}
pub fn set_charset(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.charset = input;
self
}
pub fn get_charset(&self) -> &::std::option::Option<::std::string::String> {
&self.charset
}
pub fn build(self) -> ::std::result::Result<crate::types::Content, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Content {
data: self.data.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"data",
"data was not specified but it is required when building Content",
)
})?,
charset: self.charset,
})
}
}