1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_task<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::Task>, ::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::TaskBuilder::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 - | "attachments" => {
|
19 - | builder = builder.set_attachments(crate::protocol_serde::shape_attachments::de_attachments(tokens, _value)?);
|
20 - | }
|
21 - | "attributes" => {
|
22 - | builder = builder.set_attributes(crate::protocol_serde::shape_attributes::de_attributes(tokens, _value)?);
|
23 - | }
|
24 - | "availabilityZone" => {
|
25 - | builder = builder.set_availability_zone(
|
26 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
27 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
28 - | .transpose()?,
|
29 - | );
|
30 - | }
|
31 - | "capacityProviderName" => {
|
32 - | builder = builder.set_capacity_provider_name(
|
33 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
34 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
35 - | .transpose()?,
|
36 - | );
|
37 - | }
|
38 - | "clusterArn" => {
|
39 - | builder = builder.set_cluster_arn(
|
40 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
41 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
42 - | .transpose()?,
|
43 - | );
|
44 - | }
|
45 - | "connectivity" => {
|
46 - | builder = builder.set_connectivity(
|
47 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
48 - | .map(|s| s.to_unescaped().map(|u| crate::types::Connectivity::from(u.as_ref())))
|
49 - | .transpose()?,
|
50 - | );
|
51 - | }
|
52 - | "connectivityAt" => {
|
53 - | builder = builder.set_connectivity_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
54 - | tokens.next(),
|
55 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
56 - | )?);
|
57 - | }
|
58 - | "containerInstanceArn" => {
|
59 - | builder = builder.set_container_instance_arn(
|
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 - | "containers" => {
|
66 - | builder = builder.set_containers(crate::protocol_serde::shape_containers::de_containers(tokens, _value)?);
|
67 - | }
|
68 - | "cpu" => {
|
69 - | builder = builder.set_cpu(
|
70 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
71 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
72 - | .transpose()?,
|
73 - | );
|
74 - | }
|
75 - | "createdAt" => {
|
76 - | builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
77 - | tokens.next(),
|
78 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
79 - | )?);
|
80 - | }
|
81 - | "desiredStatus" => {
|
82 - | builder = builder.set_desired_status(
|
83 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
84 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
85 - | .transpose()?,
|
86 - | );
|
87 - | }
|
88 - | "enableExecuteCommand" => {
|
89 - | builder = builder.set_enable_execute_command(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
90 - | }
|
91 - | "executionStoppedAt" => {
|
92 - | builder = builder.set_execution_stopped_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
93 - | tokens.next(),
|
94 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
95 - | )?);
|
96 - | }
|
97 - | "group" => {
|
98 - | builder = builder.set_group(
|
99 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
100 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
101 - | .transpose()?,
|
102 - | );
|
103 - | }
|
104 - | "healthStatus" => {
|
105 - | builder = builder.set_health_status(
|
106 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
107 - | .map(|s| s.to_unescaped().map(|u| crate::types::HealthStatus::from(u.as_ref())))
|
108 - | .transpose()?,
|
109 - | );
|
110 - | }
|
111 - | "inferenceAccelerators" => {
|
112 - | builder = builder.set_inference_accelerators(
|
113 - | crate::protocol_serde::shape_inference_accelerators::de_inference_accelerators(tokens, _value)?,
|
114 - | );
|
115 - | }
|
116 - | "lastStatus" => {
|
117 - | builder = builder.set_last_status(
|
118 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
119 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
120 - | .transpose()?,
|
121 - | );
|
122 - | }
|
123 - | "launchType" => {
|
124 - | builder = builder.set_launch_type(
|
125 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
126 - | .map(|s| s.to_unescaped().map(|u| crate::types::LaunchType::from(u.as_ref())))
|
127 - | .transpose()?,
|
128 - | );
|
129 - | }
|
130 - | "memory" => {
|
131 - | builder = builder.set_memory(
|
132 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
133 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
134 - | .transpose()?,
|
135 - | );
|
136 - | }
|
137 - | "overrides" => {
|
138 - | builder = builder.set_overrides(crate::protocol_serde::shape_task_override::de_task_override(tokens, _value)?);
|
139 - | }
|
140 - | "platformVersion" => {
|
141 - | builder = builder.set_platform_version(
|
142 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
143 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
144 - | .transpose()?,
|
145 - | );
|
146 - | }
|
147 - | "platformFamily" => {
|
148 - | builder = builder.set_platform_family(
|
149 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
150 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
151 - | .transpose()?,
|
152 - | );
|
153 - | }
|
154 - | "pullStartedAt" => {
|
155 - | builder = builder.set_pull_started_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
156 - | tokens.next(),
|
157 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
158 - | )?);
|
159 - | }
|
160 - | "pullStoppedAt" => {
|
161 - | builder = builder.set_pull_stopped_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
162 - | tokens.next(),
|
163 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
164 - | )?);
|
165 - | }
|
166 - | "startedAt" => {
|
167 - | builder = builder.set_started_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
168 - | tokens.next(),
|
169 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
170 - | )?);
|
171 - | }
|
172 - | "startedBy" => {
|
173 - | builder = builder.set_started_by(
|
174 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
175 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
176 - | .transpose()?,
|
177 - | );
|
178 - | }
|
179 - | "stopCode" => {
|
180 - | builder = builder.set_stop_code(
|
181 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
182 - | .map(|s| s.to_unescaped().map(|u| crate::types::TaskStopCode::from(u.as_ref())))
|
183 - | .transpose()?,
|
184 - | );
|
185 - | }
|
186 - | "stoppedAt" => {
|
187 - | builder = builder.set_stopped_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
188 - | tokens.next(),
|
189 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
190 - | )?);
|
191 - | }
|
192 - | "stoppedReason" => {
|
193 - | builder = builder.set_stopped_reason(
|
194 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
195 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
196 - | .transpose()?,
|
197 - | );
|
198 - | }
|
199 - | "stoppingAt" => {
|
200 - | builder = builder.set_stopping_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
201 - | tokens.next(),
|
202 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
203 - | )?);
|
204 - | }
|
205 - | "tags" => {
|
206 - | builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value)?);
|
207 - | }
|
208 - | "taskArn" => {
|
209 - | builder = builder.set_task_arn(
|
210 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
211 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
212 - | .transpose()?,
|
213 - | );
|
214 - | }
|
215 - | "taskDefinitionArn" => {
|
216 - | builder = builder.set_task_definition_arn(
|
217 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
218 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
219 - | .transpose()?,
|
220 - | );
|
221 - | }
|
222 - | "version" => {
|
223 - | builder = builder.set_version(
|
224 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
225 - | .map(i64::try_from)
|
226 - | .transpose()?,
|
227 - | );
|
228 - | }
|
229 - | "ephemeralStorage" => {
|
230 - | builder =
|
231 - | builder.set_ephemeral_storage(crate::protocol_serde::shape_ephemeral_storage::de_ephemeral_storage(tokens, _value)?);
|
232 - | }
|
233 - | "fargateEphemeralStorage" => {
|
234 - | builder = builder.set_fargate_ephemeral_storage(
|
235 - | crate::protocol_serde::shape_task_ephemeral_storage::de_task_ephemeral_storage(tokens, _value)?,
|
236 - | );
|
237 - | }
|
238 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
239 - | },
|
240 - | other => {
|
241 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
242 - | "expected object key or end object, found: {other:?}"
|
243 - | )))
|
244 - | }
|
245 - | }
|
246 - | }
|
247 - | Ok(Some(builder.build()))
|
248 - | }
|
249 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
250 - | "expected start object or null",
|
251 - | )),
|
252 - | }
|
253 - | }
|