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