aws_sdk_organizations/types/error/
_too_many_requests_exception.rs1#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct TooManyRequestsException {
8 #[allow(missing_docs)] pub r#type: ::std::option::Option<::std::string::String>,
10 #[allow(missing_docs)] pub message: ::std::option::Option<::std::string::String>,
12 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
13}
14impl TooManyRequestsException {
15 #[allow(missing_docs)] pub fn r#type(&self) -> ::std::option::Option<&str> {
17 self.r#type.as_deref()
18 }
19}
20impl TooManyRequestsException {
21 pub fn message(&self) -> ::std::option::Option<&str> {
23 self.message.as_deref()
24 }
25}
26impl ::std::fmt::Display for TooManyRequestsException {
27 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28 ::std::write!(f, "TooManyRequestsException")?;
29 if let ::std::option::Option::Some(inner_1) = &self.message {
30 {
31 ::std::write!(f, ": {}", inner_1)?;
32 }
33 }
34 Ok(())
35 }
36}
37impl ::std::error::Error for TooManyRequestsException {}
38impl ::aws_types::request_id::RequestId for crate::types::error::TooManyRequestsException {
39 fn request_id(&self) -> Option<&str> {
40 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
41 self.meta().request_id()
42 }
43}
44impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TooManyRequestsException {
45 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
46 &self.meta
47 }
48}
49impl TooManyRequestsException {
50 pub fn builder() -> crate::types::error::builders::TooManyRequestsExceptionBuilder {
52 crate::types::error::builders::TooManyRequestsExceptionBuilder::default()
53 }
54}
55
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct TooManyRequestsExceptionBuilder {
60 pub(crate) r#type: ::std::option::Option<::std::string::String>,
61 pub(crate) message: ::std::option::Option<::std::string::String>,
62 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
63}
64impl TooManyRequestsExceptionBuilder {
65 #[allow(missing_docs)] pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.r#type = ::std::option::Option::Some(input.into());
68 self
69 }
70 #[allow(missing_docs)] pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.r#type = input;
73 self
74 }
75 #[allow(missing_docs)] pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
77 &self.r#type
78 }
79 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.message = ::std::option::Option::Some(input.into());
82 self
83 }
84 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.message = input;
87 self
88 }
89 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
91 &self.message
92 }
93 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
95 self.meta = Some(meta);
96 self
97 }
98
99 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
101 self.meta = meta;
102 self
103 }
104 pub fn build(self) -> crate::types::error::TooManyRequestsException {
106 crate::types::error::TooManyRequestsException {
107 r#type: self.r#type,
108 message: self.message,
109 meta: self.meta.unwrap_or_default(),
110 }
111 }
112}