pub fn ser_localized_branding_strings(
object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::LocalizedBrandingStrings,
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
{
object.key("browserTabTitle").string(input.browser_tab_title.as_str());
}
{
object.key("welcomeText").string(input.welcome_text.as_str());
}
if let Some(var_1) = &input.login_title {
object.key("loginTitle").string(var_1.as_str());
}
if let Some(var_2) = &input.login_description {
object.key("loginDescription").string(var_2.as_str());
}
if let Some(var_3) = &input.login_button_text {
object.key("loginButtonText").string(var_3.as_str());
}
if let Some(var_4) = &input.contact_link {
object.key("contactLink").string(var_4.as_str());
}
if let Some(var_5) = &input.contact_button_text {
object.key("contactButtonText").string(var_5.as_str());
}
if let Some(var_6) = &input.loading_text {
object.key("loadingText").string(var_6.as_str());
}
Ok(())
}
pub(crate) fn de_localized_branding_strings<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
_value: &'a [u8],
) -> ::std::result::Result<Option<crate::types::LocalizedBrandingStrings>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::types::builders::LocalizedBrandingStringsBuilder::default();
loop {
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
"browserTabTitle" => {
builder = builder.set_browser_tab_title(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"welcomeText" => {
builder = builder.set_welcome_text(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"loginTitle" => {
builder = builder.set_login_title(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"loginDescription" => {
builder = builder.set_login_description(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"loginButtonText" => {
builder = builder.set_login_button_text(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"contactLink" => {
builder = builder.set_contact_link(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"contactButtonText" => {
builder = builder.set_contact_button_text(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"loadingText" => {
builder = builder.set_loading_text(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
_ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
},
other => {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {other:?}"
)))
}
}
}
Ok(Some(
crate::serde_util::localized_branding_strings_correct_errors(builder)
.build()
.map_err(|err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?,
))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}