1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_task_set<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::TaskSet>, ::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::TaskSetBuilder::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 - | "id" => {
|
19 - | builder = builder.set_id(
|
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 - | "taskSetArn" => {
|
26 - | builder = builder.set_task_set_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 - | "serviceArn" => {
|
33 - | builder = builder.set_service_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 - | "clusterArn" => {
|
40 - | builder = builder.set_cluster_arn(
|
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 - | "startedBy" => {
|
47 - | builder = builder.set_started_by(
|
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 - | "externalId" => {
|
54 - | builder = builder.set_external_id(
|
55 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
56 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
57 - | .transpose()?,
|
58 - | );
|
59 - | }
|
60 - | "status" => {
|
61 - | builder = builder.set_status(
|
62 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
63 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
64 - | .transpose()?,
|
65 - | );
|
66 - | }
|
67 - | "taskDefinition" => {
|
68 - | builder = builder.set_task_definition(
|
69 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
70 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
71 - | .transpose()?,
|
72 - | );
|
73 - | }
|
74 - | "computedDesiredCount" => {
|
75 - | builder = builder.set_computed_desired_count(
|
76 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
77 - | .map(i32::try_from)
|
78 - | .transpose()?,
|
79 - | );
|
80 - | }
|
81 - | "pendingCount" => {
|
82 - | builder = builder.set_pending_count(
|
83 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
84 - | .map(i32::try_from)
|
85 - | .transpose()?,
|
86 - | );
|
87 - | }
|
88 - | "runningCount" => {
|
89 - | builder = builder.set_running_count(
|
90 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
91 - | .map(i32::try_from)
|
92 - | .transpose()?,
|
93 - | );
|
94 - | }
|
95 - | "createdAt" => {
|
96 - | builder = builder.set_created_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
97 - | tokens.next(),
|
98 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
99 - | )?);
|
100 - | }
|
101 - | "updatedAt" => {
|
102 - | builder = builder.set_updated_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
103 - | tokens.next(),
|
104 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
105 - | )?);
|
106 - | }
|
107 - | "launchType" => {
|
108 - | builder = builder.set_launch_type(
|
109 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
110 - | .map(|s| s.to_unescaped().map(|u| crate::types::LaunchType::from(u.as_ref())))
|
111 - | .transpose()?,
|
112 - | );
|
113 - | }
|
114 - | "capacityProviderStrategy" => {
|
115 - | builder = builder.set_capacity_provider_strategy(
|
116 - | crate::protocol_serde::shape_capacity_provider_strategy::de_capacity_provider_strategy(tokens, _value)?,
|
117 - | );
|
118 - | }
|
119 - | "platformVersion" => {
|
120 - | builder = builder.set_platform_version(
|
121 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
122 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
123 - | .transpose()?,
|
124 - | );
|
125 - | }
|
126 - | "platformFamily" => {
|
127 - | builder = builder.set_platform_family(
|
128 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
129 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
130 - | .transpose()?,
|
131 - | );
|
132 - | }
|
133 - | "networkConfiguration" => {
|
134 - | builder = builder.set_network_configuration(
|
135 - | crate::protocol_serde::shape_network_configuration::de_network_configuration(tokens, _value)?,
|
136 - | );
|
137 - | }
|
138 - | "loadBalancers" => {
|
139 - | builder = builder.set_load_balancers(crate::protocol_serde::shape_load_balancers::de_load_balancers(tokens, _value)?);
|
140 - | }
|
141 - | "serviceRegistries" => {
|
142 - | builder = builder
|
143 - | .set_service_registries(crate::protocol_serde::shape_service_registries::de_service_registries(tokens, _value)?);
|
144 - | }
|
145 - | "scale" => {
|
146 - | builder = builder.set_scale(crate::protocol_serde::shape_scale::de_scale(tokens, _value)?);
|
147 - | }
|
148 - | "stabilityStatus" => {
|
149 - | builder = builder.set_stability_status(
|
150 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
151 - | .map(|s| s.to_unescaped().map(|u| crate::types::StabilityStatus::from(u.as_ref())))
|
152 - | .transpose()?,
|
153 - | );
|
154 - | }
|
155 - | "stabilityStatusAt" => {
|
156 - | builder = builder.set_stability_status_at(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
157 - | tokens.next(),
|
158 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
159 - | )?);
|
160 - | }
|
161 - | "tags" => {
|
162 - | builder = builder.set_tags(crate::protocol_serde::shape_tags::de_tags(tokens, _value)?);
|
163 - | }
|
164 - | "fargateEphemeralStorage" => {
|
165 - | builder = builder.set_fargate_ephemeral_storage(
|
166 - | crate::protocol_serde::shape_deployment_ephemeral_storage::de_deployment_ephemeral_storage(tokens, _value)?,
|
167 - | );
|
168 - | }
|
169 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
170 - | },
|
171 - | other => {
|
172 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
173 - | "expected object key or end object, found: {other:?}"
|
174 - | )))
|
175 - | }
|
176 - | }
|
177 - | }
|
178 - | Ok(Some(builder.build()))
|
179 - | }
|
180 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
181 - | "expected start object or null",
|
182 - | )),
|
183 - | }
|
184 - | }
|