aws_sdk_ivschat/types/error/
_service_quota_exceeded_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ServiceQuotaExceededException {
7 #[allow(missing_docs)] pub message: ::std::string::String,
9 pub resource_id: ::std::string::String,
11 pub resource_type: crate::types::ResourceType,
13 pub limit: i32,
15 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
16}
17impl ServiceQuotaExceededException {
18 pub fn resource_id(&self) -> &str {
20 use std::ops::Deref;
21 self.resource_id.deref()
22 }
23 pub fn resource_type(&self) -> &crate::types::ResourceType {
25 &self.resource_type
26 }
27 pub fn limit(&self) -> i32 {
29 self.limit
30 }
31}
32impl ServiceQuotaExceededException {
33 pub fn message(&self) -> &str {
35 &self.message
36 }
37}
38impl ::std::fmt::Display for ServiceQuotaExceededException {
39 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
40 ::std::write!(f, "ServiceQuotaExceededException")?;
41 {
42 ::std::write!(f, ": {}", &self.message)?;
43 }
44 Ok(())
45 }
46}
47impl ::std::error::Error for ServiceQuotaExceededException {}
48impl ::aws_types::request_id::RequestId for crate::types::error::ServiceQuotaExceededException {
49 fn request_id(&self) -> Option<&str> {
50 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
51 self.meta().request_id()
52 }
53}
54impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ServiceQuotaExceededException {
55 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
56 &self.meta
57 }
58}
59impl ServiceQuotaExceededException {
60 pub fn builder() -> crate::types::error::builders::ServiceQuotaExceededExceptionBuilder {
62 crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default()
63 }
64}
65
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct ServiceQuotaExceededExceptionBuilder {
70 pub(crate) message: ::std::option::Option<::std::string::String>,
71 pub(crate) resource_id: ::std::option::Option<::std::string::String>,
72 pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
73 pub(crate) limit: ::std::option::Option<i32>,
74 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
75}
76impl ServiceQuotaExceededExceptionBuilder {
77 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 self.message = ::std::option::Option::Some(input.into());
81 self
82 }
83 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.message = input;
86 self
87 }
88 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
90 &self.message
91 }
92 pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95 self.resource_id = ::std::option::Option::Some(input.into());
96 self
97 }
98 pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.resource_id = input;
101 self
102 }
103 pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
105 &self.resource_id
106 }
107 pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
110 self.resource_type = ::std::option::Option::Some(input);
111 self
112 }
113 pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
115 self.resource_type = input;
116 self
117 }
118 pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
120 &self.resource_type
121 }
122 pub fn limit(mut self, input: i32) -> Self {
125 self.limit = ::std::option::Option::Some(input);
126 self
127 }
128 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
130 self.limit = input;
131 self
132 }
133 pub fn get_limit(&self) -> &::std::option::Option<i32> {
135 &self.limit
136 }
137 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
139 self.meta = Some(meta);
140 self
141 }
142
143 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
145 self.meta = meta;
146 self
147 }
148 pub fn build(
154 self,
155 ) -> ::std::result::Result<crate::types::error::ServiceQuotaExceededException, ::aws_smithy_types::error::operation::BuildError> {
156 ::std::result::Result::Ok(crate::types::error::ServiceQuotaExceededException {
157 message: self.message.ok_or_else(|| {
158 ::aws_smithy_types::error::operation::BuildError::missing_field(
159 "message",
160 "message was not specified but it is required when building ServiceQuotaExceededException",
161 )
162 })?,
163 resource_id: self.resource_id.ok_or_else(|| {
164 ::aws_smithy_types::error::operation::BuildError::missing_field(
165 "resource_id",
166 "resource_id was not specified but it is required when building ServiceQuotaExceededException",
167 )
168 })?,
169 resource_type: self.resource_type.ok_or_else(|| {
170 ::aws_smithy_types::error::operation::BuildError::missing_field(
171 "resource_type",
172 "resource_type was not specified but it is required when building ServiceQuotaExceededException",
173 )
174 })?,
175 limit: self.limit.unwrap_or_default(),
176 meta: self.meta.unwrap_or_default(),
177 })
178 }
179}