aws_sdk_ebs/types/error/
_request_throttled_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RequestThrottledException {
7 #[allow(missing_docs)] pub message: ::std::option::Option<::std::string::String>,
9 pub reason: ::std::option::Option<crate::types::RequestThrottledExceptionReason>,
11 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl RequestThrottledException {
14 pub fn reason(&self) -> ::std::option::Option<&crate::types::RequestThrottledExceptionReason> {
16 self.reason.as_ref()
17 }
18}
19impl RequestThrottledException {
20 pub fn message(&self) -> ::std::option::Option<&str> {
22 self.message.as_deref()
23 }
24}
25impl ::std::fmt::Display for RequestThrottledException {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 ::std::write!(f, "RequestThrottledException")?;
28 if let ::std::option::Option::Some(inner_1) = &self.message {
29 {
30 ::std::write!(f, ": {inner_1}")?;
31 }
32 }
33 Ok(())
34 }
35}
36impl ::std::error::Error for RequestThrottledException {}
37impl ::aws_types::request_id::RequestId for crate::types::error::RequestThrottledException {
38 fn request_id(&self) -> Option<&str> {
39 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
40 self.meta().request_id()
41 }
42}
43impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RequestThrottledException {
44 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
45 &self.meta
46 }
47}
48impl RequestThrottledException {
49 pub fn builder() -> crate::types::error::builders::RequestThrottledExceptionBuilder {
51 crate::types::error::builders::RequestThrottledExceptionBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct RequestThrottledExceptionBuilder {
59 pub(crate) message: ::std::option::Option<::std::string::String>,
60 pub(crate) reason: ::std::option::Option<crate::types::RequestThrottledExceptionReason>,
61 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
62}
63impl RequestThrottledExceptionBuilder {
64 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.message = ::std::option::Option::Some(input.into());
67 self
68 }
69 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.message = input;
72 self
73 }
74 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
76 &self.message
77 }
78 pub fn reason(mut self, input: crate::types::RequestThrottledExceptionReason) -> Self {
80 self.reason = ::std::option::Option::Some(input);
81 self
82 }
83 pub fn set_reason(mut self, input: ::std::option::Option<crate::types::RequestThrottledExceptionReason>) -> Self {
85 self.reason = input;
86 self
87 }
88 pub fn get_reason(&self) -> &::std::option::Option<crate::types::RequestThrottledExceptionReason> {
90 &self.reason
91 }
92 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
94 self.meta = Some(meta);
95 self
96 }
97
98 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
100 self.meta = meta;
101 self
102 }
103 pub fn build(self) -> crate::types::error::RequestThrottledException {
105 crate::types::error::RequestThrottledException {
106 message: self.message,
107 reason: self.reason,
108 meta: self.meta.unwrap_or_default(),
109 }
110 }
111}