aws_sdk_ssooidc/operation/
start_device_authorization.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `StartDeviceAuthorization`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartDeviceAuthorization;
6impl StartDeviceAuthorization {
7    /// Creates a new `StartDeviceAuthorization`
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 = crate::operation::start_device_authorization::StartDeviceAuthorizationInput::SCHEMA;
13                    /// The schema for this operation's output shape.
14                    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::start_device_authorization::StartDeviceAuthorizationOutput::SCHEMA;
15    pub(crate) async fn orchestrate(
16                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17                        input: crate::operation::start_device_authorization::StartDeviceAuthorizationInput,
18                    ) -> ::std::result::Result<crate::operation::start_device_authorization::StartDeviceAuthorizationOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_device_authorization::StartDeviceAuthorizationError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
19                        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>| {
20                            err.map_service_error(|err| {
21                                err.downcast::<crate::operation::start_device_authorization::StartDeviceAuthorizationError>().expect("correct error type")
22                            })
23                        };
24                        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
25                            .await
26                            .map_err(map_err)?;
27                        let output = context.finalize().map_err(map_err)?;
28                        ::std::result::Result::Ok(output.downcast::<crate::operation::start_device_authorization::StartDeviceAuthorizationOutput>().expect("correct output type"))
29                    }
30    
31                    pub(crate) async fn orchestrate_with_stop_point(
32                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
33                        input: crate::operation::start_device_authorization::StartDeviceAuthorizationInput,
34                        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
35                    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
36                        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
37                        use ::tracing::Instrument;
38                        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
39                            "SSO OIDC",
40                            "StartDeviceAuthorization",
41                            input,
42                            runtime_plugins,
43                            stop_point
44                        )
45                        // Create a parent span for the entire operation. Includes a random, internal-only,
46                        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
47                        .instrument(::tracing::debug_span!(
48                                "SSO OIDC.StartDeviceAuthorization",
49                                "rpc.service" = "SSO OIDC",
50                                "rpc.method" = "StartDeviceAuthorization",
51                                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
52                                "rpc.system" = "aws-api",
53                            ))
54                        .await
55                    }
56    
57                    pub(crate) fn operation_runtime_plugins(
58                        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
59                        client_config: &crate::config::Config,
60                        config_override: ::std::option::Option<crate::config::Builder>,
61                    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
62                        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
63                        
64                        if let ::std::option::Option::Some(config_override) = config_override {
65                            for plugin in config_override.runtime_plugins.iter().cloned() {
66                                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
67                            }
68                            runtime_plugins = runtime_plugins.with_operation_plugin(
69                                crate::config::ConfigOverrideRuntimePlugin::new(config_override, client_config.config.clone(), &client_config.runtime_components)
70                            );
71                        }
72                        runtime_plugins
73                    }
74}
75impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartDeviceAuthorization {
76                fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77                    let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartDeviceAuthorization");
78
79                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(StartDeviceAuthorizationRequestSerializer));
80                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(StartDeviceAuthorizationResponseDeserializer));
81
82                    cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83                        crate::config::auth::Params::builder()
84                            .operation_name("StartDeviceAuthorization")
85                            .build()
86                            .expect("required fields set")
87                    ));
88
89                    cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
90                            "StartDeviceAuthorization",
91                            "SSO OIDC",
92                        ));
93
94                    ::std::option::Option::Some(cfg.freeze())
95                }
96
97                fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
98                    #[allow(unused_mut)]
99                    let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartDeviceAuthorization")
100                            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
101.with_interceptor(StartDeviceAuthorizationEndpointParamsInterceptor)
102                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::start_device_authorization::StartDeviceAuthorizationError>::new())
103.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::start_device_authorization::StartDeviceAuthorizationError>::new())
104.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::start_device_authorization::StartDeviceAuthorizationError>::new());
105
106                    ::std::borrow::Cow::Owned(rcb)
107                }
108            }
109
110            
111#[derive(Debug)]
112            struct StartDeviceAuthorizationResponseDeserializer;
113            impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartDeviceAuthorizationResponseDeserializer {
114                
115
116                fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
117                    let (success, status) = (response.status().is_success(), response.status().as_u16());
118            #[allow(unused_mut)]
119            let mut force_error = false;
120            ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
121            if !success && status != 200 || force_error {
122                let headers = response.headers();
123                let body = response.body().bytes().expect("body loaded");
124#[allow(unused_mut)]
125            let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body)
126                .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
127            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
128            let generic = generic_builder.build();
129let error_code = match generic.code() {
130                    ::std::option::Option::Some(code) => code,
131                    ::std::option::Option::None => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::start_device_authorization::StartDeviceAuthorizationError::unhandled(generic)))),
132                };
133                let _error_message = generic.message().map(|msg| msg.to_owned());
134                let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
135                    .expect("a SharedClientProtocol is required");
136let err = match error_code {
137"InternalServerException" => crate::operation::start_device_authorization::StartDeviceAuthorizationError::InternalServerException({
138let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerException::SCHEMA, _cfg)
139                        .and_then(|mut deser| crate::types::error::InternalServerException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
140                    {
141                        ::std::result::Result::Ok(val) => val,
142                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
143                    };
144                    tmp.meta = generic;
145if tmp.message.is_none() {
146                                tmp.message = _error_message;
147                            }
148tmp
149}),
150"InvalidClientException" => crate::operation::start_device_authorization::StartDeviceAuthorizationError::InvalidClientException({
151let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidClientException::SCHEMA, _cfg)
152                        .and_then(|mut deser| crate::types::error::InvalidClientException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
153                    {
154                        ::std::result::Result::Ok(val) => val,
155                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
156                    };
157                    tmp.meta = generic;
158if tmp.message.is_none() {
159                                tmp.message = _error_message;
160                            }
161tmp
162}),
163"InvalidRequestException" => crate::operation::start_device_authorization::StartDeviceAuthorizationError::InvalidRequestException({
164let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidRequestException::SCHEMA, _cfg)
165                        .and_then(|mut deser| crate::types::error::InvalidRequestException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
166                    {
167                        ::std::result::Result::Ok(val) => val,
168                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
169                    };
170                    tmp.meta = generic;
171if tmp.message.is_none() {
172                                tmp.message = _error_message;
173                            }
174tmp
175}),
176"SlowDownException" => crate::operation::start_device_authorization::StartDeviceAuthorizationError::SlowDownException({
177let mut tmp = match protocol.deserialize_response(response, crate::types::error::SlowDownException::SCHEMA, _cfg)
178                        .and_then(|mut deser| crate::types::error::SlowDownException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
179                    {
180                        ::std::result::Result::Ok(val) => val,
181                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
182                    };
183                    tmp.meta = generic;
184if tmp.message.is_none() {
185                                tmp.message = _error_message;
186                            }
187tmp
188}),
189"UnauthorizedClientException" => crate::operation::start_device_authorization::StartDeviceAuthorizationError::UnauthorizedClientException({
190let mut tmp = match protocol.deserialize_response(response, crate::types::error::UnauthorizedClientException::SCHEMA, _cfg)
191                        .and_then(|mut deser| crate::types::error::UnauthorizedClientException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
192                    {
193                        ::std::result::Result::Ok(val) => val,
194                        ::std::result::Result::Err(e) => return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))),
195                    };
196                    tmp.meta = generic;
197if tmp.message.is_none() {
198                                tmp.message = _error_message;
199                            }
200tmp
201}),
202_ => crate::operation::start_device_authorization::StartDeviceAuthorizationError::generic(generic)
203};
204                ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
205} else {
206                let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
207                    .expect("a SharedClientProtocol is required");
208                let mut deser = protocol.deserialize_response(response, StartDeviceAuthorization::OUTPUT_SCHEMA, _cfg)
209                    .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
210                let body = response.body().bytes().expect("body loaded");
211                let output = crate::operation::start_device_authorization::StartDeviceAuthorizationOutput::deserialize_with_response(
212                    &mut *deser,
213                    response.headers(),
214                    response.status().into(),
215                    body,
216                ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
217                ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
218            }
219                }
220            }
221#[derive(Debug)]
222            struct StartDeviceAuthorizationRequestSerializer;
223            impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartDeviceAuthorizationRequestSerializer {
224                #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
225                fn serialize_input(&self, input: ::aws_smithy_runtime_api::client::interceptors::context::Input, _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
226                    let input = input.downcast::<crate::operation::start_device_authorization::StartDeviceAuthorizationInput>().expect("correct type");
227                    let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
228                        .expect("a SharedClientProtocol is required");
229                    let mut request = protocol.serialize_request(
230                            &input, StartDeviceAuthorization::INPUT_SCHEMA, "", _cfg,
231                        ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
232                        
233                        return ::std::result::Result::Ok(request);
234                }
235            }
236#[derive(Debug)]
237            struct StartDeviceAuthorizationEndpointParamsInterceptor;
238
239            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartDeviceAuthorizationEndpointParamsInterceptor {
240                fn name(&self) -> &'static str {
241                    "StartDeviceAuthorizationEndpointParamsInterceptor"
242                }
243
244                fn read_before_execution(
245                    &self,
246                    context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<'_, ::aws_smithy_runtime_api::client::interceptors::context::Input, ::aws_smithy_runtime_api::client::interceptors::context::Output, ::aws_smithy_runtime_api::client::interceptors::context::Error>,
247                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
248                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
249                    let _input = context.input()
250                        .downcast_ref::<StartDeviceAuthorizationInput>()
251                        .ok_or("failed to downcast to StartDeviceAuthorizationInput")?;
252
253                    
254
255                    let params = crate::config::endpoint::Params::builder()
256                        .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
257.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
258.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
259.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
260                        .build()
261                        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
262                    cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
263                    ::std::result::Result::Ok(())
264                }
265            }
266
267            // The get_* functions below are generated from JMESPath expressions in the
268            // operationContextParams trait. They target the operation's input shape.
269
270            
271
272/// Error type for the `StartDeviceAuthorizationError` operation.
273#[non_exhaustive]
274#[derive(::std::fmt::Debug)]
275pub enum StartDeviceAuthorizationError {
276    /// <p>Indicates that an error from the service occurred while trying to process a request.</p>
277    InternalServerException(crate::types::error::InternalServerException),
278    /// <p>Indicates that the <code>clientId</code> or <code>clientSecret</code> in the request is invalid. For example, this can occur when a client sends an incorrect <code>clientId</code> or an expired <code>clientSecret</code>.</p>
279    InvalidClientException(crate::types::error::InvalidClientException),
280    /// <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>
281    InvalidRequestException(crate::types::error::InvalidRequestException),
282    /// <p>Indicates that the client is making the request too frequently and is more than the service can handle.</p>
283    SlowDownException(crate::types::error::SlowDownException),
284    /// <p>Indicates that the client is not currently authorized to make the request. This can happen when a <code>clientId</code> is not issued for a public client.</p>
285    UnauthorizedClientException(crate::types::error::UnauthorizedClientException),
286    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
287                    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
288    variable wildcard pattern and check `.code()`:
289     \
290    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
291     \
292    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartDeviceAuthorizationError) for what information is available for the error.")]
293                    Unhandled(crate::error::sealed_unhandled::Unhandled),
294}
295impl StartDeviceAuthorizationError {
296    /// Creates the `StartDeviceAuthorizationError::Unhandled` variant from any error type.
297                    pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
298                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
299                    }
300    
301                    /// Creates the `StartDeviceAuthorizationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
302                    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
303                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
304                    }
305    /// 
306    /// Returns error metadata, which includes the error code, message,
307    /// request ID, and potentially additional information.
308    /// 
309    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
310        match self {
311            Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
312            Self::InvalidClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
313            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
314            Self::SlowDownException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
315            Self::UnauthorizedClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
316            Self::Unhandled(e) => &e.meta,
317        }
318    }
319    /// Returns `true` if the error kind is `StartDeviceAuthorizationError::InternalServerException`.
320    pub fn is_internal_server_exception(&self) -> bool {
321        matches!(self, Self::InternalServerException(_))
322    }
323    /// Returns `true` if the error kind is `StartDeviceAuthorizationError::InvalidClientException`.
324    pub fn is_invalid_client_exception(&self) -> bool {
325        matches!(self, Self::InvalidClientException(_))
326    }
327    /// Returns `true` if the error kind is `StartDeviceAuthorizationError::InvalidRequestException`.
328    pub fn is_invalid_request_exception(&self) -> bool {
329        matches!(self, Self::InvalidRequestException(_))
330    }
331    /// Returns `true` if the error kind is `StartDeviceAuthorizationError::SlowDownException`.
332    pub fn is_slow_down_exception(&self) -> bool {
333        matches!(self, Self::SlowDownException(_))
334    }
335    /// Returns `true` if the error kind is `StartDeviceAuthorizationError::UnauthorizedClientException`.
336    pub fn is_unauthorized_client_exception(&self) -> bool {
337        matches!(self, Self::UnauthorizedClientException(_))
338    }
339}
340impl ::std::error::Error for StartDeviceAuthorizationError {
341    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
342        match self {
343            Self::InternalServerException(_inner) =>
344            ::std::option::Option::Some(_inner)
345            ,
346            Self::InvalidClientException(_inner) =>
347            ::std::option::Option::Some(_inner)
348            ,
349            Self::InvalidRequestException(_inner) =>
350            ::std::option::Option::Some(_inner)
351            ,
352            Self::SlowDownException(_inner) =>
353            ::std::option::Option::Some(_inner)
354            ,
355            Self::UnauthorizedClientException(_inner) =>
356            ::std::option::Option::Some(_inner)
357            ,
358            Self::Unhandled(_inner) => {
359                ::std::option::Option::Some(&*_inner.source)
360            }
361        }
362    }
363}
364impl ::std::fmt::Display for StartDeviceAuthorizationError {
365    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
366        match self {
367            Self::InternalServerException(_inner) =>
368            _inner.fmt(f)
369            ,
370            Self::InvalidClientException(_inner) =>
371            _inner.fmt(f)
372            ,
373            Self::InvalidRequestException(_inner) =>
374            _inner.fmt(f)
375            ,
376            Self::SlowDownException(_inner) =>
377            _inner.fmt(f)
378            ,
379            Self::UnauthorizedClientException(_inner) =>
380            _inner.fmt(f)
381            ,
382            Self::Unhandled(_inner) => {
383                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
384                                                        write!(f, "unhandled error ({code})")
385                                                    } else {
386                                                        f.write_str("unhandled error")
387                                                    }
388            }
389        }
390    }
391}
392impl ::aws_smithy_types::retry::ProvideErrorKind for StartDeviceAuthorizationError {
393    fn code(&self) -> ::std::option::Option<&str> {
394        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
395    }
396    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
397        ::std::option::Option::None
398    }
399}
400impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartDeviceAuthorizationError {
401    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
402        match self {
403            Self::InternalServerException(_inner) =>
404            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
405            ,
406            Self::InvalidClientException(_inner) =>
407            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
408            ,
409            Self::InvalidRequestException(_inner) =>
410            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
411            ,
412            Self::SlowDownException(_inner) =>
413            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
414            ,
415            Self::UnauthorizedClientException(_inner) =>
416            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
417            ,
418            Self::Unhandled(_inner) => {
419                &_inner.meta
420            }
421        }
422    }
423}
424impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartDeviceAuthorizationError {
425    fn create_unhandled_error(
426                        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
427                        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
428                    ) -> Self {
429        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
430    }
431}
432impl ::aws_types::request_id::RequestId for crate::operation::start_device_authorization::StartDeviceAuthorizationError {
433                                fn request_id(&self) -> Option<&str> {
434                                    self.meta().request_id()
435                                }
436                            }
437
438pub use crate::operation::start_device_authorization::_start_device_authorization_input::StartDeviceAuthorizationInput;
439
440pub use crate::operation::start_device_authorization::_start_device_authorization_output::StartDeviceAuthorizationOutput;
441
442mod _start_device_authorization_input;
443
444mod _start_device_authorization_output;
445
446/// Builders
447pub mod builders;
448