1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(clippy::unnecessary_wraps)]
|
3 - | pub fn de_list_provisioned_concurrency_configs_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::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsOutput,
|
9 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError,
|
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::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::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 => return Err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled(generic)),
|
19 - | };
|
20 - |
|
21 - | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 - | Err(match error_code {
|
23 - | "InvalidParameterValueException" => {
|
24 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::InvalidParameterValueException({
|
25 - | #[allow(unused_mut)]
|
26 - | let mut tmp = {
|
27 - | #[allow(unused_mut)]
|
28 - | let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default();
|
29 - | output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err(
|
30 - | _response_body,
|
31 - | output,
|
32 - | )
|
33 - | .map_err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled)?;
|
34 - | let output = output.meta(generic);
|
35 - | output.build()
|
36 - | };
|
37 - | if tmp.message.is_none() {
|
38 - | tmp.message = _error_message;
|
39 - | }
|
40 - | tmp
|
41 - | })
|
42 - | }
|
43 - | "ResourceNotFoundException" => {
|
44 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::ResourceNotFoundException({
|
45 - | #[allow(unused_mut)]
|
46 - | let mut tmp = {
|
47 - | #[allow(unused_mut)]
|
48 - | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
49 - | output =
|
50 - | crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
51 - | .map_err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled)?;
|
52 - | let output = output.meta(generic);
|
53 - | output.build()
|
54 - | };
|
55 - | if tmp.message.is_none() {
|
56 - | tmp.message = _error_message;
|
57 - | }
|
58 - | tmp
|
59 - | })
|
60 - | }
|
61 - | "ServiceException" => crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::ServiceException({
|
62 - | #[allow(unused_mut)]
|
63 - | let mut tmp = {
|
64 - | #[allow(unused_mut)]
|
65 - | let mut output = crate::types::error::builders::ServiceExceptionBuilder::default();
|
66 - | output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output)
|
67 - | .map_err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled)?;
|
68 - | let output = output.meta(generic);
|
69 - | output.build()
|
70 - | };
|
71 - | if tmp.message.is_none() {
|
72 - | tmp.message = _error_message;
|
73 - | }
|
74 - | tmp
|
75 - | }),
|
76 - | "TooManyRequestsException" => {
|
77 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::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 =
|
83 - | crate::protocol_serde::shape_too_many_requests_exception::de_too_many_requests_exception_json_err(_response_body, output)
|
84 - | .map_err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled)?;
|
85 - | output = output.set_retry_after_seconds(
|
86 - | crate::protocol_serde::shape_too_many_requests_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| {
|
87 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled(
|
88 - | "Failed to parse retryAfterSeconds from header `Retry-After",
|
89 - | )
|
90 - | })?,
|
91 - | );
|
92 - | let output = output.meta(generic);
|
93 - | output.build()
|
94 - | };
|
95 - | if tmp.message.is_none() {
|
96 - | tmp.message = _error_message;
|
97 - | }
|
98 - | tmp
|
99 - | })
|
100 - | }
|
101 - | _ => crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::generic(generic),
|
102 - | })
|
103 - | }
|
104 - |
|
105 - | #[allow(clippy::unnecessary_wraps)]
|
106 - | pub fn de_list_provisioned_concurrency_configs_http_response(
|
107 - | _response_status: u16,
|
108 - | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
109 - | _response_body: &[u8],
|
110 - | ) -> std::result::Result<
|
111 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsOutput,
|
112 - | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError,
|
113 - | > {
|
114 - | Ok({
|
115 - | #[allow(unused_mut)]
|
116 - | let mut output = crate::operation::list_provisioned_concurrency_configs::builders::ListProvisionedConcurrencyConfigsOutputBuilder::default();
|
117 - | output = crate::protocol_serde::shape_list_provisioned_concurrency_configs::de_list_provisioned_concurrency_configs(_response_body, output)
|
118 - | .map_err(crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled)?;
|
119 - | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
120 - | output.build()
|
121 - | })
|
122 - | }
|
123 - |
|
124 - | pub(crate) fn de_list_provisioned_concurrency_configs(
|
125 - | _value: &[u8],
|
126 - | mut builder: crate::operation::list_provisioned_concurrency_configs::builders::ListProvisionedConcurrencyConfigsOutputBuilder,
|
127 - | ) -> ::std::result::Result<
|
128 - | crate::operation::list_provisioned_concurrency_configs::builders::ListProvisionedConcurrencyConfigsOutputBuilder,
|
129 - | ::aws_smithy_json::deserialize::error::DeserializeError,
|
130 - | > {
|
131 - | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
|
132 - | let tokens = &mut tokens_owned;
|
133 - | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
134 - | loop {
|
135 - | match tokens.next().transpose()? {
|
136 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
137 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
138 - | "NextMarker" => {
|
139 - | builder = builder.set_next_marker(
|
140 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
141 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
142 - | .transpose()?,
|
143 - | );
|
144 - | }
|
145 - | "ProvisionedConcurrencyConfigs" => {
|
146 - | builder = builder.set_provisioned_concurrency_configs(
|
147 - | crate::protocol_serde::shape_provisioned_concurrency_config_list::de_provisioned_concurrency_config_list(tokens, _value)?,
|
148 - | );
|
149 - | }
|
150 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
151 - | },
|
152 - | other => {
|
153 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
154 - | "expected object key or end object, found: {other:?}"
|
155 - | )))
|
156 - | }
|
157 - | }
|
158 - | }
|
159 - | if tokens.next().is_some() {
|
160 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
161 - | "found more JSON tokens after completing parsing",
|
162 - | ));
|
163 - | }
|
164 - | Ok(builder)
|
165 - | }
|