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