1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_get_function_configuration_http_error(
|
4 - | _response_status: u16,
|
5 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 - | _response_body: &[u8],
|
7 - | ) -> std::result::Result<
|
8 - | crate::operation::get_function_configuration::GetFunctionConfigurationOutput,
|
9 - | crate::operation::get_function_configuration::GetFunctionConfigurationError,
|
10 - | > {
|
11 - | #[allow(unused_mut)]
|
12 - | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
14 - | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 - | let generic = generic_builder.build();
|
16 - | let error_code = match generic.code() {
|
17 - | Some(code) => code,
|
18 - | None => {
|
19 - | return Err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled(
|
20 - | generic,
|
21 - | ))
|
22 - | }
|
23 - | };
|
24 - |
|
25 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
26 - | Err(match error_code {
|
27 - | "InvalidParameterValueException" => {
|
28 - | crate::operation::get_function_configuration::GetFunctionConfigurationError::InvalidParameterValueException({
|
29 - | #[allow(unused_mut)]
|
30 - | let mut tmp = {
|
31 - | #[allow(unused_mut)]
|
32 - | let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default();
|
33 - | output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err(
|
34 - | _response_body,
|
35 - | output,
|
36 - | )
|
37 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
38 - | let output = output.meta(generic);
|
39 - | output.build()
|
40 - | };
|
41 - | if tmp.message.is_none() {
|
42 - | tmp.message = _error_message;
|
43 - | }
|
44 - | tmp
|
45 - | })
|
46 - | }
|
47 - | "ResourceNotFoundException" => crate::operation::get_function_configuration::GetFunctionConfigurationError::ResourceNotFoundException({
|
48 - | #[allow(unused_mut)]
|
49 - | let mut tmp = {
|
50 - | #[allow(unused_mut)]
|
51 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
52 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
53 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
54 - | let output = output.meta(generic);
|
55 - | output.build()
|
56 - | };
|
57 - | if tmp.message.is_none() {
|
58 - | tmp.message = _error_message;
|
59 - | }
|
60 - | tmp
|
61 - | }),
|
62 - | "ServiceException" => crate::operation::get_function_configuration::GetFunctionConfigurationError::ServiceException({
|
63 - | #[allow(unused_mut)]
|
64 - | let mut tmp = {
|
65 - | #[allow(unused_mut)]
|
66 - | let mut output = crate::types::error::builders::ServiceExceptionBuilder::default();
|
67 - | output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output)
|
68 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
69 - | let output = output.meta(generic);
|
70 - | output.build()
|
71 - | };
|
72 - | if tmp.message.is_none() {
|
73 - | tmp.message = _error_message;
|
74 - | }
|
75 - | tmp
|
76 - | }),
|
77 - | "TooManyRequestsException" => crate::operation::get_function_configuration::GetFunctionConfigurationError::TooManyRequestsException({
|
78 - | #[allow(unused_mut)]
|
79 - | let mut tmp = {
|
80 - | #[allow(unused_mut)]
|
81 - | let mut output = crate::types::error::builders::TooManyRequestsExceptionBuilder::default();
|
82 - | output = crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(_response_body, output)
|
83 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
84 - | output = output.set_retry_after_seconds(
|
85 - | crate::protocol_serde::shape_too_many_requests_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| {
|
86 - | crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled(
|
87 - | "Failed to parse retryAfterSeconds from header `Retry-After",
|
88 - | )
|
89 - | })?,
|
90 - | );
|
91 - | let output = output.meta(generic);
|
92 - | output.build()
|
93 - | };
|
94 - | if tmp.message.is_none() {
|
95 - | tmp.message = _error_message;
|
96 - | }
|
97 - | tmp
|
98 - | }),
|
99 - | _ => crate::operation::get_function_configuration::GetFunctionConfigurationError::generic(generic),
|
100 - | })
|
101 - | }
|
102 - |
|
103 - | #[allow(clippy::unnecessary_wraps)]
|
104 - | pub fn de_get_function_configuration_http_response(
|
105 - | _response_status: u16,
|
106 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
107 - | _response_body: &[u8],
|
108 - | ) -> std::result::Result<
|
109 - | crate::operation::get_function_configuration::GetFunctionConfigurationOutput,
|
110 - | crate::operation::get_function_configuration::GetFunctionConfigurationError,
|
111 - | > {
|
112 - | Ok({
|
113 - | #[allow(unused_mut)]
|
114 - | let mut output = crate::operation::get_function_configuration::builders::GetFunctionConfigurationOutputBuilder::default();
|
115 - | output = crate::protocol_serde::shape_get_function_configuration::de_get_function_configuration(_response_body, output)
|
116 - | .map_err(crate::operation::get_function_configuration::GetFunctionConfigurationError::unhandled)?;
|
117 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
118 - | output.build()
|
119 - | })
|
120 - | }
|
121 - |
|
122 - | pub(crate) fn de_get_function_configuration(
|
123 - | _value: &[u8],
|
124 - | mut builder: crate::operation::get_function_configuration::builders::GetFunctionConfigurationOutputBuilder,
|
125 - | ) -> ::std::result::Result<
|
126 - | crate::operation::get_function_configuration::builders::GetFunctionConfigurationOutputBuilder,
|
127 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
128 - | > {
|
129 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
130 - | let tokens = &mut tokens_owned;
|
131 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
132 - | loop {
|
133 - | match tokens.next().transpose()? {
|
134 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
135 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
136 - | "Architectures" => {
|
137 - | builder = builder.set_architectures(crate::protocol_serde::shape_architectures_list::de_architectures_list(tokens, _value)?);
|
138 - | }
|
139 - | "CodeSha256" => {
|
140 - | builder = builder.set_code_sha256(
|
141 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
142 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
143 - | .transpose()?,
|
144 - | );
|
145 - | }
|
146 - | "CodeSize" => {
|
147 - | builder = builder.set_code_size(
|
148 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
149 - | .map(i64::try_from)
|
150 - | .transpose()?,
|
151 - | );
|
152 - | }
|
153 - | "DeadLetterConfig" => {
|
154 - | builder = builder.set_dead_letter_config(crate::protocol_serde::shape_dead_letter_config::de_dead_letter_config(tokens, _value)?);
|
155 - | }
|
156 - | "Description" => {
|
157 - | builder = builder.set_description(
|
158 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
159 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
160 - | .transpose()?,
|
161 - | );
|
162 - | }
|
163 - | "Environment" => {
|
164 - | builder = builder.set_environment(crate::protocol_serde::shape_environment_response::de_environment_response(
|
165 - | tokens, _value,
|
166 - | )?);
|
167 - | }
|
168 - | "EphemeralStorage" => {
|
169 - | builder = builder.set_ephemeral_storage(crate::protocol_serde::shape_ephemeral_storage::de_ephemeral_storage(tokens, _value)?);
|
170 - | }
|
171 - | "FileSystemConfigs" => {
|
172 - | builder = builder.set_file_system_configs(crate::protocol_serde::shape_file_system_config_list::de_file_system_config_list(
|
173 - | tokens, _value,
|
174 - | )?);
|
175 - | }
|
176 - | "FunctionArn" => {
|
177 - | builder = builder.set_function_arn(
|
178 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
179 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
180 - | .transpose()?,
|
181 - | );
|
182 - | }
|
183 - | "FunctionName" => {
|
184 - | builder = builder.set_function_name(
|
185 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
186 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
187 - | .transpose()?,
|
188 - | );
|
189 - | }
|
190 - | "Handler" => {
|
191 - | builder = builder.set_handler(
|
192 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
193 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
194 - | .transpose()?,
|
195 - | );
|
196 - | }
|
197 - | "ImageConfigResponse" => {
|
198 - | builder = builder.set_image_config_response(crate::protocol_serde::shape_image_config_response::de_image_config_response(
|
199 - | tokens, _value,
|
200 - | )?);
|
201 - | }
|
202 - | "KMSKeyArn" => {
|
203 - | builder = builder.set_kms_key_arn(
|
204 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
205 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
206 - | .transpose()?,
|
207 - | );
|
208 - | }
|
209 - | "LastModified" => {
|
210 - | builder = builder.set_last_modified(
|
211 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
212 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
213 - | .transpose()?,
|
214 - | );
|
215 - | }
|
216 - | "LastUpdateStatus" => {
|
217 - | builder = builder.set_last_update_status(
|
218 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
219 - | .map(|s| s.to_unescaped().map(|u| crate::types::LastUpdateStatus::from(u.as_ref())))
|
220 - | .transpose()?,
|
221 - | );
|
222 - | }
|
223 - | "LastUpdateStatusReason" => {
|
224 - | builder = builder.set_last_update_status_reason(
|
225 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
226 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
227 - | .transpose()?,
|
228 - | );
|
229 - | }
|
230 - | "LastUpdateStatusReasonCode" => {
|
231 - | builder = builder.set_last_update_status_reason_code(
|
232 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
233 - | .map(|s| s.to_unescaped().map(|u| crate::types::LastUpdateStatusReasonCode::from(u.as_ref())))
|
234 - | .transpose()?,
|
235 - | );
|
236 - | }
|
237 - | "Layers" => {
|
238 - | builder = builder.set_layers(crate::protocol_serde::shape_layers_reference_list::de_layers_reference_list(
|
239 - | tokens, _value,
|
240 - | )?);
|
241 - | }
|
242 - | "LoggingConfig" => {
|
243 - | builder = builder.set_logging_config(crate::protocol_serde::shape_logging_config::de_logging_config(tokens, _value)?);
|
244 - | }
|
245 - | "MasterArn" => {
|
246 - | builder = builder.set_master_arn(
|
247 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
248 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
249 - | .transpose()?,
|
250 - | );
|
251 - | }
|
252 - | "MemorySize" => {
|
253 - | builder = builder.set_memory_size(
|
254 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
255 - | .map(i32::try_from)
|
256 - | .transpose()?,
|
257 - | );
|
258 - | }
|
259 - | "PackageType" => {
|
260 - | builder = builder.set_package_type(
|
261 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
262 - | .map(|s| s.to_unescaped().map(|u| crate::types::PackageType::from(u.as_ref())))
|
263 - | .transpose()?,
|
264 - | );
|
265 - | }
|
266 - | "RevisionId" => {
|
267 - | builder = builder.set_revision_id(
|
268 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
269 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
270 - | .transpose()?,
|
271 - | );
|
272 - | }
|
273 - | "Role" => {
|
274 - | builder = builder.set_role(
|
275 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
276 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
277 - | .transpose()?,
|
278 - | );
|
279 - | }
|
280 - | "Runtime" => {
|
281 - | builder = builder.set_runtime(
|
282 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
283 - | .map(|s| s.to_unescaped().map(|u| crate::types::Runtime::from(u.as_ref())))
|
284 - | .transpose()?,
|
285 - | );
|
286 - | }
|
287 - | "RuntimeVersionConfig" => {
|
288 - | builder = builder.set_runtime_version_config(crate::protocol_serde::shape_runtime_version_config::de_runtime_version_config(
|
289 - | tokens, _value,
|
290 - | )?);
|
291 - | }
|
292 - | "SigningJobArn" => {
|
293 - | builder = builder.set_signing_job_arn(
|
294 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
295 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
296 - | .transpose()?,
|
297 - | );
|
298 - | }
|
299 - | "SigningProfileVersionArn" => {
|
300 - | builder = builder.set_signing_profile_version_arn(
|
301 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
302 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
303 - | .transpose()?,
|
304 - | );
|
305 - | }
|
306 - | "SnapStart" => {
|
307 - | builder = builder.set_snap_start(crate::protocol_serde::shape_snap_start_response::de_snap_start_response(tokens, _value)?);
|
308 - | }
|
309 - | "State" => {
|
310 - | builder = builder.set_state(
|
311 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
312 - | .map(|s| s.to_unescaped().map(|u| crate::types::State::from(u.as_ref())))
|
313 - | .transpose()?,
|
314 - | );
|
315 - | }
|
316 - | "StateReason" => {
|
317 - | builder = builder.set_state_reason(
|
318 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
319 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
320 - | .transpose()?,
|
321 - | );
|
322 - | }
|
323 - | "StateReasonCode" => {
|
324 - | builder = builder.set_state_reason_code(
|
325 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
326 - | .map(|s| s.to_unescaped().map(|u| crate::types::StateReasonCode::from(u.as_ref())))
|
327 - | .transpose()?,
|
328 - | );
|
329 - | }
|
330 - | "Timeout" => {
|
331 - | builder = builder.set_timeout(
|
332 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
333 - | .map(i32::try_from)
|
334 - | .transpose()?,
|
335 - | );
|
336 - | }
|
337 - | "TracingConfig" => {
|
338 - | builder = builder.set_tracing_config(crate::protocol_serde::shape_tracing_config_response::de_tracing_config_response(
|
339 - | tokens, _value,
|
340 - | )?);
|
341 - | }
|
342 - | "Version" => {
|
343 - | builder = builder.set_version(
|
344 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
345 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
346 - | .transpose()?,
|
347 - | );
|
348 - | }
|
349 - | "VpcConfig" => {
|
350 - | builder = builder.set_vpc_config(crate::protocol_serde::shape_vpc_config_response::de_vpc_config_response(tokens, _value)?);
|
351 - | }
|
352 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
353 - | },
|
354 - | other => {
|
355 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
356 - | "expected object key or end object, found: {other:?}"
|
357 - | )))
|
358 - | }
|
359 - | }
|
360 - | }
|
361 - | if tokens.next().is_some() {
|
362 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
363 - | "found more JSON tokens after completing parsing",
|
364 - | ));
|
365 - | }
|
366 - | Ok(builder)
|
367 - | }
|