144 150 | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError,
|
145 151 | >::new());
|
146 152 |
|
147 153 | ::std::borrow::Cow::Owned(rcb)
|
148 154 | }
|
149 155 | }
|
150 156 |
|
151 157 | #[derive(Debug)]
|
152 158 | struct ListProvisionedConcurrencyConfigsResponseDeserializer;
|
153 159 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListProvisionedConcurrencyConfigsResponseDeserializer {
|
154 - | fn deserialize_nonstreaming(
|
160 + | fn deserialize_nonstreaming_with_config(
|
155 161 | &self,
|
156 162 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
163 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 164 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 165 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
159 - | let headers = response.headers();
|
160 - | let body = response.body().bytes().expect("body loaded");
|
161 166 | #[allow(unused_mut)]
|
162 167 | let mut force_error = false;
|
163 168 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
164 - | let parse_result = if !success && status != 200 || force_error {
|
165 - | crate::protocol_serde::shape_list_provisioned_concurrency_configs::de_list_provisioned_concurrency_configs_http_error(
|
166 - | status, headers, body,
|
169 + | if !success && status != 200 || force_error {
|
170 + | let headers = response.headers();
|
171 + | let body = response.body().bytes().expect("body loaded");
|
172 + | #[allow(unused_mut)]
|
173 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
177 + | let generic = generic_builder.build();
|
178 + | let error_code = match generic.code() {
|
179 + | ::std::option::Option::Some(code) => code,
|
180 + | ::std::option::Option::None => {
|
181 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
182 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
183 + | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::unhandled(generic),
|
184 + | ),
|
185 + | ))
|
186 + | }
|
187 + | };
|
188 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
189 + | let protocol = _cfg
|
190 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
191 + | .expect("a SharedClientProtocol is required");
|
192 + | let err = match error_code {
|
193 + | "InvalidParameterValueException" => {
|
194 + | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::InvalidParameterValueException({
|
195 + | let mut tmp = match protocol
|
196 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
197 + | .and_then(|mut deser| {
|
198 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
199 + | &mut *deser,
|
200 + | response.headers(),
|
201 + | response.status().into(),
|
202 + | body,
|
167 203 | )
|
168 - | } else {
|
169 - | crate::protocol_serde::shape_list_provisioned_concurrency_configs::de_list_provisioned_concurrency_configs_http_response(
|
170 - | status, headers, body,
|
204 + | }) {
|
205 + | ::std::result::Result::Ok(val) => val,
|
206 + | ::std::result::Result::Err(e) => {
|
207 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
208 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
209 + | ))
|
210 + | }
|
211 + | };
|
212 + | tmp.meta = generic;
|
213 + | if tmp.message.is_none() {
|
214 + | tmp.message = _error_message;
|
215 + | }
|
216 + | tmp
|
217 + | })
|
218 + | }
|
219 + | "ResourceNotFoundException" => {
|
220 + | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::ResourceNotFoundException({
|
221 + | let mut tmp = match protocol
|
222 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
223 + | .and_then(|mut deser| {
|
224 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
225 + | &mut *deser,
|
226 + | response.headers(),
|
227 + | response.status().into(),
|
228 + | body,
|
171 229 | )
|
230 + | }) {
|
231 + | ::std::result::Result::Ok(val) => val,
|
232 + | ::std::result::Result::Err(e) => {
|
233 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
234 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
235 + | ))
|
236 + | }
|
172 237 | };
|
173 - | crate::protocol_serde::type_erase_result(parse_result)
|
238 + | tmp.meta = generic;
|
239 + | if tmp.message.is_none() {
|
240 + | tmp.message = _error_message;
|
241 + | }
|
242 + | tmp
|
243 + | })
|
244 + | }
|
245 + | "ServiceException" => {
|
246 + | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::ServiceException({
|
247 + | let mut tmp = match protocol
|
248 + | .deserialize_response(response, crate::types::error::ServiceException::SCHEMA, _cfg)
|
249 + | .and_then(|mut deser| {
|
250 + | crate::types::error::ServiceException::deserialize_with_response(
|
251 + | &mut *deser,
|
252 + | response.headers(),
|
253 + | response.status().into(),
|
254 + | body,
|
255 + | )
|
256 + | }) {
|
257 + | ::std::result::Result::Ok(val) => val,
|
258 + | ::std::result::Result::Err(e) => {
|
259 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
260 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
261 + | ))
|
262 + | }
|
263 + | };
|
264 + | tmp.meta = generic;
|
265 + | if tmp.message.is_none() {
|
266 + | tmp.message = _error_message;
|
267 + | }
|
268 + | tmp
|
269 + | })
|
270 + | }
|
271 + | "TooManyRequestsException" => {
|
272 + | crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::TooManyRequestsException({
|
273 + | let mut tmp = match protocol
|
274 + | .deserialize_response(response, crate::types::error::TooManyRequestsException::SCHEMA, _cfg)
|
275 + | .and_then(|mut deser| {
|
276 + | crate::types::error::TooManyRequestsException::deserialize_with_response(
|
277 + | &mut *deser,
|
278 + | response.headers(),
|
279 + | response.status().into(),
|
280 + | body,
|
281 + | )
|
282 + | }) {
|
283 + | ::std::result::Result::Ok(val) => val,
|
284 + | ::std::result::Result::Err(e) => {
|
285 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
286 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
287 + | ))
|
288 + | }
|
289 + | };
|
290 + | tmp.meta = generic;
|
291 + | if tmp.message.is_none() {
|
292 + | tmp.message = _error_message;
|
293 + | }
|
294 + | tmp
|
295 + | })
|
296 + | }
|
297 + | _ => crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsError::generic(generic),
|
298 + | };
|
299 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
300 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
301 + | ))
|
302 + | } else {
|
303 + | let protocol = _cfg
|
304 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
305 + | .expect("a SharedClientProtocol is required");
|
306 + | let mut deser = protocol
|
307 + | .deserialize_response(response, ListProvisionedConcurrencyConfigs::OUTPUT_SCHEMA, _cfg)
|
308 + | .map_err(|e| {
|
309 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
310 + | })?;
|
311 + | let body = response.body().bytes().expect("body loaded");
|
312 + | let output = crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsOutput::deserialize_with_response(
|
313 + | &mut *deser,
|
314 + | response.headers(),
|
315 + | response.status().into(),
|
316 + | body,
|
317 + | )
|
318 + | .map_err(|e| {
|
319 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
320 + | })?;
|
321 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
322 + | }
|
174 323 | }
|
175 324 | }
|
176 325 | #[derive(Debug)]
|
177 326 | struct ListProvisionedConcurrencyConfigsRequestSerializer;
|
178 327 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListProvisionedConcurrencyConfigsRequestSerializer {
|
179 328 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
180 329 | fn serialize_input(
|
181 330 | &self,
|
182 331 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
183 332 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
184 333 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
185 334 | let input = input
|
186 335 | .downcast::<crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsInput>()
|
187 336 | .expect("correct type");
|
188 - | let _header_serialization_settings = _cfg
|
189 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
190 - | .cloned()
|
191 - | .unwrap_or_default();
|
192 - | let mut request_builder = {
|
193 - | #[allow(clippy::uninlined_format_args)]
|
194 - | fn uri_base(
|
195 - | _input: &crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsInput,
|
196 - | output: &mut ::std::string::String,
|
197 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
198 - | use ::std::fmt::Write as _;
|
199 - | let input_1 = &_input.function_name;
|
200 - | let input_1 = input_1
|
201 - | .as_ref()
|
202 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?;
|
203 - | let function_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
204 - | if function_name.is_empty() {
|
205 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
206 - | "function_name",
|
207 - | "cannot be empty or unset",
|
208 - | ));
|
209 - | }
|
210 - | ::std::write!(
|
211 - | output,
|
212 - | "/2019-09-30/functions/{FunctionName}/provisioned-concurrency",
|
213 - | FunctionName = function_name
|
214 - | )
|
215 - | .expect("formatting should succeed");
|
216 - | ::std::result::Result::Ok(())
|
217 - | }
|
218 - | fn uri_query(
|
219 - | _input: &crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsInput,
|
220 - | mut output: &mut ::std::string::String,
|
221 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
222 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
223 - | query.push_kv("List", "ALL");
|
224 - | if let ::std::option::Option::Some(inner_2) = &_input.marker {
|
337 + | let protocol = _cfg
|
338 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
339 + | .expect("a SharedClientProtocol is required");
|
340 + | if protocol.supports_http_bindings() {
|
341 + | let mut request = protocol
|
342 + | .serialize_body(&input, ListProvisionedConcurrencyConfigs::INPUT_SCHEMA, "", _cfg)
|
343 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
225 344 | {
|
226 - | query.push_kv("Marker", &::aws_smithy_http::query::fmt_string(inner_2));
|
227 - | }
|
228 - | }
|
229 - | if let ::std::option::Option::Some(inner_3) = &_input.max_items {
|
230 - | {
|
231 - | query.push_kv("MaxItems", ::aws_smithy_types::primitive::Encoder::from(*inner_3).encode());
|
232 - | }
|
345 + | let mut uri = "/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL".to_string();
|
346 + | let mut query_params: Vec<(String, String)> = Vec::new();
|
347 + | if let Some(ref val) = input.function_name {
|
348 + | uri = uri.replace("{FunctionName}", &::aws_smithy_schema::http_protocol::percent_encode(&val.to_string()));
|
349 + | }
|
350 + | if let Some(ref val) = input.marker {
|
351 + | query_params.push(("Marker".to_string(), val.to_string()));
|
352 + | }
|
353 + | if let Some(ref val) = input.max_items {
|
354 + | query_params.push(("MaxItems".to_string(), val.to_string()));
|
355 + | }
|
356 + | if !query_params.is_empty() {
|
357 + | uri.push(if uri.contains('?') { '&' } else { '?' });
|
358 + | let pairs: Vec<String> = query_params
|
359 + | .iter()
|
360 + | .map(|(k, v)| {
|
361 + | format!(
|
362 + | "{}={}",
|
363 + | ::aws_smithy_schema::http_protocol::percent_encode(k),
|
364 + | ::aws_smithy_schema::http_protocol::percent_encode(v)
|
365 + | )
|
366 + | })
|
367 + | .collect();
|
368 + | uri.push_str(&pairs.join("&"));
|
233 369 | }
|
234 - | ::std::result::Result::Ok(())
|
370 + | request.set_uri(uri.as_str()).expect("valid URI");
|
235 371 | }
|
236 - | #[allow(clippy::unnecessary_wraps)]
|
237 - | fn update_http_builder(
|
238 - | input: &crate::operation::list_provisioned_concurrency_configs::ListProvisionedConcurrencyConfigsInput,
|
239 - | builder: ::http_1x::request::Builder,
|
240 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
241 - | let mut uri = ::std::string::String::new();
|
242 - | uri_base(input, &mut uri)?;
|
243 - | uri_query(input, &mut uri)?;
|
244 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
245 - | }
|
246 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
247 - | builder
|
248 - | };
|
249 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
250 372 |
|
251 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
373 + | return ::std::result::Result::Ok(request);
|
374 + | } else {
|
375 + | let mut request = protocol
|
376 + | .serialize_request(&input, ListProvisionedConcurrencyConfigs::INPUT_SCHEMA, "", _cfg)
|
377 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
378 + |
|
379 + | return ::std::result::Result::Ok(request);
|
380 + | }
|
252 381 | }
|
253 382 | }
|
254 383 | #[derive(Debug)]
|
255 384 | struct ListProvisionedConcurrencyConfigsEndpointParamsInterceptor;
|
256 385 |
|
257 386 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListProvisionedConcurrencyConfigsEndpointParamsInterceptor {
|
258 387 | fn name(&self) -> &'static str {
|
259 388 | "ListProvisionedConcurrencyConfigsEndpointParamsInterceptor"
|
260 389 | }
|
261 390 |
|