132 136 | ::std::borrow::Cow::Owned(rcb)
|
133 137 | }
|
134 138 | }
|
135 139 |
|
136 140 | #[derive(Debug)]
|
137 141 | struct RegisterClientResponseDeserializer;
|
138 142 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RegisterClientResponseDeserializer {
|
139 143 | fn deserialize_nonstreaming(
|
140 144 | &self,
|
141 145 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
146 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
142 147 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
143 148 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
144 - | let headers = response.headers();
|
145 - | let body = response.body().bytes().expect("body loaded");
|
146 149 | #[allow(unused_mut)]
|
147 150 | let mut force_error = false;
|
148 151 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
149 - | let parse_result = if !success && status != 200 || force_error {
|
150 - | crate::protocol_serde::shape_register_client::de_register_client_http_error(status, headers, body)
|
152 + | if !success && status != 200 || force_error {
|
153 + | let headers = response.headers();
|
154 + | let body = response.body().bytes().expect("body loaded");
|
155 + | #[allow(unused_mut)]
|
156 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
157 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
158 + | })?;
|
159 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
160 + | let generic = generic_builder.build();
|
161 + | let error_code = match generic.code() {
|
162 + | ::std::option::Option::Some(code) => code,
|
163 + | ::std::option::Option::None => {
|
164 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
165 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::register_client::RegisterClientError::unhandled(
|
166 + | generic,
|
167 + | )),
|
168 + | ))
|
169 + | }
|
170 + | };
|
171 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
172 + | let protocol = _cfg
|
173 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
174 + | .expect("a SharedClientProtocol is required");
|
175 + | let err = match error_code {
|
176 + | "InternalServerException" => crate::operation::register_client::RegisterClientError::InternalServerException({
|
177 + | let mut tmp = match protocol
|
178 + | .deserialize_response(response, crate::types::error::InternalServerException::SCHEMA, _cfg)
|
179 + | .and_then(|mut deser| {
|
180 + | crate::types::error::InternalServerException::deserialize_with_response(
|
181 + | &mut *deser,
|
182 + | response.headers(),
|
183 + | response.status().into(),
|
184 + | body,
|
185 + | )
|
186 + | }) {
|
187 + | ::std::result::Result::Ok(val) => val,
|
188 + | ::std::result::Result::Err(e) => {
|
189 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
190 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
191 + | ))
|
192 + | }
|
193 + | };
|
194 + | tmp.meta = generic;
|
195 + | if tmp.message.is_none() {
|
196 + | tmp.message = _error_message;
|
197 + | }
|
198 + | tmp
|
199 + | }),
|
200 + | "InvalidClientMetadataException" => crate::operation::register_client::RegisterClientError::InvalidClientMetadataException({
|
201 + | let mut tmp = match protocol
|
202 + | .deserialize_response(response, crate::types::error::InvalidClientMetadataException::SCHEMA, _cfg)
|
203 + | .and_then(|mut deser| {
|
204 + | crate::types::error::InvalidClientMetadataException::deserialize_with_response(
|
205 + | &mut *deser,
|
206 + | response.headers(),
|
207 + | response.status().into(),
|
208 + | body,
|
209 + | )
|
210 + | }) {
|
211 + | ::std::result::Result::Ok(val) => val,
|
212 + | ::std::result::Result::Err(e) => {
|
213 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
214 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
215 + | ))
|
216 + | }
|
217 + | };
|
218 + | tmp.meta = generic;
|
219 + | if tmp.message.is_none() {
|
220 + | tmp.message = _error_message;
|
221 + | }
|
222 + | tmp
|
223 + | }),
|
224 + | "InvalidRedirectUriException" => crate::operation::register_client::RegisterClientError::InvalidRedirectUriException({
|
225 + | let mut tmp = match protocol
|
226 + | .deserialize_response(response, crate::types::error::InvalidRedirectUriException::SCHEMA, _cfg)
|
227 + | .and_then(|mut deser| {
|
228 + | crate::types::error::InvalidRedirectUriException::deserialize_with_response(
|
229 + | &mut *deser,
|
230 + | response.headers(),
|
231 + | response.status().into(),
|
232 + | body,
|
233 + | )
|
234 + | }) {
|
235 + | ::std::result::Result::Ok(val) => val,
|
236 + | ::std::result::Result::Err(e) => {
|
237 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
238 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
239 + | ))
|
240 + | }
|
241 + | };
|
242 + | tmp.meta = generic;
|
243 + | if tmp.message.is_none() {
|
244 + | tmp.message = _error_message;
|
245 + | }
|
246 + | tmp
|
247 + | }),
|
248 + | "InvalidRequestException" => crate::operation::register_client::RegisterClientError::InvalidRequestException({
|
249 + | let mut tmp = match protocol
|
250 + | .deserialize_response(response, crate::types::error::InvalidRequestException::SCHEMA, _cfg)
|
251 + | .and_then(|mut deser| {
|
252 + | crate::types::error::InvalidRequestException::deserialize_with_response(
|
253 + | &mut *deser,
|
254 + | response.headers(),
|
255 + | response.status().into(),
|
256 + | body,
|
257 + | )
|
258 + | }) {
|
259 + | ::std::result::Result::Ok(val) => val,
|
260 + | ::std::result::Result::Err(e) => {
|
261 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
262 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
263 + | ))
|
264 + | }
|
265 + | };
|
266 + | tmp.meta = generic;
|
267 + | if tmp.message.is_none() {
|
268 + | tmp.message = _error_message;
|
269 + | }
|
270 + | tmp
|
271 + | }),
|
272 + | "InvalidScopeException" => crate::operation::register_client::RegisterClientError::InvalidScopeException({
|
273 + | let mut tmp = match protocol
|
274 + | .deserialize_response(response, crate::types::error::InvalidScopeException::SCHEMA, _cfg)
|
275 + | .and_then(|mut deser| {
|
276 + | crate::types::error::InvalidScopeException::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 + | "SlowDownException" => crate::operation::register_client::RegisterClientError::SlowDownException({
|
297 + | let mut tmp = match protocol
|
298 + | .deserialize_response(response, crate::types::error::SlowDownException::SCHEMA, _cfg)
|
299 + | .and_then(|mut deser| {
|
300 + | crate::types::error::SlowDownException::deserialize_with_response(
|
301 + | &mut *deser,
|
302 + | response.headers(),
|
303 + | response.status().into(),
|
304 + | body,
|
305 + | )
|
306 + | }) {
|
307 + | ::std::result::Result::Ok(val) => val,
|
308 + | ::std::result::Result::Err(e) => {
|
309 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
310 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
311 + | ))
|
312 + | }
|
313 + | };
|
314 + | tmp.meta = generic;
|
315 + | if tmp.message.is_none() {
|
316 + | tmp.message = _error_message;
|
317 + | }
|
318 + | tmp
|
319 + | }),
|
320 + | "UnsupportedGrantTypeException" => crate::operation::register_client::RegisterClientError::UnsupportedGrantTypeException({
|
321 + | let mut tmp = match protocol
|
322 + | .deserialize_response(response, crate::types::error::UnsupportedGrantTypeException::SCHEMA, _cfg)
|
323 + | .and_then(|mut deser| {
|
324 + | crate::types::error::UnsupportedGrantTypeException::deserialize_with_response(
|
325 + | &mut *deser,
|
326 + | response.headers(),
|
327 + | response.status().into(),
|
328 + | body,
|
329 + | )
|
330 + | }) {
|
331 + | ::std::result::Result::Ok(val) => val,
|
332 + | ::std::result::Result::Err(e) => {
|
333 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
334 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
335 + | ))
|
336 + | }
|
337 + | };
|
338 + | tmp.meta = generic;
|
339 + | if tmp.message.is_none() {
|
340 + | tmp.message = _error_message;
|
341 + | }
|
342 + | tmp
|
343 + | }),
|
344 + | _ => crate::operation::register_client::RegisterClientError::generic(generic),
|
345 + | };
|
346 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
347 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
348 + | ))
|
151 349 | } else {
|
152 - | crate::protocol_serde::shape_register_client::de_register_client_http_response(status, headers, body)
|
153 - | };
|
154 - | crate::protocol_serde::type_erase_result(parse_result)
|
350 + | let protocol = _cfg
|
351 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
352 + | .expect("a SharedClientProtocol is required");
|
353 + | let mut deser = protocol
|
354 + | .deserialize_response(response, RegisterClient::OUTPUT_SCHEMA, _cfg)
|
355 + | .map_err(|e| {
|
356 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
357 + | })?;
|
358 + | let body = response.body().bytes().expect("body loaded");
|
359 + | let output = crate::operation::register_client::RegisterClientOutput::deserialize_with_response(
|
360 + | &mut *deser,
|
361 + | response.headers(),
|
362 + | response.status().into(),
|
363 + | body,
|
364 + | )
|
365 + | .map_err(|e| {
|
366 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
367 + | })?;
|
368 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
369 + | }
|
155 370 | }
|
156 371 | }
|
157 372 | #[derive(Debug)]
|
158 373 | struct RegisterClientRequestSerializer;
|
159 374 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RegisterClientRequestSerializer {
|
160 375 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
161 376 | fn serialize_input(
|
162 377 | &self,
|
163 378 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
164 379 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
165 380 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
166 381 | let input = input
|
167 382 | .downcast::<crate::operation::register_client::RegisterClientInput>()
|
168 383 | .expect("correct type");
|
169 - | let _header_serialization_settings = _cfg
|
170 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
171 - | .cloned()
|
172 - | .unwrap_or_default();
|
173 - | let mut request_builder = {
|
174 - | #[allow(clippy::uninlined_format_args)]
|
175 - | fn uri_base(
|
176 - | _input: &crate::operation::register_client::RegisterClientInput,
|
177 - | output: &mut ::std::string::String,
|
178 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
179 - | use ::std::fmt::Write as _;
|
180 - | ::std::write!(output, "/client/register").expect("formatting should succeed");
|
181 - | ::std::result::Result::Ok(())
|
182 - | }
|
183 - | #[allow(clippy::unnecessary_wraps)]
|
184 - | fn update_http_builder(
|
185 - | input: &crate::operation::register_client::RegisterClientInput,
|
186 - | builder: ::http_1x::request::Builder,
|
187 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
188 - | let mut uri = ::std::string::String::new();
|
189 - | uri_base(input, &mut uri)?;
|
190 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
191 - | }
|
192 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
193 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
|
194 - | builder
|
195 - | };
|
196 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_register_client::ser_register_client_input(&input)?);
|
197 - | if let Some(content_length) = body.content_length() {
|
198 - | let content_length = content_length.to_string();
|
199 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
200 - | }
|
201 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
384 + | let protocol = _cfg
|
385 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
386 + | .expect("a SharedClientProtocol is required");
|
387 + | let mut request = protocol
|
388 + | .serialize_request(&input, RegisterClient::INPUT_SCHEMA, "", _cfg)
|
389 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
390 + |
|
391 + | return ::std::result::Result::Ok(request);
|
202 392 | }
|
203 393 | }
|
204 394 | #[derive(Debug)]
|
205 395 | struct RegisterClientEndpointParamsInterceptor;
|
206 396 |
|
207 397 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RegisterClientEndpointParamsInterceptor {
|
208 398 | fn name(&self) -> &'static str {
|
209 399 | "RegisterClientEndpointParamsInterceptor"
|
210 400 | }
|
211 401 |
|