1#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateToken;
6impl CreateToken {
7 pub fn new() -> Self {
9 Self
10 }
11 pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_token::CreateTokenInput::SCHEMA;
13 pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::create_token::CreateTokenOutput::SCHEMA;
15 pub(crate) async fn orchestrate(
16 runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
17 input: crate::operation::create_token::CreateTokenInput,
18 ) -> ::std::result::Result<crate::operation::create_token::CreateTokenOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_token::CreateTokenError, ::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::create_token::CreateTokenError>().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::create_token::CreateTokenOutput>().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::create_token::CreateTokenInput,
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 "CreateToken",
41 input,
42 runtime_plugins,
43 stop_point
44 )
45 .instrument(::tracing::debug_span!(
48 "SSO OIDC.CreateToken",
49 "rpc.service" = "SSO OIDC",
50 "rpc.method" = "CreateToken",
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 CreateToken {
76 fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
77 let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateToken");
78
79 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateTokenRequestSerializer));
80 cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateTokenResponseDeserializer));
81
82 cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
83 crate::config::auth::Params::builder()
84 .operation_name("CreateToken")
85 .build()
86 .expect("required fields set")
87 ));
88
89 cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
90cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
91 "CreateToken",
92 "SSO OIDC",
93 ));
94
95 ::std::option::Option::Some(cfg.freeze())
96 }
97
98 fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
99 #[allow(unused_mut)]
100 let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateToken")
101 .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
102.with_interceptor(CreateTokenEndpointParamsInterceptor)
103 .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::create_token::CreateTokenError>::new())
104.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::create_token::CreateTokenError>::new())
105.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::create_token::CreateTokenError>::new());
106
107 ::std::borrow::Cow::Owned(rcb)
108 }
109 }
110
111
112#[derive(Debug)]
113 struct CreateTokenResponseDeserializer;
114 impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateTokenResponseDeserializer {
115
116
117 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 {
118 let (success, status) = (response.status().is_success(), response.status().as_u16());
119 #[allow(unused_mut)]
120 let mut force_error = false;
121 ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
122 if !success && status != 200 || force_error {
123 let headers = response.headers();
124 let body = response.body().bytes().expect("body loaded");
125#[allow(unused_mut)]
126 let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body)
127 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
128 generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
129 let generic = generic_builder.build();
130let error_code = match generic.code() {
131 ::std::option::Option::Some(code) => code,
132 ::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::create_token::CreateTokenError::unhandled(generic)))),
133 };
134 let _error_message = generic.message().map(|msg| msg.to_owned());
135 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
136 .expect("a SharedClientProtocol is required");
137let err = match error_code {
138"AccessDeniedException" => crate::operation::create_token::CreateTokenError::AccessDeniedException({
139let mut tmp = match protocol.deserialize_response(response, crate::types::error::AccessDeniedException::SCHEMA, _cfg)
140 .and_then(|mut deser| crate::types::error::AccessDeniedException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
141 {
142 ::std::result::Result::Ok(val) => val,
143 ::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))),
144 };
145 tmp.meta = generic;
146if tmp.message.is_none() {
147 tmp.message = _error_message;
148 }
149tmp
150}),
151"AuthorizationPendingException" => crate::operation::create_token::CreateTokenError::AuthorizationPendingException({
152let mut tmp = match protocol.deserialize_response(response, crate::types::error::AuthorizationPendingException::SCHEMA, _cfg)
153 .and_then(|mut deser| crate::types::error::AuthorizationPendingException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
154 {
155 ::std::result::Result::Ok(val) => val,
156 ::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))),
157 };
158 tmp.meta = generic;
159if tmp.message.is_none() {
160 tmp.message = _error_message;
161 }
162tmp
163}),
164"ExpiredTokenException" => crate::operation::create_token::CreateTokenError::ExpiredTokenException({
165let mut tmp = match protocol.deserialize_response(response, crate::types::error::ExpiredTokenException::SCHEMA, _cfg)
166 .and_then(|mut deser| crate::types::error::ExpiredTokenException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
167 {
168 ::std::result::Result::Ok(val) => val,
169 ::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))),
170 };
171 tmp.meta = generic;
172if tmp.message.is_none() {
173 tmp.message = _error_message;
174 }
175tmp
176}),
177"InternalServerException" => crate::operation::create_token::CreateTokenError::InternalServerException({
178let mut tmp = match protocol.deserialize_response(response, crate::types::error::InternalServerException::SCHEMA, _cfg)
179 .and_then(|mut deser| crate::types::error::InternalServerException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
180 {
181 ::std::result::Result::Ok(val) => val,
182 ::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))),
183 };
184 tmp.meta = generic;
185if tmp.message.is_none() {
186 tmp.message = _error_message;
187 }
188tmp
189}),
190"InvalidClientException" => crate::operation::create_token::CreateTokenError::InvalidClientException({
191let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidClientException::SCHEMA, _cfg)
192 .and_then(|mut deser| crate::types::error::InvalidClientException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
193 {
194 ::std::result::Result::Ok(val) => val,
195 ::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))),
196 };
197 tmp.meta = generic;
198if tmp.message.is_none() {
199 tmp.message = _error_message;
200 }
201tmp
202}),
203"InvalidGrantException" => crate::operation::create_token::CreateTokenError::InvalidGrantException({
204let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidGrantException::SCHEMA, _cfg)
205 .and_then(|mut deser| crate::types::error::InvalidGrantException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
206 {
207 ::std::result::Result::Ok(val) => val,
208 ::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))),
209 };
210 tmp.meta = generic;
211if tmp.message.is_none() {
212 tmp.message = _error_message;
213 }
214tmp
215}),
216"InvalidRequestException" => crate::operation::create_token::CreateTokenError::InvalidRequestException({
217let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidRequestException::SCHEMA, _cfg)
218 .and_then(|mut deser| crate::types::error::InvalidRequestException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
219 {
220 ::std::result::Result::Ok(val) => val,
221 ::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))),
222 };
223 tmp.meta = generic;
224if tmp.message.is_none() {
225 tmp.message = _error_message;
226 }
227tmp
228}),
229"InvalidScopeException" => crate::operation::create_token::CreateTokenError::InvalidScopeException({
230let mut tmp = match protocol.deserialize_response(response, crate::types::error::InvalidScopeException::SCHEMA, _cfg)
231 .and_then(|mut deser| crate::types::error::InvalidScopeException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
232 {
233 ::std::result::Result::Ok(val) => val,
234 ::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))),
235 };
236 tmp.meta = generic;
237if tmp.message.is_none() {
238 tmp.message = _error_message;
239 }
240tmp
241}),
242"SlowDownException" => crate::operation::create_token::CreateTokenError::SlowDownException({
243let mut tmp = match protocol.deserialize_response(response, crate::types::error::SlowDownException::SCHEMA, _cfg)
244 .and_then(|mut deser| crate::types::error::SlowDownException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
245 {
246 ::std::result::Result::Ok(val) => val,
247 ::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))),
248 };
249 tmp.meta = generic;
250if tmp.message.is_none() {
251 tmp.message = _error_message;
252 }
253tmp
254}),
255"UnauthorizedClientException" => crate::operation::create_token::CreateTokenError::UnauthorizedClientException({
256let mut tmp = match protocol.deserialize_response(response, crate::types::error::UnauthorizedClientException::SCHEMA, _cfg)
257 .and_then(|mut deser| crate::types::error::UnauthorizedClientException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
258 {
259 ::std::result::Result::Ok(val) => val,
260 ::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))),
261 };
262 tmp.meta = generic;
263if tmp.message.is_none() {
264 tmp.message = _error_message;
265 }
266tmp
267}),
268"UnsupportedGrantTypeException" => crate::operation::create_token::CreateTokenError::UnsupportedGrantTypeException({
269let mut tmp = match protocol.deserialize_response(response, crate::types::error::UnsupportedGrantTypeException::SCHEMA, _cfg)
270 .and_then(|mut deser| crate::types::error::UnsupportedGrantTypeException::deserialize_with_response(&mut *deser, response.headers(), response.status().into(), body))
271 {
272 ::std::result::Result::Ok(val) => val,
273 ::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))),
274 };
275 tmp.meta = generic;
276if tmp.message.is_none() {
277 tmp.message = _error_message;
278 }
279tmp
280}),
281_ => crate::operation::create_token::CreateTokenError::generic(generic)
282};
283 ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err)))
284} else {
285 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
286 .expect("a SharedClientProtocol is required");
287 let mut deser = protocol.deserialize_response(response, CreateToken::OUTPUT_SCHEMA, _cfg)
288 .map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
289 let body = response.body().bytes().expect("body loaded");
290 let output = crate::operation::create_token::CreateTokenOutput::deserialize_with_response(
291 &mut *deser,
292 response.headers(),
293 response.status().into(),
294 body,
295 ).map_err(|e| ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e)))?;
296 ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
297 }
298 }
299 }
300#[derive(Debug)]
301 struct CreateTokenRequestSerializer;
302 impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateTokenRequestSerializer {
303 #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
304 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> {
305 let input = input.downcast::<crate::operation::create_token::CreateTokenInput>().expect("correct type");
306 let protocol = _cfg.load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
307 .expect("a SharedClientProtocol is required");
308 let mut request = protocol.serialize_request(
309 &input, CreateToken::INPUT_SCHEMA, "", _cfg,
310 ).map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
311
312 return ::std::result::Result::Ok(request);
313 }
314 }
315#[derive(Debug)]
316 struct CreateTokenEndpointParamsInterceptor;
317
318 impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTokenEndpointParamsInterceptor {
319 fn name(&self) -> &'static str {
320 "CreateTokenEndpointParamsInterceptor"
321 }
322
323 fn read_before_execution(
324 &self,
325 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>,
326 cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
327 ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
328 let _input = context.input()
329 .downcast_ref::<CreateTokenInput>()
330 .ok_or("failed to downcast to CreateTokenInput")?;
331
332
333
334 let params = crate::config::endpoint::Params::builder()
335 .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
336.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
337.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
338.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
339 .build()
340 .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
341 cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
342 ::std::result::Result::Ok(())
343 }
344 }
345
346 #[non_exhaustive]
353#[derive(::std::fmt::Debug)]
354pub enum CreateTokenError {
355 AccessDeniedException(crate::types::error::AccessDeniedException),
357 AuthorizationPendingException(crate::types::error::AuthorizationPendingException),
359 ExpiredTokenException(crate::types::error::ExpiredTokenException),
361 InternalServerException(crate::types::error::InternalServerException),
363 InvalidClientException(crate::types::error::InvalidClientException),
365 InvalidGrantException(crate::types::error::InvalidGrantException),
367 InvalidRequestException(crate::types::error::InvalidRequestException),
369 InvalidScopeException(crate::types::error::InvalidScopeException),
371 SlowDownException(crate::types::error::SlowDownException),
373 UnauthorizedClientException(crate::types::error::UnauthorizedClientException),
375 UnsupportedGrantTypeException(crate::types::error::UnsupportedGrantTypeException),
377 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
379 variable wildcard pattern and check `.code()`:
380 \
381 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
382 \
383 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateTokenError) for what information is available for the error.")]
384 Unhandled(crate::error::sealed_unhandled::Unhandled),
385}
386impl CreateTokenError {
387 pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
389 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
390 }
391
392 pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
394 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
395 }
396 pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
401 match self {
402 Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
403 Self::AuthorizationPendingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
404 Self::ExpiredTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
405 Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
406 Self::InvalidClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
407 Self::InvalidGrantException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
408 Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
409 Self::InvalidScopeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
410 Self::SlowDownException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
411 Self::UnauthorizedClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
412 Self::UnsupportedGrantTypeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413 Self::Unhandled(e) => &e.meta,
414 }
415 }
416 pub fn is_access_denied_exception(&self) -> bool {
418 matches!(self, Self::AccessDeniedException(_))
419 }
420 pub fn is_authorization_pending_exception(&self) -> bool {
422 matches!(self, Self::AuthorizationPendingException(_))
423 }
424 pub fn is_expired_token_exception(&self) -> bool {
426 matches!(self, Self::ExpiredTokenException(_))
427 }
428 pub fn is_internal_server_exception(&self) -> bool {
430 matches!(self, Self::InternalServerException(_))
431 }
432 pub fn is_invalid_client_exception(&self) -> bool {
434 matches!(self, Self::InvalidClientException(_))
435 }
436 pub fn is_invalid_grant_exception(&self) -> bool {
438 matches!(self, Self::InvalidGrantException(_))
439 }
440 pub fn is_invalid_request_exception(&self) -> bool {
442 matches!(self, Self::InvalidRequestException(_))
443 }
444 pub fn is_invalid_scope_exception(&self) -> bool {
446 matches!(self, Self::InvalidScopeException(_))
447 }
448 pub fn is_slow_down_exception(&self) -> bool {
450 matches!(self, Self::SlowDownException(_))
451 }
452 pub fn is_unauthorized_client_exception(&self) -> bool {
454 matches!(self, Self::UnauthorizedClientException(_))
455 }
456 pub fn is_unsupported_grant_type_exception(&self) -> bool {
458 matches!(self, Self::UnsupportedGrantTypeException(_))
459 }
460}
461impl ::std::error::Error for CreateTokenError {
462 fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
463 match self {
464 Self::AccessDeniedException(_inner) =>
465 ::std::option::Option::Some(_inner)
466 ,
467 Self::AuthorizationPendingException(_inner) =>
468 ::std::option::Option::Some(_inner)
469 ,
470 Self::ExpiredTokenException(_inner) =>
471 ::std::option::Option::Some(_inner)
472 ,
473 Self::InternalServerException(_inner) =>
474 ::std::option::Option::Some(_inner)
475 ,
476 Self::InvalidClientException(_inner) =>
477 ::std::option::Option::Some(_inner)
478 ,
479 Self::InvalidGrantException(_inner) =>
480 ::std::option::Option::Some(_inner)
481 ,
482 Self::InvalidRequestException(_inner) =>
483 ::std::option::Option::Some(_inner)
484 ,
485 Self::InvalidScopeException(_inner) =>
486 ::std::option::Option::Some(_inner)
487 ,
488 Self::SlowDownException(_inner) =>
489 ::std::option::Option::Some(_inner)
490 ,
491 Self::UnauthorizedClientException(_inner) =>
492 ::std::option::Option::Some(_inner)
493 ,
494 Self::UnsupportedGrantTypeException(_inner) =>
495 ::std::option::Option::Some(_inner)
496 ,
497 Self::Unhandled(_inner) => {
498 ::std::option::Option::Some(&*_inner.source)
499 }
500 }
501 }
502}
503impl ::std::fmt::Display for CreateTokenError {
504 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
505 match self {
506 Self::AccessDeniedException(_inner) =>
507 _inner.fmt(f)
508 ,
509 Self::AuthorizationPendingException(_inner) =>
510 _inner.fmt(f)
511 ,
512 Self::ExpiredTokenException(_inner) =>
513 _inner.fmt(f)
514 ,
515 Self::InternalServerException(_inner) =>
516 _inner.fmt(f)
517 ,
518 Self::InvalidClientException(_inner) =>
519 _inner.fmt(f)
520 ,
521 Self::InvalidGrantException(_inner) =>
522 _inner.fmt(f)
523 ,
524 Self::InvalidRequestException(_inner) =>
525 _inner.fmt(f)
526 ,
527 Self::InvalidScopeException(_inner) =>
528 _inner.fmt(f)
529 ,
530 Self::SlowDownException(_inner) =>
531 _inner.fmt(f)
532 ,
533 Self::UnauthorizedClientException(_inner) =>
534 _inner.fmt(f)
535 ,
536 Self::UnsupportedGrantTypeException(_inner) =>
537 _inner.fmt(f)
538 ,
539 Self::Unhandled(_inner) => {
540 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
541 write!(f, "unhandled error ({code})")
542 } else {
543 f.write_str("unhandled error")
544 }
545 }
546 }
547 }
548}
549impl ::aws_smithy_types::retry::ProvideErrorKind for CreateTokenError {
550 fn code(&self) -> ::std::option::Option<&str> {
551 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
552 }
553 fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
554 ::std::option::Option::None
555 }
556}
557impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateTokenError {
558 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
559 match self {
560 Self::AccessDeniedException(_inner) =>
561 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
562 ,
563 Self::AuthorizationPendingException(_inner) =>
564 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
565 ,
566 Self::ExpiredTokenException(_inner) =>
567 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
568 ,
569 Self::InternalServerException(_inner) =>
570 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
571 ,
572 Self::InvalidClientException(_inner) =>
573 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
574 ,
575 Self::InvalidGrantException(_inner) =>
576 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
577 ,
578 Self::InvalidRequestException(_inner) =>
579 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
580 ,
581 Self::InvalidScopeException(_inner) =>
582 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
583 ,
584 Self::SlowDownException(_inner) =>
585 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
586 ,
587 Self::UnauthorizedClientException(_inner) =>
588 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
589 ,
590 Self::UnsupportedGrantTypeException(_inner) =>
591 ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
592 ,
593 Self::Unhandled(_inner) => {
594 &_inner.meta
595 }
596 }
597 }
598}
599impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateTokenError {
600 fn create_unhandled_error(
601 source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
602 meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
603 ) -> Self {
604 Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
605 }
606}
607impl ::aws_types::request_id::RequestId for crate::operation::create_token::CreateTokenError {
608 fn request_id(&self) -> Option<&str> {
609 self.meta().request_id()
610 }
611 }
612
613pub use crate::operation::create_token::_create_token_input::CreateTokenInput;
614
615pub use crate::operation::create_token::_create_token_output::CreateTokenOutput;
616
617mod _create_token_input;
618
619mod _create_token_output;
620
621pub mod builders;
623