Skip to main content

aws_sdk_ssooidc/operation/
register_client.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `RegisterClient`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct RegisterClient;
6impl RegisterClient {
7    /// Creates a new `RegisterClient`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::register_client::RegisterClientInput::SCHEMA;
13    /// The schema for this operation's output shape.
14    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::register_client::RegisterClientOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17        input: crate::operation::register_client::RegisterClientInput,
18    ) -> ::std::result::Result<
19        crate::operation::register_client::RegisterClientOutput,
20        ::aws_smithy_runtime_api::client::result::SdkError<
21            crate::operation::register_client::RegisterClientError,
22            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
23        >,
24    > {
25        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
26            ::aws_smithy_runtime_api::client::interceptors::context::Error,
27            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
28        >| {
29            err.map_service_error(|err| {
30                err.downcast::<crate::operation::register_client::RegisterClientError>()
31                    .expect("correct error type")
32            })
33        };
34        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
35            .await
36            .map_err(map_err)?;
37        let output = context.finalize().map_err(map_err)?;
38        ::std::result::Result::Ok(
39            output
40                .downcast::<crate::operation::register_client::RegisterClientOutput>()
41                .expect("correct output type"),
42        )
43    }
44
45    pub(crate) async fn orchestrate_with_stop_point(
46        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
47        input: crate::operation::register_client::RegisterClientInput,
48        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
49    ) -> ::std::result::Result<
50        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
51        ::aws_smithy_runtime_api::client::result::SdkError<
52            ::aws_smithy_runtime_api::client::interceptors::context::Error,
53            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
54        >,
55    > {
56        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
57        use ::tracing::Instrument;
58        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("SSO OIDC", "RegisterClient", input, runtime_plugins, stop_point)
59            // Create a parent span for the entire operation. Includes a random, internal-only,
60            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
61            .instrument(::tracing::debug_span!(
62                "SSO OIDC.RegisterClient",
63                "rpc.service" = "SSO OIDC",
64                "rpc.method" = "RegisterClient",
65                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
66                "rpc.system" = "aws-api",
67            ))
68            .await
69    }
70
71    pub(crate) fn operation_runtime_plugins(
72        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
73        client_config: &crate::config::Config,
74        config_override: ::std::option::Option<crate::config::Builder>,
75    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
76        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
77
78        if let ::std::option::Option::Some(config_override) = config_override {
79            for plugin in config_override.runtime_plugins.iter().cloned() {
80                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
81            }
82            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
83                config_override,
84                client_config.config.clone(),
85                &client_config.runtime_components,
86            ));
87        }
88        runtime_plugins
89    }
90}
91/// Per-operation error registry. Contains an entry for every modeled
92/// error this operation can throw.
93///
94/// Used by the schema-serde error path as the operation-scoped lookup
95/// for registry-backed error reification: an error code that does not
96/// match one of the operation's modeled errors directly is resolved
97/// against this registry first, then widened to the service-wide error
98/// registry.
99pub(crate) mod error_registry {
100    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
101        ::aws_smithy_schema::registry::TypeRegistry::builder()
102                            .insert_error_shape(
103                        crate::types::error::InternalServerException::SCHEMA,
104                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
105                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServerException::deserialize(d)?))
106                        },
107                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
108                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServerException::deserialize(d)?))
109                        },
110                    )
111.insert_error_shape(
112                        crate::types::error::InvalidClientMetadataException::SCHEMA,
113                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
114                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidClientMetadataException::deserialize(d)?))
115                        },
116                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
117                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidClientMetadataException::deserialize(d)?))
118                        },
119                    )
120.insert_error_shape(
121                        crate::types::error::InvalidRedirectUriException::SCHEMA,
122                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
123                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidRedirectUriException::deserialize(d)?))
124                        },
125                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
126                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidRedirectUriException::deserialize(d)?))
127                        },
128                    )
129.insert_error_shape(
130                        crate::types::error::InvalidRequestException::SCHEMA,
131                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
132                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidRequestException::deserialize(d)?))
133                        },
134                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
135                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidRequestException::deserialize(d)?))
136                        },
137                    )
138.insert_error_shape(
139                        crate::types::error::InvalidScopeException::SCHEMA,
140                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
141                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidScopeException::deserialize(d)?))
142                        },
143                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
144                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidScopeException::deserialize(d)?))
145                        },
146                    )
147.insert_error_shape(
148                        crate::types::error::SlowDownException::SCHEMA,
149                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
150                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::SlowDownException::deserialize(d)?))
151                        },
152                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
153                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::SlowDownException::deserialize(d)?))
154                        },
155                    )
156.insert_error_shape(
157                        crate::types::error::UnsupportedGrantTypeException::SCHEMA,
158                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
159                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::UnsupportedGrantTypeException::deserialize(d)?))
160                        },
161                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
162                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::UnsupportedGrantTypeException::deserialize(d)?))
163                        },
164                    )
165                            .build()
166    });
167}
168impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RegisterClient {
169    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
170        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RegisterClient");
171
172        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
173            RegisterClientRequestSerializer,
174        ));
175        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
176            RegisterClientResponseDeserializer,
177        ));
178
179        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
180            crate::config::auth::Params::builder()
181                .operation_name("RegisterClient")
182                .build()
183                .expect("required fields set"),
184        ));
185
186        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
187        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
188            "RegisterClient",
189            "SSO OIDC",
190        ));
191
192        ::std::option::Option::Some(cfg.freeze())
193    }
194
195    fn runtime_components(
196        &self,
197        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
198    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
199        #[allow(unused_mut)]
200        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RegisterClient")
201            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
202                RegisterClientTelemetryInputCaptureInterceptor,
203            ))
204            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
205                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
206            ))
207            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
208                RegisterClientEndpointParamsInterceptor,
209            ))
210            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
211                crate::operation::register_client::RegisterClientError,
212            >::new())
213            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
214                crate::operation::register_client::RegisterClientError,
215            >::new())
216            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
217                crate::operation::register_client::RegisterClientError,
218            >::new())
219            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
220                crate::operation::register_client::RegisterClientError,
221            >::new());
222
223        ::std::borrow::Cow::Owned(rcb)
224    }
225}
226
227#[derive(Debug)]
228struct RegisterClientTelemetryInputCaptureInterceptor;
229
230#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
231impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RegisterClientTelemetryInputCaptureInterceptor {
232    fn name(&self) -> &'static str {
233        "RegisterClientTelemetryInputCaptureInterceptor"
234    }
235
236    fn read_before_execution(
237        &self,
238        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
239            '_,
240            ::aws_smithy_runtime_api::client::interceptors::context::Input,
241            ::aws_smithy_runtime_api::client::interceptors::context::Output,
242            ::aws_smithy_runtime_api::client::interceptors::context::Error,
243        >,
244        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
245    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
246        // Nothing to do unless the customer opted in by naming members to record.
247        let ::std::option::Option::Some(requested) = cfg
248            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
249            .filter(|r| !r.is_empty())
250        else {
251            return ::std::result::Result::Ok(());
252        };
253
254        let ::std::option::Option::Some(input) = context.input().downcast_ref::<RegisterClientInput>() else {
255            // A mismatched input is not this interceptor's concern; skip quietly.
256            return ::std::result::Result::Ok(());
257        };
258
259        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
260        if requested.should_capture("clientName") {
261            if let ::std::option::Option::Some(value) = input.client_name.as_deref() {
262                captured.insert("clientName", value);
263            }
264        }
265        if requested.should_capture("clientType") {
266            if let ::std::option::Option::Some(value) = input.client_type.as_deref() {
267                captured.insert("clientType", value);
268            }
269        }
270        if requested.should_capture("issuerUrl") {
271            if let ::std::option::Option::Some(value) = input.issuer_url.as_deref() {
272                captured.insert("issuerUrl", value);
273            }
274        }
275        if requested.should_capture("entitledApplicationArn") {
276            if let ::std::option::Option::Some(value) = input.entitled_application_arn.as_deref() {
277                captured.insert("entitledApplicationArn", value);
278            }
279        }
280
281        cfg.interceptor_state().store_put(captured);
282        ::std::result::Result::Ok(())
283    }
284}
285#[derive(Debug)]
286struct RegisterClientResponseDeserializer;
287impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RegisterClientResponseDeserializer {
288    fn deserialize_nonstreaming_with_config(
289        &self,
290        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
291        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
292    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
293        let (success, status) = (response.status().is_success(), response.status().as_u16());
294        // Load body and headers BEFORE BeforeParseResponse so customizations
295        // (e.g., S3's `body_is_error` check that detects errors returned with
296        // HTTP 200) can inspect them. The legacy non-streaming path also
297        // loads `body` before firing this hook.
298        #[allow(unused_variables)]
299        let body = response.body().bytes().expect("body loaded");
300        let headers = response.headers();
301        #[allow(unused_mut)]
302        let mut force_error = false;
303        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
304        if !success && status != 200 || force_error {
305            let protocol = _cfg
306                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
307                .expect("a SharedClientProtocol is required");
308            #[allow(unused_mut)]
309            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
310                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
311            })?;
312            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
313            let generic = generic_builder.build();
314            let error_code = match generic.code() {
315                ::std::option::Option::Some(code) => code,
316                ::std::option::Option::None => {
317                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
318                        ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::register_client::RegisterClientError::unhandled(
319                            generic,
320                        )),
321                    ))
322                }
323            };
324            let _error_message = generic.message().map(|msg| msg.to_owned());
325            let err = match error_code {
326                "InternalServerException" => crate::operation::register_client::RegisterClientError::InternalServerException({
327                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
328                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
329                            e,
330                        ))
331                    })?;
332                    let mut tmp = <crate::types::error::builders::InternalServerExceptionBuilder>::default();
333                    tmp.deserialize_members(&mut *deser).map_err(|e| {
334                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
335                            e,
336                        ))
337                    })?;
338                    if tmp.message.is_none() {
339                        tmp.message = _error_message;
340                    }
341                    let tmp = tmp.meta(generic);
342                    tmp.build()
343                }),
344                "InvalidClientMetadataException" => crate::operation::register_client::RegisterClientError::InvalidClientMetadataException({
345                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
346                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
347                            e,
348                        ))
349                    })?;
350                    let mut tmp = <crate::types::error::builders::InvalidClientMetadataExceptionBuilder>::default();
351                    tmp.deserialize_members(&mut *deser).map_err(|e| {
352                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
353                            e,
354                        ))
355                    })?;
356                    if tmp.message.is_none() {
357                        tmp.message = _error_message;
358                    }
359                    let tmp = tmp.meta(generic);
360                    tmp.build()
361                }),
362                "InvalidRedirectUriException" => crate::operation::register_client::RegisterClientError::InvalidRedirectUriException({
363                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
364                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
365                            e,
366                        ))
367                    })?;
368                    let mut tmp = <crate::types::error::builders::InvalidRedirectUriExceptionBuilder>::default();
369                    tmp.deserialize_members(&mut *deser).map_err(|e| {
370                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
371                            e,
372                        ))
373                    })?;
374                    if tmp.message.is_none() {
375                        tmp.message = _error_message;
376                    }
377                    let tmp = tmp.meta(generic);
378                    tmp.build()
379                }),
380                "InvalidRequestException" => crate::operation::register_client::RegisterClientError::InvalidRequestException({
381                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
382                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
383                            e,
384                        ))
385                    })?;
386                    let mut tmp = <crate::types::error::builders::InvalidRequestExceptionBuilder>::default();
387                    tmp.deserialize_members(&mut *deser).map_err(|e| {
388                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
389                            e,
390                        ))
391                    })?;
392                    if tmp.message.is_none() {
393                        tmp.message = _error_message;
394                    }
395                    let tmp = tmp.meta(generic);
396                    tmp.build()
397                }),
398                "InvalidScopeException" => crate::operation::register_client::RegisterClientError::InvalidScopeException({
399                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
400                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
401                            e,
402                        ))
403                    })?;
404                    let mut tmp = <crate::types::error::builders::InvalidScopeExceptionBuilder>::default();
405                    tmp.deserialize_members(&mut *deser).map_err(|e| {
406                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
407                            e,
408                        ))
409                    })?;
410                    if tmp.message.is_none() {
411                        tmp.message = _error_message;
412                    }
413                    let tmp = tmp.meta(generic);
414                    tmp.build()
415                }),
416                "SlowDownException" => crate::operation::register_client::RegisterClientError::SlowDownException({
417                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
418                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
419                            e,
420                        ))
421                    })?;
422                    let mut tmp = <crate::types::error::builders::SlowDownExceptionBuilder>::default();
423                    tmp.deserialize_members(&mut *deser).map_err(|e| {
424                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
425                            e,
426                        ))
427                    })?;
428                    if tmp.message.is_none() {
429                        tmp.message = _error_message;
430                    }
431                    let tmp = tmp.meta(generic);
432                    tmp.build()
433                }),
434                "UnsupportedGrantTypeException" => crate::operation::register_client::RegisterClientError::UnsupportedGrantTypeException({
435                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
436                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
437                            e,
438                        ))
439                    })?;
440                    let mut tmp = <crate::types::error::builders::UnsupportedGrantTypeExceptionBuilder>::default();
441                    tmp.deserialize_members(&mut *deser).map_err(|e| {
442                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
443                            e,
444                        ))
445                    })?;
446                    if tmp.message.is_none() {
447                        tmp.message = _error_message;
448                    }
449                    let tmp = tmp.meta(generic);
450                    tmp.build()
451                }),
452                _ => {
453                    // Registry-backed, operation-scoped reification of an error whose
454                    // code this operation does not model directly: the operation's own
455                    // error registry is consulted first, then the lookup widens to the
456                    // service-wide error registry. On a hit, the reified error is attached
457                    // as the source of the returned unhandled error while its metadata
458                    // (code, message, request id) is preserved; on a miss the generic
459                    // error is returned unchanged.
460                    match protocol
461                        .deserialize_error_response(response, _cfg)
462                        .ok()
463                        .and_then(|mut deser| {
464                            ::aws_smithy_schema::registry::reify_error(
465                                crate::operation::register_client::error_registry::REGISTRY
466                                    .or(&crate::error_type_registry::REGISTRY),
467                                error_code,
468                                &mut *deser,
469                            )
470                        }) {
471                        ::std::option::Option::Some(source) => <crate::operation::register_client::RegisterClientError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
472                        ::std::option::Option::None => crate::operation::register_client::RegisterClientError::generic(generic),
473                    }
474                }
475            };
476            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
477                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
478            ))
479        } else {
480            let protocol = _cfg
481                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
482                .expect("a SharedClientProtocol is required");
483            let mut deser = protocol
484                .deserialize_response(response, RegisterClient::OUTPUT_SCHEMA, _cfg)
485                .map_err(|e| {
486                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
487                })?;
488            // `headers` is already in scope from the top of the function; alias it as
489            // `_response_headers` so MutateOutput customizations have a stable name to
490            // read from.
491            let _response_headers = headers;
492            // `mut` is required because `deserialize_members` and the `MutateOutput`
493            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
494            // empty output has no members and no customizations to run.
495            #[allow(unused_mut)]
496            let mut output = <crate::operation::register_client::builders::RegisterClientOutputBuilder>::default();
497            output.deserialize_members(&mut *deser).map_err(|e| {
498                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
499            })?;
500            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
501            let output = output.build();
502            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
503        }
504    }
505}
506#[derive(Debug)]
507struct RegisterClientRequestSerializer;
508impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RegisterClientRequestSerializer {
509    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
510    fn serialize_input(
511        &self,
512        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
513        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
514    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
515        let input = input
516            .downcast::<crate::operation::register_client::RegisterClientInput>()
517            .expect("correct type");
518
519        let protocol = _cfg
520            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
521            .expect("a SharedClientProtocol is required");
522        let mut request = protocol
523            .serialize_request(&input, RegisterClient::INPUT_SCHEMA, "", _cfg)
524            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
525
526        return ::std::result::Result::Ok(request);
527    }
528}
529#[derive(Debug)]
530struct RegisterClientEndpointParamsInterceptor;
531
532#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
533impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RegisterClientEndpointParamsInterceptor {
534    fn name(&self) -> &'static str {
535        "RegisterClientEndpointParamsInterceptor"
536    }
537
538    fn read_before_execution(
539        &self,
540        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
541            '_,
542            ::aws_smithy_runtime_api::client::interceptors::context::Input,
543            ::aws_smithy_runtime_api::client::interceptors::context::Output,
544            ::aws_smithy_runtime_api::client::interceptors::context::Error,
545        >,
546        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
547    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
548        let _input = context
549            .input()
550            .downcast_ref::<RegisterClientInput>()
551            .ok_or("failed to downcast to RegisterClientInput")?;
552
553        let params = crate::config::endpoint::Params::builder()
554            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
555            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
556            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
557            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
558            .build()
559            .map_err(|err| {
560                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
561            })?;
562        cfg.interceptor_state()
563            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
564        ::std::result::Result::Ok(())
565    }
566}
567
568// The get_* functions below are generated from JMESPath expressions in the
569// operationContextParams trait. They target the operation's input shape.
570
571/// Error type for the `RegisterClientError` operation.
572#[non_exhaustive]
573#[derive(::std::fmt::Debug)]
574pub enum RegisterClientError {
575    /// <p>Indicates that an error from the service occurred while trying to process a request.</p>
576    InternalServerException(crate::types::error::InternalServerException),
577    /// <p>Indicates that the client information sent in the request during registration is invalid.</p>
578    InvalidClientMetadataException(crate::types::error::InvalidClientMetadataException),
579    /// <p>Indicates that one or more redirect URI in the request is not supported for this operation.</p>
580    InvalidRedirectUriException(crate::types::error::InvalidRedirectUriException),
581    /// <p>Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.</p>
582    InvalidRequestException(crate::types::error::InvalidRequestException),
583    /// <p>Indicates that the scope provided in the request is invalid.</p>
584    InvalidScopeException(crate::types::error::InvalidScopeException),
585    /// <p>Indicates that the client is making the request too frequently and is more than the service can handle.</p>
586    SlowDownException(crate::types::error::SlowDownException),
587    /// <p>Indicates that the grant type in the request is not supported by the service.</p>
588    UnsupportedGrantTypeException(crate::types::error::UnsupportedGrantTypeException),
589    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
590    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
591    variable wildcard pattern and check `.code()`:
592     \
593    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
594     \
595    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RegisterClientError) for what information is available for the error.")]
596    Unhandled(crate::error::sealed_unhandled::Unhandled),
597}
598impl RegisterClientError {
599    /// Creates the `RegisterClientError::Unhandled` variant from any error type.
600    pub fn unhandled(
601        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
602    ) -> Self {
603        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
604            source: err.into(),
605            meta: ::std::default::Default::default(),
606        })
607    }
608
609    /// Creates the `RegisterClientError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
610    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
611        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
612            source: err.clone().into(),
613            meta: err,
614        })
615    }
616    ///
617    /// Returns error metadata, which includes the error code, message,
618    /// request ID, and potentially additional information.
619    ///
620    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
621        match self {
622            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
623            Self::InvalidClientMetadataException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
624            Self::InvalidRedirectUriException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
625            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
626            Self::InvalidScopeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
627            Self::SlowDownException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
628            Self::UnsupportedGrantTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
629            Self::Unhandled(e) => &e.meta,
630        }
631    }
632    /// Returns `true` if the error kind is `RegisterClientError::InternalServerException`.
633    pub fn is_internal_server_exception(&self) -> bool {
634        matches!(self, Self::InternalServerException(_))
635    }
636    /// Returns `true` if the error kind is `RegisterClientError::InvalidClientMetadataException`.
637    pub fn is_invalid_client_metadata_exception(&self) -> bool {
638        matches!(self, Self::InvalidClientMetadataException(_))
639    }
640    /// Returns `true` if the error kind is `RegisterClientError::InvalidRedirectUriException`.
641    pub fn is_invalid_redirect_uri_exception(&self) -> bool {
642        matches!(self, Self::InvalidRedirectUriException(_))
643    }
644    /// Returns `true` if the error kind is `RegisterClientError::InvalidRequestException`.
645    pub fn is_invalid_request_exception(&self) -> bool {
646        matches!(self, Self::InvalidRequestException(_))
647    }
648    /// Returns `true` if the error kind is `RegisterClientError::InvalidScopeException`.
649    pub fn is_invalid_scope_exception(&self) -> bool {
650        matches!(self, Self::InvalidScopeException(_))
651    }
652    /// Returns `true` if the error kind is `RegisterClientError::SlowDownException`.
653    pub fn is_slow_down_exception(&self) -> bool {
654        matches!(self, Self::SlowDownException(_))
655    }
656    /// Returns `true` if the error kind is `RegisterClientError::UnsupportedGrantTypeException`.
657    pub fn is_unsupported_grant_type_exception(&self) -> bool {
658        matches!(self, Self::UnsupportedGrantTypeException(_))
659    }
660}
661impl ::std::error::Error for RegisterClientError {
662    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
663        match self {
664            Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
665            Self::InvalidClientMetadataException(_inner) => ::std::option::Option::Some(_inner),
666            Self::InvalidRedirectUriException(_inner) => ::std::option::Option::Some(_inner),
667            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
668            Self::InvalidScopeException(_inner) => ::std::option::Option::Some(_inner),
669            Self::SlowDownException(_inner) => ::std::option::Option::Some(_inner),
670            Self::UnsupportedGrantTypeException(_inner) => ::std::option::Option::Some(_inner),
671            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
672        }
673    }
674}
675impl ::std::fmt::Display for RegisterClientError {
676    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
677        match self {
678            Self::InternalServerException(_inner) => _inner.fmt(f),
679            Self::InvalidClientMetadataException(_inner) => _inner.fmt(f),
680            Self::InvalidRedirectUriException(_inner) => _inner.fmt(f),
681            Self::InvalidRequestException(_inner) => _inner.fmt(f),
682            Self::InvalidScopeException(_inner) => _inner.fmt(f),
683            Self::SlowDownException(_inner) => _inner.fmt(f),
684            Self::UnsupportedGrantTypeException(_inner) => _inner.fmt(f),
685            Self::Unhandled(_inner) => {
686                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
687                    write!(f, "unhandled error ({code})")
688                } else {
689                    f.write_str("unhandled error")
690                }
691            }
692        }
693    }
694}
695impl ::aws_smithy_types::retry::ProvideErrorKind for RegisterClientError {
696    fn code(&self) -> ::std::option::Option<&str> {
697        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
698    }
699    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
700        ::std::option::Option::None
701    }
702}
703impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RegisterClientError {
704    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
705        match self {
706            Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
707            Self::InvalidClientMetadataException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
708            Self::InvalidRedirectUriException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
709            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
710            Self::InvalidScopeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
711            Self::SlowDownException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
712            Self::UnsupportedGrantTypeException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
713            Self::Unhandled(_inner) => &_inner.meta,
714        }
715    }
716}
717impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RegisterClientError {
718    fn create_unhandled_error(
719        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
720        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
721    ) -> Self {
722        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
723            source,
724            meta: meta.unwrap_or_default(),
725        })
726    }
727}
728impl ::aws_types::request_id::RequestId for crate::operation::register_client::RegisterClientError {
729    fn request_id(&self) -> Option<&str> {
730        self.meta().request_id()
731    }
732}
733
734pub use crate::operation::register_client::_register_client_input::RegisterClientInput;
735
736pub use crate::operation::register_client::_register_client_output::RegisterClientOutput;
737
738mod _register_client_input;
739
740mod _register_client_output;
741
742/// Builders
743pub mod builders;