aws_sdk_sts/types/error/
_idp_communication_error_exception.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request could not be fulfilled because the identity provider (IDP) that was asked to verify the incoming identity token could not be reached. This is often a transient error caused by network conditions. Retry the request a limited number of times so that you don't exceed the request rate. If the error persists, the identity provider might be down or not responding.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct IdpCommunicationErrorException {
7    #[allow(missing_docs)] // documentation missing in model
8    pub message: ::std::option::Option<::std::string::String>,
9    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
10}
11impl IdpCommunicationErrorException {
12    /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`.
13    pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind {
14        ::aws_smithy_types::retry::ErrorKind::ServerError
15    }
16    /// Returns the error message.
17    pub fn message(&self) -> ::std::option::Option<&str> {
18        self.message.as_deref()
19    }
20}
21impl ::std::fmt::Display for IdpCommunicationErrorException {
22    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23        ::std::write!(f, "IdpCommunicationErrorException [IDPCommunicationErrorException]")?;
24        if let ::std::option::Option::Some(inner_1) = &self.message {
25            {
26                ::std::write!(f, ": {}", inner_1)?;
27            }
28        }
29        Ok(())
30    }
31}
32impl ::std::error::Error for IdpCommunicationErrorException {}
33impl ::aws_types::request_id::RequestId for crate::types::error::IdpCommunicationErrorException {
34    fn request_id(&self) -> Option<&str> {
35        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
36        self.meta().request_id()
37    }
38}
39impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for IdpCommunicationErrorException {
40    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
41        &self.meta
42    }
43}
44impl IdpCommunicationErrorException {
45    /// Creates a new builder-style object to manufacture [`IdpCommunicationErrorException`](crate::types::error::IdpCommunicationErrorException).
46    pub fn builder() -> crate::types::error::builders::IdpCommunicationErrorExceptionBuilder {
47        crate::types::error::builders::IdpCommunicationErrorExceptionBuilder::default()
48    }
49}
50
51/// A builder for [`IdpCommunicationErrorException`](crate::types::error::IdpCommunicationErrorException).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct IdpCommunicationErrorExceptionBuilder {
55    pub(crate) message: ::std::option::Option<::std::string::String>,
56    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
57}
58impl IdpCommunicationErrorExceptionBuilder {
59    #[allow(missing_docs)] // documentation missing in model
60    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.message = ::std::option::Option::Some(input.into());
62        self
63    }
64    #[allow(missing_docs)] // documentation missing in model
65    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.message = input;
67        self
68    }
69    #[allow(missing_docs)] // documentation missing in model
70    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
71        &self.message
72    }
73    /// Sets error metadata
74    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
75        self.meta = Some(meta);
76        self
77    }
78
79    /// Sets error metadata
80    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
81        self.meta = meta;
82        self
83    }
84    /// Consumes the builder and constructs a [`IdpCommunicationErrorException`](crate::types::error::IdpCommunicationErrorException).
85    pub fn build(self) -> crate::types::error::IdpCommunicationErrorException {
86        crate::types::error::IdpCommunicationErrorException {
87            message: self.message,
88            meta: self.meta.unwrap_or_default(),
89        }
90    }
91}