aws_sdk_cloud9/types/error/
_too_many_requests_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TooManyRequestsException {
7 #[allow(missing_docs)] pub message: ::std::option::Option<::std::string::String>,
9 #[allow(missing_docs)] pub class_name: ::std::option::Option<::std::string::String>,
11 #[allow(missing_docs)] pub code: i32,
13 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
14}
15impl TooManyRequestsException {
16 #[allow(missing_docs)] pub fn class_name(&self) -> ::std::option::Option<&str> {
18 self.class_name.as_deref()
19 }
20 #[allow(missing_docs)] pub fn code(&self) -> i32 {
22 self.code
23 }
24}
25impl TooManyRequestsException {
26 pub fn message(&self) -> ::std::option::Option<&str> {
28 self.message.as_deref()
29 }
30}
31impl ::std::fmt::Display for TooManyRequestsException {
32 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
33 ::std::write!(f, "TooManyRequestsException")?;
34 if let ::std::option::Option::Some(inner_1) = &self.message {
35 {
36 ::std::write!(f, ": {inner_1}")?;
37 }
38 }
39 Ok(())
40 }
41}
42impl ::std::error::Error for TooManyRequestsException {}
43impl ::aws_types::request_id::RequestId for crate::types::error::TooManyRequestsException {
44 fn request_id(&self) -> Option<&str> {
45 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
46 self.meta().request_id()
47 }
48}
49impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TooManyRequestsException {
50 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
51 &self.meta
52 }
53}
54impl TooManyRequestsException {
55 pub fn builder() -> crate::types::error::builders::TooManyRequestsExceptionBuilder {
57 crate::types::error::builders::TooManyRequestsExceptionBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct TooManyRequestsExceptionBuilder {
65 pub(crate) message: ::std::option::Option<::std::string::String>,
66 pub(crate) class_name: ::std::option::Option<::std::string::String>,
67 pub(crate) code: ::std::option::Option<i32>,
68 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
69}
70impl TooManyRequestsExceptionBuilder {
71 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.message = ::std::option::Option::Some(input.into());
74 self
75 }
76 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.message = input;
79 self
80 }
81 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
83 &self.message
84 }
85 #[allow(missing_docs)] pub fn class_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.class_name = ::std::option::Option::Some(input.into());
88 self
89 }
90 #[allow(missing_docs)] pub fn set_class_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.class_name = input;
93 self
94 }
95 #[allow(missing_docs)] pub fn get_class_name(&self) -> &::std::option::Option<::std::string::String> {
97 &self.class_name
98 }
99 #[allow(missing_docs)] pub fn code(mut self, input: i32) -> Self {
101 self.code = ::std::option::Option::Some(input);
102 self
103 }
104 #[allow(missing_docs)] pub fn set_code(mut self, input: ::std::option::Option<i32>) -> Self {
106 self.code = input;
107 self
108 }
109 #[allow(missing_docs)] pub fn get_code(&self) -> &::std::option::Option<i32> {
111 &self.code
112 }
113 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
115 self.meta = Some(meta);
116 self
117 }
118
119 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
121 self.meta = meta;
122 self
123 }
124 pub fn build(self) -> crate::types::error::TooManyRequestsException {
126 crate::types::error::TooManyRequestsException {
127 message: self.message,
128 class_name: self.class_name,
129 code: self.code.unwrap_or_default(),
130 meta: self.meta.unwrap_or_default(),
131 }
132 }
133}