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