1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>The request caused OpsItems to exceed one or more quotas.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct OpsItemLimitExceededException {
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub limit: i32,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub limit_type: ::std::option::Option<::std::string::String>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub message: ::std::option::Option<::std::string::String>,
|
15 + | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
16 + | }
|
17 + | impl OpsItemLimitExceededException {
|
18 + | #[allow(missing_docs)] // documentation missing in model
|
19 + | ///
|
20 + | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
|
21 + | pub fn resource_types(&self) -> &[::std::string::String] {
|
22 + | self.resource_types.as_deref().unwrap_or_default()
|
23 + | }
|
24 + | #[allow(missing_docs)] // documentation missing in model
|
25 + | pub fn limit(&self) -> i32 {
|
26 + | self.limit
|
27 + | }
|
28 + | #[allow(missing_docs)] // documentation missing in model
|
29 + | pub fn limit_type(&self) -> ::std::option::Option<&str> {
|
30 + | self.limit_type.as_deref()
|
31 + | }
|
32 + | }
|
33 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_RESOURCE_TYPES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
34 + | ::aws_smithy_schema::ShapeId::from_parts(
|
35 + | "com.amazonaws.ssm#OpsItemParameterNamesList$member",
|
36 + | "com.amazonaws.ssm",
|
37 + | "OpsItemParameterNamesList",
|
38 + | ),
|
39 + | ::aws_smithy_schema::ShapeType::String,
|
40 + | "member",
|
41 + | 0,
|
42 + | );
|
43 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_RESOURCE_TYPES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
44 + | ::aws_smithy_schema::ShapeId::from_parts(
|
45 + | "com.amazonaws.ssm#OpsItemLimitExceededException$ResourceTypes",
|
46 + | "com.amazonaws.ssm",
|
47 + | "OpsItemLimitExceededException",
|
48 + | ),
|
49 + | ::aws_smithy_schema::ShapeType::List,
|
50 + | "ResourceTypes",
|
51 + | 0,
|
52 + | )
|
53 + | .with_list_member(&OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_RESOURCE_TYPES_MEMBER);
|
54 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
55 + | ::aws_smithy_schema::ShapeId::from_parts(
|
56 + | "com.amazonaws.ssm#OpsItemLimitExceededException$Limit",
|
57 + | "com.amazonaws.ssm",
|
58 + | "OpsItemLimitExceededException",
|
59 + | ),
|
60 + | ::aws_smithy_schema::ShapeType::Integer,
|
61 + | "Limit",
|
62 + | 1,
|
63 + | );
|
64 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
65 + | ::aws_smithy_schema::ShapeId::from_parts(
|
66 + | "com.amazonaws.ssm#OpsItemLimitExceededException$LimitType",
|
67 + | "com.amazonaws.ssm",
|
68 + | "OpsItemLimitExceededException",
|
69 + | ),
|
70 + | ::aws_smithy_schema::ShapeType::String,
|
71 + | "LimitType",
|
72 + | 2,
|
73 + | );
|
74 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
75 + | ::aws_smithy_schema::ShapeId::from_parts(
|
76 + | "com.amazonaws.ssm#OpsItemLimitExceededException$Message",
|
77 + | "com.amazonaws.ssm",
|
78 + | "OpsItemLimitExceededException",
|
79 + | ),
|
80 + | ::aws_smithy_schema::ShapeType::String,
|
81 + | "Message",
|
82 + | 3,
|
83 + | );
|
84 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_TRAITS: std::sync::LazyLock<::aws_smithy_schema::TraitMap> = std::sync::LazyLock::new(|| {
|
85 + | let mut map = ::aws_smithy_schema::TraitMap::new();
|
86 + | map.insert(Box::new(::aws_smithy_schema::DocumentTrait::new(
|
87 + | ::aws_smithy_schema::ShapeId::from_parts("aws.protocols#awsQueryError", "aws.protocols", "awsQueryError"),
|
88 + | {
|
89 + | let mut obj = ::aws_smithy_types::document::DocumentObject::new();
|
90 + | obj.insert(
|
91 + | "code".to_string(),
|
92 + | ::aws_smithy_types::Document::String("OpsItemLimitExceededException".to_string()),
|
93 + | );
|
94 + | obj.insert(
|
95 + | "httpResponseCode".to_string(),
|
96 + | ::aws_smithy_types::Document::Number(::aws_smithy_types::Number::PosInt(400u64)),
|
97 + | );
|
98 + | ::aws_smithy_types::Document::Object(obj)
|
99 + | },
|
100 + | )));
|
101 + | map
|
102 + | });
|
103 + | static OPSITEMLIMITEXCEEDEDEXCEPTION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
104 + | ::aws_smithy_schema::ShapeId::from_parts(
|
105 + | "com.amazonaws.ssm#OpsItemLimitExceededException",
|
106 + | "com.amazonaws.ssm",
|
107 + | "OpsItemLimitExceededException",
|
108 + | ),
|
109 + | ::aws_smithy_schema::ShapeType::Structure,
|
110 + | &[
|
111 + | &OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_RESOURCE_TYPES,
|
112 + | &OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT,
|
113 + | &OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT_TYPE,
|
114 + | &OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_MESSAGE,
|
115 + | ],
|
116 + | )
|
117 + | .with_traits(&OPSITEMLIMITEXCEEDEDEXCEPTION_TRAITS);
|
118 + | impl OpsItemLimitExceededException {
|
119 + | /// The schema for this shape.
|
120 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &OPSITEMLIMITEXCEEDEDEXCEPTION_SCHEMA;
|
121 + | }
|
122 + | impl ::aws_smithy_schema::serde::SerializableStruct for OpsItemLimitExceededException {
|
123 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
124 + | fn serialize_members(
|
125 + | &self,
|
126 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
127 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
128 + | if let Some(ref val) = self.resource_types {
|
129 + | ser.write_list(
|
130 + | &OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_RESOURCE_TYPES,
|
131 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
132 + | for item in val {
|
133 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
134 + | }
|
135 + | Ok(())
|
136 + | },
|
137 + | )?;
|
138 + | }
|
139 + | {
|
140 + | let val = &self.limit;
|
141 + | ser.write_integer(&OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT, *val)?;
|
142 + | }
|
143 + | if let Some(ref val) = self.limit_type {
|
144 + | ser.write_string(&OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_LIMIT_TYPE, val)?;
|
145 + | }
|
146 + | if let Some(ref val) = self.message {
|
147 + | ser.write_string(&OPSITEMLIMITEXCEEDEDEXCEPTION_MEMBER_MESSAGE, val)?;
|
148 + | }
|
149 + | Ok(())
|
150 + | }
|
151 + | }
|
152 + | impl OpsItemLimitExceededException {
|
153 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
154 + | pub fn deserialize(
|
155 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
156 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
157 + | #[allow(unused_variables, unused_mut)]
|
158 + | let mut builder = Self::builder();
|
159 + | #[allow(
|
160 + | unused_variables,
|
161 + | unreachable_code,
|
162 + | clippy::single_match,
|
163 + | clippy::match_single_binding,
|
164 + | clippy::diverging_sub_expression
|
165 + | )]
|
166 + | deserializer.read_struct(&OPSITEMLIMITEXCEEDEDEXCEPTION_SCHEMA, &mut |member, deser| {
|
167 + | match member.member_index() {
|
168 + | Some(0) => {
|
169 + | if deser.is_null() {
|
170 + | deser.read_null()?;
|
171 + | } else {
|
172 + | builder.resource_types = Some(deser.read_string_list(member)?);
|
173 + | }
|
174 + | }
|
175 + | Some(1) => {
|
176 + | builder.limit = Some(deser.read_integer(member)?);
|
177 + | }
|
178 + | Some(2) => {
|
179 + | if deser.is_null() {
|
180 + | deser.read_null()?;
|
181 + | } else {
|
182 + | builder.limit_type = Some(deser.read_string(member)?);
|
183 + | }
|
184 + | }
|
185 + | Some(3) => {
|
186 + | if deser.is_null() {
|
187 + | deser.read_null()?;
|
188 + | } else {
|
189 + | builder.message = Some(deser.read_string(member)?);
|
190 + | }
|
191 + | }
|
192 + | _ => {}
|
193 + | }
|
194 + | Ok(())
|
195 + | })?;
|
196 + | Ok(builder.build())
|
197 + | }
|
198 + | }
|
199 + | impl OpsItemLimitExceededException {
|
200 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
201 + | pub fn deserialize_with_response(
|
202 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
203 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
204 + | _status: u16,
|
205 + | body: &[u8],
|
206 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
207 + | if body.is_empty() {
|
208 + | return Ok(Self::builder().build());
|
209 + | }
|
210 + | Self::deserialize(deserializer)
|
211 + | }
|
212 + | }
|
213 + | impl OpsItemLimitExceededException {
|
214 + | /// Returns the error message.
|
215 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
216 + | self.message.as_deref()
|
217 + | }
|
218 + | }
|
219 + | impl ::std::fmt::Display for OpsItemLimitExceededException {
|
220 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
221 + | ::std::write!(f, "OpsItemLimitExceededException")?;
|
222 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
223 + | {
|
224 + | ::std::write!(f, ": {inner_1}")?;
|
225 + | }
|
226 + | }
|
227 + | Ok(())
|
228 + | }
|
229 + | }
|
230 + | impl ::std::error::Error for OpsItemLimitExceededException {}
|
231 + | impl ::aws_types::request_id::RequestId for crate::types::error::OpsItemLimitExceededException {
|
232 + | fn request_id(&self) -> Option<&str> {
|
233 + | use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
|
234 + | self.meta().request_id()
|
235 + | }
|
236 + | }
|
237 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for OpsItemLimitExceededException {
|
238 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
239 + | &self.meta
|
240 + | }
|
241 + | }
|
242 + | impl OpsItemLimitExceededException {
|
243 + | /// Creates a new builder-style object to manufacture [`OpsItemLimitExceededException`](crate::types::error::OpsItemLimitExceededException).
|
244 + | pub fn builder() -> crate::types::error::builders::OpsItemLimitExceededExceptionBuilder {
|
245 + | crate::types::error::builders::OpsItemLimitExceededExceptionBuilder::default()
|
246 + | }
|
247 + | }
|
248 + |
|
249 + | /// A builder for [`OpsItemLimitExceededException`](crate::types::error::OpsItemLimitExceededException).
|
250 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
251 + | #[non_exhaustive]
|
252 + | pub struct OpsItemLimitExceededExceptionBuilder {
|
253 + | pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
254 + | pub(crate) limit: ::std::option::Option<i32>,
|
255 + | pub(crate) limit_type: ::std::option::Option<::std::string::String>,
|
256 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
257 + | meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
258 + | }
|
259 + | impl OpsItemLimitExceededExceptionBuilder {
|
260 + | /// Appends an item to `resource_types`.
|
261 + | ///
|
262 + | /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
|
263 + | ///
|
264 + | pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
265 + | let mut v = self.resource_types.unwrap_or_default();
|
266 + | v.push(input.into());
|
267 + | self.resource_types = ::std::option::Option::Some(v);
|
268 + | self
|
269 + | }
|
270 + | #[allow(missing_docs)] // documentation missing in model
|
271 + | pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
|
272 + | self.resource_types = input;
|
273 + | self
|
274 + | }
|
275 + | #[allow(missing_docs)] // documentation missing in model
|
276 + | pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
|
277 + | &self.resource_types
|
278 + | }
|
279 + | #[allow(missing_docs)] // documentation missing in model
|
280 + | pub fn limit(mut self, input: i32) -> Self {
|
281 + | self.limit = ::std::option::Option::Some(input);
|
282 + | self
|
283 + | }
|
284 + | #[allow(missing_docs)] // documentation missing in model
|
285 + | pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
|
286 + | self.limit = input;
|
287 + | self
|
288 + | }
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | pub fn get_limit(&self) -> &::std::option::Option<i32> {
|
291 + | &self.limit
|
292 + | }
|
293 + | #[allow(missing_docs)] // documentation missing in model
|
294 + | pub fn limit_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
295 + | self.limit_type = ::std::option::Option::Some(input.into());
|
296 + | self
|
297 + | }
|
298 + | #[allow(missing_docs)] // documentation missing in model
|
299 + | pub fn set_limit_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
300 + | self.limit_type = input;
|
301 + | self
|
302 + | }
|
303 + | #[allow(missing_docs)] // documentation missing in model
|
304 + | pub fn get_limit_type(&self) -> &::std::option::Option<::std::string::String> {
|
305 + | &self.limit_type
|
306 + | }
|
307 + | #[allow(missing_docs)] // documentation missing in model
|
308 + | pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
309 + | self.message = ::std::option::Option::Some(input.into());
|
310 + | self
|
311 + | }
|
312 + | #[allow(missing_docs)] // documentation missing in model
|
313 + | pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
314 + | self.message = input;
|
315 + | self
|
316 + | }
|
317 + | #[allow(missing_docs)] // documentation missing in model
|
318 + | pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
|
319 + | &self.message
|
320 + | }
|
321 + | /// Sets error metadata
|
322 + | pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
323 + | self.meta = Some(meta);
|
324 + | self
|
325 + | }
|
326 + |
|
327 + | /// Sets error metadata
|
328 + | pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
|
329 + | self.meta = meta;
|
330 + | self
|
331 + | }
|
332 + | /// Consumes the builder and constructs a [`OpsItemLimitExceededException`](crate::types::error::OpsItemLimitExceededException).
|
333 + | pub fn build(self) -> crate::types::error::OpsItemLimitExceededException {
|
334 + | crate::types::error::OpsItemLimitExceededException {
|
335 + | resource_types: self.resource_types,
|
336 + | limit: self.limit.unwrap_or_default(),
|
337 + | limit_type: self.limit_type,
|
338 + | message: self.message,
|
339 + | meta: self.meta.unwrap_or_default(),
|
340 + | }
|
341 + | }
|
342 + | }
|