1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_service_revision<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::ServiceRevision>, ::aws_smithy_json::deserialize::error::DeserializeError>
|
6 - | where
|
7 - | I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
|
8 - | {
|
9 - | match tokens.next().transpose()? {
|
10 - | Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
|
11 - | Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
|
12 - | #[allow(unused_mut)]
|
13 - | let mut builder = crate::types::builders::ServiceRevisionBuilder::default();
|
14 - | loop {
|
15 - | match tokens.next().transpose()? {
|
16 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
17 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
18 - | "serviceRevisionArn" => {
|
19 - | builder = builder.set_service_revision_arn(
|
20 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
21 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
22 - | .transpose()?,
|
23 - | );
|
24 - | }
|
25 - | "serviceArn" => {
|
26 - | builder = builder.set_service_arn(
|
27 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
28 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
29 - | .transpose()?,
|
30 - | );
|
31 - | }
|
32 - | "clusterArn" => {
|
33 - | builder = builder.set_cluster_arn(
|
34 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
35 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
36 - | .transpose()?,
|
37 - | );
|
38 - | }
|
39 - | "taskDefinition" => {
|
40 - | builder = builder.set_task_definition(
|
41 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
42 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
43 - | .transpose()?,
|
44 - | );
|
45 - | }
|
46 - | "capacityProviderStrategy" => {
|
47 - | builder = builder.set_capacity_provider_strategy(
|
48 - | crate::protocol_serde::shape_capacity_provider_strategy::de_capacity_provider_strategy(tokens, _value)?,
|
49 - | );
|
50 - | }
|
51 - | "launchType" => {
|
52 - | builder = builder.set_launch_type(
|
53 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
54 - | .map(|s| s.to_unescaped().map(|u| crate::types::LaunchType::from(u.as_ref())))
|
55 - | .transpose()?,
|
56 - | );
|
57 - | }
|
58 - | "platformVersion" => {
|
59 - | builder = builder.set_platform_version(
|
60 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
61 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
62 - | .transpose()?,
|
63 - | );
|
64 - | }
|
65 - | "platformFamily" => {
|
66 - | builder = builder.set_platform_family(
|
67 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
68 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
69 - | .transpose()?,
|
70 - | );
|
71 - | }
|
72 - | "loadBalancers" => {
|
73 - | builder = builder.set_load_balancers(crate::protocol_serde::shape_load_balancers::de_load_balancers(tokens, _value)?);
|
74 - | }
|
75 - | "serviceRegistries" => {
|
76 - | builder = builder
|
77 - | .set_service_registries(crate::protocol_serde::shape_service_registries::de_service_registries(tokens, _value)?);
|
78 - | }
|
79 - | "networkConfiguration" => {
|
80 - | builder = builder.set_network_configuration(
|
81 - | crate::protocol_serde::shape_network_configuration::de_network_configuration(tokens, _value)?,
|
82 - | );
|
83 - | }
|
84 - | "containerImages" => {
|
85 - | builder =
|
86 - | builder.set_container_images(crate::protocol_serde::shape_container_images::de_container_images(tokens, _value)?);
|
87 - | }
|
88 - | "guardDutyEnabled" => {
|
89 - | builder = builder.set_guard_duty_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
90 - | }
|
91 - | "serviceConnectConfiguration" => {
|
92 - | builder = builder.set_service_connect_configuration(
|
93 - | crate::protocol_serde::shape_service_connect_configuration::de_service_connect_configuration(tokens, _value)?,
|
94 - | );
|
95 - | }
|
96 - | "volumeConfigurations" => {
|
97 - | builder = builder.set_volume_configurations(
|
98 - | crate::protocol_serde::shape_service_volume_configurations::de_service_volume_configurations(tokens, _value)?,
|
99 - | );
|
100 - | }
|
101 - | "fargateEphemeralStorage" => {
|
102 - | builder = builder.set_fargate_ephemeral_storage(
|
103 - | crate::protocol_serde::shape_deployment_ephemeral_storage::de_deployment_ephemeral_storage(tokens, _value)?,
|
104 - | );
|
105 - | }
|
106 - | "createdAt" => {
|
107 - | builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
108 - | tokens.next(),
|
109 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
110 - | )?);
|
111 - | }
|
112 - | "vpcLatticeConfigurations" => {
|
113 - | builder = builder.set_vpc_lattice_configurations(
|
114 - | crate::protocol_serde::shape_vpc_lattice_configurations::de_vpc_lattice_configurations(tokens, _value)?,
|
115 - | );
|
116 - | }
|
117 - | "resolvedConfiguration" => {
|
118 - | builder = builder.set_resolved_configuration(
|
119 - | crate::protocol_serde::shape_resolved_configuration::de_resolved_configuration(tokens, _value)?,
|
120 - | );
|
121 - | }
|
122 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
123 - | },
|
124 - | other => {
|
125 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
126 - | "expected object key or end object, found: {other:?}"
|
127 - | )))
|
128 - | }
|
129 - | }
|
130 - | }
|
131 - | Ok(Some(builder.build()))
|
132 - | }
|
133 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
134 - | "expected start object or null",
|
135 - | )),
|
136 - | }
|
137 - | }
|