1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_service<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::Service>, ::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::ServiceBuilder::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 - | "serviceArn" => {
|
19 - | builder = builder.set_service_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 - | "serviceName" => {
|
26 - | builder = builder.set_service_name(
|
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 - | "loadBalancers" => {
|
40 - | builder = builder.set_load_balancers(crate::protocol_serde::shape_load_balancers::de_load_balancers(tokens, _value)?);
|
41 - | }
|
42 - | "serviceRegistries" => {
|
43 - | builder = builder
|
44 - | .set_service_registries(crate::protocol_serde::shape_service_registries::de_service_registries(tokens, _value)?);
|
45 - | }
|
46 - | "status" => {
|
47 - | builder = builder.set_status(
|
48 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
49 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
50 - | .transpose()?,
|
51 - | );
|
52 - | }
|
53 - | "desiredCount" => {
|
54 - | builder = builder.set_desired_count(
|
55 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
56 - | .map(i32::try_from)
|
57 - | .transpose()?,
|
58 - | );
|
59 - | }
|
60 - | "runningCount" => {
|
61 - | builder = builder.set_running_count(
|
62 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
63 - | .map(i32::try_from)
|
64 - | .transpose()?,
|
65 - | );
|
66 - | }
|
67 - | "pendingCount" => {
|
68 - | builder = builder.set_pending_count(
|
69 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
70 - | .map(i32::try_from)
|
71 - | .transpose()?,
|
72 - | );
|
73 - | }
|
74 - | "launchType" => {
|
75 - | builder = builder.set_launch_type(
|
76 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
77 - | .map(|s| s.to_unescaped().map(|u| crate::types::LaunchType::from(u.as_ref())))
|
78 - | .transpose()?,
|
79 - | );
|
80 - | }
|
81 - | "capacityProviderStrategy" => {
|
82 - | builder = builder.set_capacity_provider_strategy(
|
83 - | crate::protocol_serde::shape_capacity_provider_strategy::de_capacity_provider_strategy(tokens, _value)?,
|
84 - | );
|
85 - | }
|
86 - | "platformVersion" => {
|
87 - | builder = builder.set_platform_version(
|
88 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
89 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
90 - | .transpose()?,
|
91 - | );
|
92 - | }
|
93 - | "platformFamily" => {
|
94 - | builder = builder.set_platform_family(
|
95 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
96 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
97 - | .transpose()?,
|
98 - | );
|
99 - | }
|
100 - | "taskDefinition" => {
|
101 - | builder = builder.set_task_definition(
|
102 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
103 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
104 - | .transpose()?,
|
105 - | );
|
106 - | }
|
107 - | "deploymentConfiguration" => {
|
108 - | builder = builder.set_deployment_configuration(
|
109 - | crate::protocol_serde::shape_deployment_configuration::de_deployment_configuration(tokens, _value)?,
|
110 - | );
|
111 - | }
|
112 - | "taskSets" => {
|
113 - | builder = builder.set_task_sets(crate::protocol_serde::shape_task_sets::de_task_sets(tokens, _value)?);
|
114 - | }
|
115 - | "deployments" => {
|
116 - | builder = builder.set_deployments(crate::protocol_serde::shape_deployments::de_deployments(tokens, _value)?);
|
117 - | }
|
118 - | "roleArn" => {
|
119 - | builder = builder.set_role_arn(
|
120 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
121 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
122 - | .transpose()?,
|
123 - | );
|
124 - | }
|
125 - | "events" => {
|
126 - | builder = builder.set_events(crate::protocol_serde::shape_service_events::de_service_events(tokens, _value)?);
|
127 - | }
|
128 - | "createdAt" => {
|
129 - | builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
130 - | tokens.next(),
|
131 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
132 - | )?);
|
133 - | }
|
134 - | "placementConstraints" => {
|
135 - | builder = builder.set_placement_constraints(
|
136 - | crate::protocol_serde::shape_placement_constraints::de_placement_constraints(tokens, _value)?,
|
137 - | );
|
138 - | }
|
139 - | "placementStrategy" => {
|
140 - | builder = builder.set_placement_strategy(crate::protocol_serde::shape_placement_strategies::de_placement_strategies(
|
141 - | tokens, _value,
|
142 - | )?);
|
143 - | }
|
144 - | "networkConfiguration" => {
|
145 - | builder = builder.set_network_configuration(
|
146 - | crate::protocol_serde::shape_network_configuration::de_network_configuration(tokens, _value)?,
|
147 - | );
|
148 - | }
|
149 - | "healthCheckGracePeriodSeconds" => {
|
150 - | builder = builder.set_health_check_grace_period_seconds(
|
151 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
152 - | .map(i32::try_from)
|
153 - | .transpose()?,
|
154 - | );
|
155 - | }
|
156 - | "schedulingStrategy" => {
|
157 - | builder = builder.set_scheduling_strategy(
|
158 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
159 - | .map(|s| s.to_unescaped().map(|u| crate::types::SchedulingStrategy::from(u.as_ref())))
|
160 - | .transpose()?,
|
161 - | );
|
162 - | }
|
163 - | "deploymentController" => {
|
164 - | builder = builder.set_deployment_controller(
|
165 - | crate::protocol_serde::shape_deployment_controller::de_deployment_controller(tokens, _value)?,
|
166 - | );
|
167 - | }
|
168 - | "tags" => {
|
169 - | builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value)?);
|
170 - | }
|
171 - | "createdBy" => {
|
172 - | builder = builder.set_created_by(
|
173 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
174 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
175 - | .transpose()?,
|
176 - | );
|
177 - | }
|
178 - | "enableECSManagedTags" => {
|
179 - | builder = builder.set_enable_ecs_managed_tags(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
180 - | }
|
181 - | "propagateTags" => {
|
182 - | builder = builder.set_propagate_tags(
|
183 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
184 - | .map(|s| s.to_unescaped().map(|u| crate::types::PropagateTags::from(u.as_ref())))
|
185 - | .transpose()?,
|
186 - | );
|
187 - | }
|
188 - | "enableExecuteCommand" => {
|
189 - | builder = builder.set_enable_execute_command(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
190 - | }
|
191 - | "availabilityZoneRebalancing" => {
|
192 - | builder = builder.set_availability_zone_rebalancing(
|
193 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
194 - | .map(|s| s.to_unescaped().map(|u| crate::types::AvailabilityZoneRebalancing::from(u.as_ref())))
|
195 - | .transpose()?,
|
196 - | );
|
197 - | }
|
198 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
199 - | },
|
200 - | other => {
|
201 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
202 - | "expected object key or end object, found: {other:?}"
|
203 - | )))
|
204 - | }
|
205 - | }
|
206 - | }
|
207 - | Ok(Some(builder.build()))
|
208 - | }
|
209 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
210 - | "expected start object or null",
|
211 - | )),
|
212 - | }
|
213 - | }
|