pub(crate) fn de_workspace_description<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::WorkspaceDescription>, ::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::WorkspaceDescriptionBuilder::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() {
"accountAccessType" => {
builder = builder.set_account_access_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::AccountAccessType::from(u.as_ref())))
.transpose()?,
);
}
"created" => {
builder = builder.set_created(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"dataSources" => {
builder =
builder.set_data_sources(crate::protocol_serde::shape_data_source_types_list::de_data_source_types_list(tokens)?);
}
"description" => {
builder = builder.set_description(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"endpoint" => {
builder = builder.set_endpoint(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"grafanaVersion" => {
builder = builder.set_grafana_version(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"id" => {
builder = builder.set_id(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"modified" => {
builder = builder.set_modified(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"name" => {
builder = builder.set_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"organizationRoleName" => {
builder = builder.set_organization_role_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"notificationDestinations" => {
builder = builder.set_notification_destinations(
crate::protocol_serde::shape_notification_destinations_list::de_notification_destinations_list(tokens)?,
);
}
"organizationalUnits" => {
builder = builder.set_organizational_units(
crate::protocol_serde::shape_organizational_unit_list::de_organizational_unit_list(tokens)?,
);
}
"permissionType" => {
builder = builder.set_permission_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::PermissionType::from(u.as_ref())))
.transpose()?,
);
}
"stackSetName" => {
builder = builder.set_stack_set_name(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"status" => {
builder = builder.set_status(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::WorkspaceStatus::from(u.as_ref())))
.transpose()?,
);
}
"workspaceRoleArn" => {
builder = builder.set_workspace_role_arn(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"licenseType" => {
builder = builder.set_license_type(
::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
.map(|s| s.to_unescaped().map(|u| crate::types::LicenseType::from(u.as_ref())))
.transpose()?,
);
}
"freeTrialConsumed" => {
builder = builder.set_free_trial_consumed(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
}
"licenseExpiration" => {
builder = builder.set_license_expiration(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"freeTrialExpiration" => {
builder = builder.set_free_trial_expiration(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
tokens.next(),
::aws_smithy_types::date_time::Format::EpochSeconds,
)?);
}
"authentication" => {
builder =
builder.set_authentication(crate::protocol_serde::shape_authentication_summary::de_authentication_summary(tokens)?);
}
"tags" => {
builder = builder.set_tags(crate::protocol_serde::shape_tag_map::de_tag_map(tokens)?);
}
"vpcConfiguration" => {
builder = builder.set_vpc_configuration(crate::protocol_serde::shape_vpc_configuration::de_vpc_configuration(tokens)?);
}
"networkAccessControl" => {
builder = builder.set_network_access_control(
crate::protocol_serde::shape_network_access_configuration::de_network_access_configuration(tokens)?,
);
}
_ => ::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(builder.build()))
}
_ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
)),
}
}