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