1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// <p>One or more content items isn't valid.</p>
|
4 + | #[non_exhaustive]
|
5 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 + | pub struct InvalidItemContentException {
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub type_name: ::std::option::Option<::std::string::String>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub message: ::std::option::Option<::std::string::String>,
|
11 + | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
12 + | }
|
13 + | impl InvalidItemContentException {
|
14 + | #[allow(missing_docs)] // documentation missing in model
|
15 + | pub fn type_name(&self) -> ::std::option::Option<&str> {
|
16 + | self.type_name.as_deref()
|
17 + | }
|
18 + | }
|
19 + | static INVALIDITEMCONTENTEXCEPTION_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
20 + | ::aws_smithy_schema::ShapeId::from_parts(
|
21 + | "com.amazonaws.ssm#InvalidItemContentException$TypeName",
|
22 + | "com.amazonaws.ssm",
|
23 + | "InvalidItemContentException",
|
24 + | ),
|
25 + | ::aws_smithy_schema::ShapeType::String,
|
26 + | "TypeName",
|
27 + | 0,
|
28 + | );
|
29 + | static INVALIDITEMCONTENTEXCEPTION_MEMBER_MESSAGE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
|
30 + | ::aws_smithy_schema::ShapeId::from_parts(
|
31 + | "com.amazonaws.ssm#InvalidItemContentException$Message",
|
32 + | "com.amazonaws.ssm",
|
33 + | "InvalidItemContentException",
|
34 + | ),
|
35 + | ::aws_smithy_schema::ShapeType::String,
|
36 + | "Message",
|
37 + | 1,
|
38 + | );
|
39 + | static INVALIDITEMCONTENTEXCEPTION_TRAITS: std::sync::LazyLock<::aws_smithy_schema::TraitMap> = std::sync::LazyLock::new(|| {
|
40 + | let mut map = ::aws_smithy_schema::TraitMap::new();
|
41 + | map.insert(Box::new(::aws_smithy_schema::DocumentTrait::new(
|
42 + | ::aws_smithy_schema::ShapeId::from_parts("aws.protocols#awsQueryError", "aws.protocols", "awsQueryError"),
|
43 + | {
|
44 + | let mut obj = ::aws_smithy_types::document::DocumentObject::new();
|
45 + | obj.insert("code".to_string(), ::aws_smithy_types::Document::String("InvalidItemContent".to_string()));
|
46 + | obj.insert(
|
47 + | "httpResponseCode".to_string(),
|
48 + | ::aws_smithy_types::Document::Number(::aws_smithy_types::Number::PosInt(400u64)),
|
49 + | );
|
50 + | ::aws_smithy_types::Document::Object(obj)
|
51 + | },
|
52 + | )));
|
53 + | map
|
54 + | });
|
55 + | static INVALIDITEMCONTENTEXCEPTION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
|
56 + | ::aws_smithy_schema::ShapeId::from_parts(
|
57 + | "com.amazonaws.ssm#InvalidItemContentException",
|
58 + | "com.amazonaws.ssm",
|
59 + | "InvalidItemContentException",
|
60 + | ),
|
61 + | ::aws_smithy_schema::ShapeType::Structure,
|
62 + | &[&INVALIDITEMCONTENTEXCEPTION_MEMBER_TYPE_NAME, &INVALIDITEMCONTENTEXCEPTION_MEMBER_MESSAGE],
|
63 + | )
|
64 + | .with_traits(&INVALIDITEMCONTENTEXCEPTION_TRAITS);
|
65 + | impl InvalidItemContentException {
|
66 + | /// The schema for this shape.
|
67 + | pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &INVALIDITEMCONTENTEXCEPTION_SCHEMA;
|
68 + | }
|
69 + | impl ::aws_smithy_schema::serde::SerializableStruct for InvalidItemContentException {
|
70 + | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
71 + | fn serialize_members(
|
72 + | &self,
|
73 + | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
74 + | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
75 + | if let Some(ref val) = self.type_name {
|
76 + | ser.write_string(&INVALIDITEMCONTENTEXCEPTION_MEMBER_TYPE_NAME, val)?;
|
77 + | }
|
78 + | if let Some(ref val) = self.message {
|
79 + | ser.write_string(&INVALIDITEMCONTENTEXCEPTION_MEMBER_MESSAGE, val)?;
|
80 + | }
|
81 + | Ok(())
|
82 + | }
|
83 + | }
|
84 + | impl InvalidItemContentException {
|
85 + | /// Deserializes this structure from a [`ShapeDeserializer`].
|
86 + | pub fn deserialize(
|
87 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
88 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
89 + | #[allow(unused_variables, unused_mut)]
|
90 + | let mut builder = Self::builder();
|
91 + | #[allow(
|
92 + | unused_variables,
|
93 + | unreachable_code,
|
94 + | clippy::single_match,
|
95 + | clippy::match_single_binding,
|
96 + | clippy::diverging_sub_expression
|
97 + | )]
|
98 + | deserializer.read_struct(&INVALIDITEMCONTENTEXCEPTION_SCHEMA, &mut |member, deser| {
|
99 + | match member.member_index() {
|
100 + | Some(0) => {
|
101 + | if deser.is_null() {
|
102 + | deser.read_null()?;
|
103 + | } else {
|
104 + | builder.type_name = Some(deser.read_string(member)?);
|
105 + | }
|
106 + | }
|
107 + | Some(1) => {
|
108 + | if deser.is_null() {
|
109 + | deser.read_null()?;
|
110 + | } else {
|
111 + | builder.message = Some(deser.read_string(member)?);
|
112 + | }
|
113 + | }
|
114 + | _ => {}
|
115 + | }
|
116 + | Ok(())
|
117 + | })?;
|
118 + | Ok(builder.build())
|
119 + | }
|
120 + | }
|
121 + | impl InvalidItemContentException {
|
122 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
123 + | pub fn deserialize_with_response(
|
124 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
125 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
126 + | _status: u16,
|
127 + | body: &[u8],
|
128 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
129 + | if body.is_empty() {
|
130 + | return Ok(Self::builder().build());
|
131 + | }
|
132 + | Self::deserialize(deserializer)
|
133 + | }
|
134 + | }
|
135 + | impl InvalidItemContentException {
|
136 + | /// Returns the error message.
|
137 + | pub fn message(&self) -> ::std::option::Option<&str> {
|
138 + | self.message.as_deref()
|
139 + | }
|
140 + | }
|
141 + | impl ::std::fmt::Display for InvalidItemContentException {
|
142 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
143 + | ::std::write!(f, "InvalidItemContentException")?;
|
144 + | if let ::std::option::Option::Some(inner_1) = &self.message {
|
145 + | {
|
146 + | ::std::write!(f, ": {inner_1}")?;
|
147 + | }
|
148 + | }
|
149 + | Ok(())
|
150 + | }
|
151 + | }
|
152 + | impl ::std::error::Error for InvalidItemContentException {}
|
153 + | impl ::aws_types::request_id::RequestId for crate::types::error::InvalidItemContentException {
|
154 + | fn request_id(&self) -> Option<&str> {
|
155 + | use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
|
156 + | self.meta().request_id()
|
157 + | }
|
158 + | }
|
159 + | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InvalidItemContentException {
|
160 + | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
161 + | &self.meta
|
162 + | }
|
163 + | }
|
164 + | impl InvalidItemContentException {
|
165 + | /// Creates a new builder-style object to manufacture [`InvalidItemContentException`](crate::types::error::InvalidItemContentException).
|
166 + | pub fn builder() -> crate::types::error::builders::InvalidItemContentExceptionBuilder {
|
167 + | crate::types::error::builders::InvalidItemContentExceptionBuilder::default()
|
168 + | }
|
169 + | }
|
170 + |
|
171 + | /// A builder for [`InvalidItemContentException`](crate::types::error::InvalidItemContentException).
|
172 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
173 + | #[non_exhaustive]
|
174 + | pub struct InvalidItemContentExceptionBuilder {
|
175 + | pub(crate) type_name: ::std::option::Option<::std::string::String>,
|
176 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
177 + | meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
178 + | }
|
179 + | impl InvalidItemContentExceptionBuilder {
|
180 + | #[allow(missing_docs)] // documentation missing in model
|
181 + | pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
182 + | self.type_name = ::std::option::Option::Some(input.into());
|
183 + | self
|
184 + | }
|
185 + | #[allow(missing_docs)] // documentation missing in model
|
186 + | pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
187 + | self.type_name = input;
|
188 + | self
|
189 + | }
|
190 + | #[allow(missing_docs)] // documentation missing in model
|
191 + | pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
|
192 + | &self.type_name
|
193 + | }
|
194 + | #[allow(missing_docs)] // documentation missing in model
|
195 + | pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
196 + | self.message = ::std::option::Option::Some(input.into());
|
197 + | self
|
198 + | }
|
199 + | #[allow(missing_docs)] // documentation missing in model
|
200 + | pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
201 + | self.message = input;
|
202 + | self
|
203 + | }
|
204 + | #[allow(missing_docs)] // documentation missing in model
|
205 + | pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
|
206 + | &self.message
|
207 + | }
|
208 + | /// Sets error metadata
|
209 + | pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
210 + | self.meta = Some(meta);
|
211 + | self
|
212 + | }
|
213 + |
|
214 + | /// Sets error metadata
|
215 + | pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
|
216 + | self.meta = meta;
|
217 + | self
|
218 + | }
|
219 + | /// Consumes the builder and constructs a [`InvalidItemContentException`](crate::types::error::InvalidItemContentException).
|
220 + | pub fn build(self) -> crate::types::error::InvalidItemContentException {
|
221 + | crate::types::error::InvalidItemContentException {
|
222 + | type_name: self.type_name,
|
223 + | message: self.message,
|
224 + | meta: self.meta.unwrap_or_default(),
|
225 + | }
|
226 + | }
|
227 + | }
|