1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// Describes one specific validation failure for an input member.
|
4 - | #[derive(
|
5 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 - | )]
|
7 - | pub struct ValidationExceptionField {
|
8 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 - | pub path: ::std::string::String,
|
10 - | /// A detailed description of the validation failure.
|
11 - | pub message: ::std::string::String,
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4 + | pub struct ConA {
|
5 + | #[allow(missing_docs)] // documentation missing in model
|
6 + | pub con_b: crate::model::ConB,
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub length_string: ::std::option::Option<::std::string::String>,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub min_length_string: ::std::option::Option<::std::string::String>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub max_length_string: ::std::option::Option<::std::string::String>,
|
15 + | #[allow(missing_docs)] // documentation missing in model
|
16 + | pub fixed_length_string: ::std::option::Option<::std::string::String>,
|
17 + | #[allow(missing_docs)] // documentation missing in model
|
18 + | pub length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | pub min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
21 + | #[allow(missing_docs)] // documentation missing in model
|
22 + | pub max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
23 + | #[allow(missing_docs)] // documentation missing in model
|
24 + | pub fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
25 + | #[allow(missing_docs)] // documentation missing in model
|
26 + | pub range_integer: i32,
|
27 + | #[allow(missing_docs)] // documentation missing in model
|
28 + | pub min_range_integer: i32,
|
29 + | #[allow(missing_docs)] // documentation missing in model
|
30 + | pub max_range_integer: i32,
|
31 + | #[allow(missing_docs)] // documentation missing in model
|
32 + | pub fixed_value_integer: i32,
|
33 + | #[allow(missing_docs)] // documentation missing in model
|
34 + | pub range_short: i16,
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | pub min_range_short: i16,
|
37 + | #[allow(missing_docs)] // documentation missing in model
|
38 + | pub max_range_short: i16,
|
39 + | #[allow(missing_docs)] // documentation missing in model
|
40 + | pub fixed_value_short: i16,
|
41 + | #[allow(missing_docs)] // documentation missing in model
|
42 + | pub range_long: i64,
|
43 + | #[allow(missing_docs)] // documentation missing in model
|
44 + | pub min_range_long: i64,
|
45 + | #[allow(missing_docs)] // documentation missing in model
|
46 + | pub max_range_long: i64,
|
47 + | #[allow(missing_docs)] // documentation missing in model
|
48 + | pub fixed_value_long: i64,
|
49 + | #[allow(missing_docs)] // documentation missing in model
|
50 + | pub range_byte: i8,
|
51 + | #[allow(missing_docs)] // documentation missing in model
|
52 + | pub min_range_byte: i8,
|
53 + | #[allow(missing_docs)] // documentation missing in model
|
54 + | pub max_range_byte: i8,
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | pub fixed_value_byte: i8,
|
57 + | #[allow(missing_docs)] // documentation missing in model
|
58 + | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
59 + | #[allow(missing_docs)] // documentation missing in model
|
60 + | pub length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
61 + | #[allow(missing_docs)] // documentation missing in model
|
62 + | pub sensitive_length_list:
|
63 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
64 + | #[allow(missing_docs)] // documentation missing in model
|
65 + | pub con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
66 + | #[allow(missing_docs)] // documentation missing in model
|
67 + | pub con_b_map: ::std::option::Option<
|
68 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
69 + | >,
|
70 + | #[allow(missing_docs)] // documentation missing in model
|
71 + | pub length_map: ::std::option::Option<
|
72 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
73 + | >,
|
74 + | #[allow(missing_docs)] // documentation missing in model
|
75 + | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
76 + | ::std::collections::HashMap<
|
77 + | ::std::string::String,
|
78 + | ::std::collections::HashMap<
|
79 + | ::std::string::String,
|
80 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
81 + | >,
|
82 + | >,
|
83 + | >,
|
84 + | #[allow(missing_docs)] // documentation missing in model
|
85 + | pub sparse_map: ::std::option::Option<
|
86 + | ::std::collections::HashMap<
|
87 + | ::std::string::String,
|
88 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
89 + | >,
|
90 + | >,
|
91 + | #[allow(missing_docs)] // documentation missing in model
|
92 + | pub sparse_list:
|
93 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | pub sparse_length_map: ::std::option::Option<
|
96 + | ::std::collections::HashMap<
|
97 + | ::std::string::String,
|
98 + | ::std::option::Option<::std::string::String>,
|
99 + | >,
|
100 + | >,
|
101 + | #[allow(missing_docs)] // documentation missing in model
|
102 + | pub sparse_length_list:
|
103 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
104 + | /// A union with constrained members.
|
105 + | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
106 + | #[allow(missing_docs)] // documentation missing in model
|
107 + | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
108 + | #[allow(missing_docs)] // documentation missing in model
|
109 + | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
110 + | #[allow(missing_docs)] // documentation missing in model
|
111 + | pub set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
112 + | #[allow(missing_docs)] // documentation missing in model
|
113 + | pub map_of_length_string: ::std::option::Option<
|
114 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
115 + | >,
|
116 + | #[allow(missing_docs)] // documentation missing in model
|
117 + | pub list_of_length_blob: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
118 + | #[allow(missing_docs)] // documentation missing in model
|
119 + | pub map_of_length_blob: ::std::option::Option<
|
120 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
121 + | >,
|
122 + | #[allow(missing_docs)] // documentation missing in model
|
123 + | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
124 + | #[allow(missing_docs)] // documentation missing in model
|
125 + | pub set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
126 + | #[allow(missing_docs)] // documentation missing in model
|
127 + | pub map_of_range_integer:
|
128 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
129 + | #[allow(missing_docs)] // documentation missing in model
|
130 + | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
131 + | #[allow(missing_docs)] // documentation missing in model
|
132 + | pub set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
133 + | #[allow(missing_docs)] // documentation missing in model
|
134 + | pub map_of_range_short:
|
135 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
136 + | #[allow(missing_docs)] // documentation missing in model
|
137 + | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
138 + | #[allow(missing_docs)] // documentation missing in model
|
139 + | pub set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
140 + | #[allow(missing_docs)] // documentation missing in model
|
141 + | pub map_of_range_long:
|
142 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
143 + | #[allow(missing_docs)] // documentation missing in model
|
144 + | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
145 + | #[allow(missing_docs)] // documentation missing in model
|
146 + | pub set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
147 + | #[allow(missing_docs)] // documentation missing in model
|
148 + | pub map_of_range_byte:
|
149 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
150 + | #[allow(missing_docs)] // documentation missing in model
|
151 + | pub non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
152 + | #[allow(missing_docs)] // documentation missing in model
|
153 + | pub pattern_string: ::std::option::Option<::std::string::String>,
|
154 + | #[allow(missing_docs)] // documentation missing in model
|
155 + | pub map_of_pattern_string: ::std::option::Option<
|
156 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
157 + | >,
|
158 + | #[allow(missing_docs)] // documentation missing in model
|
159 + | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
160 + | #[allow(missing_docs)] // documentation missing in model
|
161 + | pub set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
162 + | #[allow(missing_docs)] // documentation missing in model
|
163 + | pub length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
164 + | #[allow(missing_docs)] // documentation missing in model
|
165 + | pub map_of_length_pattern_string: ::std::option::Option<
|
166 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
167 + | >,
|
168 + | #[allow(missing_docs)] // documentation missing in model
|
169 + | pub list_of_length_pattern_string:
|
170 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
171 + | #[allow(missing_docs)] // documentation missing in model
|
172 + | pub set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
173 + | #[allow(missing_docs)] // documentation missing in model
|
174 + | pub length_list_of_pattern_string:
|
175 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
176 + | #[allow(missing_docs)] // documentation missing in model
|
177 + | pub length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
12 178 | }
|
13 - | impl ValidationExceptionField {
|
14 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 - | pub fn path(&self) -> &str {
|
16 - | use std::ops::Deref;
|
17 - | self.path.deref()
|
179 + | impl ConA {
|
180 + | #[allow(missing_docs)] // documentation missing in model
|
181 + | pub fn con_b(&self) -> &crate::model::ConB {
|
182 + | &self.con_b
|
18 183 | }
|
19 - | /// A detailed description of the validation failure.
|
20 - | pub fn message(&self) -> &str {
|
21 - | use std::ops::Deref;
|
22 - | self.message.deref()
|
184 + | #[allow(missing_docs)] // documentation missing in model
|
185 + | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
186 + | self.opt_con_b.as_ref()
|
23 187 | }
|
24 - | }
|
25 - | impl ValidationExceptionField {
|
26 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 - | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 - | crate::model::validation_exception_field::Builder::default()
|
188 + | #[allow(missing_docs)] // documentation missing in model
|
189 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
190 + | self.length_string.as_deref()
|
29 191 | }
|
30 - | }
|
31 - |
|
32 - | #[allow(missing_docs)] // documentation missing in model
|
33 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
34 - | pub enum Event {
|
35 192 | #[allow(missing_docs)] // documentation missing in model
|
36 - | RegularMessage(crate::model::EventStreamRegularMessage),
|
37 - | }
|
38 - | impl Event {
|
39 - | #[allow(irrefutable_let_patterns)]
|
40 - | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
41 - | /// Returns `Err(&Self)` if it can't be converted.
|
42 - | pub fn as_regular_message(
|
43 - | &self,
|
44 - | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
45 - | if let Event::RegularMessage(val) = &self {
|
46 - | ::std::result::Result::Ok(val)
|
47 - | } else {
|
48 - | ::std::result::Result::Err(self)
|
193 + | pub fn min_length_string(&self) -> ::std::option::Option<&str> {
|
194 + | self.min_length_string.as_deref()
|
49 195 | }
|
196 + | #[allow(missing_docs)] // documentation missing in model
|
197 + | pub fn max_length_string(&self) -> ::std::option::Option<&str> {
|
198 + | self.max_length_string.as_deref()
|
50 199 | }
|
51 - | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
52 - | pub fn is_regular_message(&self) -> bool {
|
53 - | self.as_regular_message().is_ok()
|
200 + | #[allow(missing_docs)] // documentation missing in model
|
201 + | pub fn fixed_length_string(&self) -> ::std::option::Option<&str> {
|
202 + | self.fixed_length_string.as_deref()
|
54 203 | }
|
55 - | }
|
56 - |
|
57 - | #[allow(missing_docs)] // documentation missing in model
|
58 - | #[derive(
|
59 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
60 - | )]
|
61 - | pub struct EventStreamRegularMessage {
|
62 204 | #[allow(missing_docs)] // documentation missing in model
|
63 - | pub message_content: ::std::option::Option<::std::string::String>,
|
64 - | }
|
65 - | impl EventStreamRegularMessage {
|
205 + | pub fn length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
206 + | self.length_blob.as_ref()
|
207 + | }
|
66 208 | #[allow(missing_docs)] // documentation missing in model
|
67 - | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
68 - | self.message_content.as_deref()
|
209 + | pub fn min_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
210 + | self.min_length_blob.as_ref()
|
69 211 | }
|
70 - | }
|
71 - | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
72 - | type Unconstrained = crate::model::event_stream_regular_message_internal::Builder;
|
73 - | }
|
74 - | impl EventStreamRegularMessage {
|
75 - | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
76 - | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
77 - | crate::model::event_stream_regular_message::Builder::default()
|
78 - | }
|
79 - | }
|
80 - |
|
81 - | #[allow(missing_docs)] // documentation missing in model
|
82 - | #[derive(
|
83 - | ::std::clone::Clone,
|
84 - | ::std::cmp::Eq,
|
85 - | ::std::cmp::Ord,
|
86 - | ::std::cmp::PartialEq,
|
87 - | ::std::cmp::PartialOrd,
|
88 - | ::std::fmt::Debug,
|
89 - | ::std::hash::Hash,
|
90 - | )]
|
91 - | pub enum EnumString {
|
92 212 | #[allow(missing_docs)] // documentation missing in model
|
93 - | M256Mega,
|
213 + | pub fn max_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
214 + | self.max_length_blob.as_ref()
|
215 + | }
|
94 216 | #[allow(missing_docs)] // documentation missing in model
|
95 - | T2Micro,
|
217 + | pub fn fixed_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
218 + | self.fixed_length_blob.as_ref()
|
219 + | }
|
96 220 | #[allow(missing_docs)] // documentation missing in model
|
97 - | T2Nano,
|
98 - | }
|
99 - | pub(crate) mod enum_string_internal {
|
100 - | #[derive(Debug, PartialEq)]
|
101 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
102 - |
|
103 - | impl ::std::fmt::Display for ConstraintViolation {
|
104 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
105 - | write!(
|
106 - | f,
|
107 - | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
108 - | )
|
221 + | pub fn range_integer(&self) -> i32 {
|
222 + | self.range_integer
|
109 223 | }
|
224 + | #[allow(missing_docs)] // documentation missing in model
|
225 + | pub fn min_range_integer(&self) -> i32 {
|
226 + | self.min_range_integer
|
110 227 | }
|
111 - |
|
112 - | impl ::std::error::Error for ConstraintViolation {}
|
113 - | impl ConstraintViolation {
|
114 - | pub(crate) fn as_validation_exception_field(
|
115 - | self,
|
116 - | path: ::std::string::String,
|
117 - | ) -> crate::model::ValidationExceptionField {
|
118 - | crate::model::ValidationExceptionField {
|
119 - | message: format!(
|
120 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
121 - | &path
|
122 - | ),
|
123 - | path,
|
228 + | #[allow(missing_docs)] // documentation missing in model
|
229 + | pub fn max_range_integer(&self) -> i32 {
|
230 + | self.max_range_integer
|
124 231 | }
|
232 + | #[allow(missing_docs)] // documentation missing in model
|
233 + | pub fn fixed_value_integer(&self) -> i32 {
|
234 + | self.fixed_value_integer
|
125 235 | }
|
236 + | #[allow(missing_docs)] // documentation missing in model
|
237 + | pub fn range_short(&self) -> i16 {
|
238 + | self.range_short
|
126 239 | }
|
127 - | }
|
128 - | impl ::std::convert::TryFrom<&str> for EnumString {
|
129 - | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
130 - | fn try_from(
|
131 - | s: &str,
|
132 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
133 - | match s {
|
134 - | "m256.mega" => Ok(EnumString::M256Mega),
|
135 - | "t2.micro" => Ok(EnumString::T2Micro),
|
136 - | "t2.nano" => Ok(EnumString::T2Nano),
|
137 - | _ => Err(crate::model::enum_string_internal::ConstraintViolation(
|
138 - | s.to_owned(),
|
139 - | )),
|
240 + | #[allow(missing_docs)] // documentation missing in model
|
241 + | pub fn min_range_short(&self) -> i16 {
|
242 + | self.min_range_short
|
140 243 | }
|
244 + | #[allow(missing_docs)] // documentation missing in model
|
245 + | pub fn max_range_short(&self) -> i16 {
|
246 + | self.max_range_short
|
141 247 | }
|
142 - | }
|
143 - | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
144 - | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
145 - | fn try_from(
|
146 - | s: ::std::string::String,
|
147 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
148 - | {
|
149 - | s.as_str().try_into()
|
248 + | #[allow(missing_docs)] // documentation missing in model
|
249 + | pub fn fixed_value_short(&self) -> i16 {
|
250 + | self.fixed_value_short
|
150 251 | }
|
151 - | }
|
152 - | impl std::str::FromStr for EnumString {
|
153 - | type Err = crate::model::enum_string_internal::ConstraintViolation;
|
154 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
155 - | Self::try_from(s)
|
252 + | #[allow(missing_docs)] // documentation missing in model
|
253 + | pub fn range_long(&self) -> i64 {
|
254 + | self.range_long
|
156 255 | }
|
157 - | }
|
158 - | impl EnumString {
|
159 - | /// Returns the `&str` value of the enum member.
|
160 - | pub fn as_str(&self) -> &str {
|
161 - | match self {
|
162 - | EnumString::M256Mega => "m256.mega",
|
163 - | EnumString::T2Micro => "t2.micro",
|
164 - | EnumString::T2Nano => "t2.nano",
|
256 + | #[allow(missing_docs)] // documentation missing in model
|
257 + | pub fn min_range_long(&self) -> i64 {
|
258 + | self.min_range_long
|
165 259 | }
|
260 + | #[allow(missing_docs)] // documentation missing in model
|
261 + | pub fn max_range_long(&self) -> i64 {
|
262 + | self.max_range_long
|
166 263 | }
|
167 - | /// Returns all the `&str` representations of the enum members.
|
168 - | pub const fn values() -> &'static [&'static str] {
|
169 - | &["m256.mega", "t2.micro", "t2.nano"]
|
264 + | #[allow(missing_docs)] // documentation missing in model
|
265 + | pub fn fixed_value_long(&self) -> i64 {
|
266 + | self.fixed_value_long
|
170 267 | }
|
171 - | }
|
172 - | impl ::std::convert::AsRef<str> for EnumString {
|
173 - | fn as_ref(&self) -> &str {
|
174 - | self.as_str()
|
268 + | #[allow(missing_docs)] // documentation missing in model
|
269 + | pub fn range_byte(&self) -> i8 {
|
270 + | self.range_byte
|
175 271 | }
|
176 - | }
|
177 - | impl crate::constrained::Constrained for EnumString {
|
178 - | type Unconstrained = ::std::string::String;
|
179 - | }
|
180 - |
|
181 - | impl ::std::convert::From<::std::string::String>
|
182 - | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
183 - | {
|
184 - | fn from(value: ::std::string::String) -> Self {
|
185 - | Self::Unconstrained(value)
|
272 + | #[allow(missing_docs)] // documentation missing in model
|
273 + | pub fn min_range_byte(&self) -> i8 {
|
274 + | self.min_range_byte
|
186 275 | }
|
187 - | }
|
188 - |
|
189 - | #[allow(missing_docs)] // documentation missing in model
|
190 - | ///
|
191 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
192 - | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
193 - | ///
|
194 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
195 - | ///
|
196 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
197 - | pub(crate) struct ConBMap(
|
198 - | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
199 - | );
|
200 - | impl ConBMap {
|
201 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
202 - | pub fn into_inner(
|
203 - | self,
|
204 - | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
205 - | self.0
|
276 + | #[allow(missing_docs)] // documentation missing in model
|
277 + | pub fn max_range_byte(&self) -> i8 {
|
278 + | self.max_range_byte
|
206 279 | }
|
207 - | }
|
208 - | impl
|
209 - | ::std::convert::TryFrom<
|
210 - | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
211 - | > for ConBMap
|
212 - | {
|
213 - | type Error = crate::model::con_b_map_internal::ConstraintViolation;
|
214 - |
|
215 - | /// Constructs a `ConBMap` from an [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
216 - | fn try_from(
|
217 - | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
218 - | ) -> ::std::result::Result<Self, Self::Error> {
|
219 - | let length = value.len();
|
220 - | if (1..=69).contains(&length) {
|
221 - | Ok(Self(value))
|
222 - | } else {
|
223 - | Err(crate::model::con_b_map_internal::ConstraintViolation::Length(length))
|
280 + | #[allow(missing_docs)] // documentation missing in model
|
281 + | pub fn fixed_value_byte(&self) -> i8 {
|
282 + | self.fixed_value_byte
|
224 283 | }
|
284 + | #[allow(missing_docs)] // documentation missing in model
|
285 + | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
286 + | self.con_b_list.as_deref()
|
225 287 | }
|
226 - | }
|
227 - |
|
228 - | impl ::std::convert::From<ConBMap>
|
229 - | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
230 - | {
|
231 - | fn from(value: ConBMap) -> Self {
|
232 - | value.into_inner()
|
288 + | #[allow(missing_docs)] // documentation missing in model
|
289 + | pub fn length_list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
290 + | self.length_list.as_deref()
|
233 291 | }
|
234 - | }
|
235 - | impl ::std::convert::From<ConBMap>
|
236 - | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
237 - | {
|
238 - | fn from(value: ConBMap) -> Self {
|
239 - | value
|
240 - | .into_inner()
|
241 - | .into_iter()
|
242 - | .map(|(k, v)| (k, v.into()))
|
243 - | .collect()
|
292 + | #[allow(missing_docs)] // documentation missing in model
|
293 + | pub fn sensitive_length_list(
|
294 + | &self,
|
295 + | ) -> ::std::option::Option<&[crate::model::SensitiveStructure]> {
|
296 + | self.sensitive_length_list.as_deref()
|
244 297 | }
|
245 - | }
|
246 - | impl crate::constrained::Constrained for ConBMap {
|
247 - | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
248 - | }
|
249 - |
|
250 - | #[allow(missing_docs)] // documentation missing in model
|
251 - | ///
|
252 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
253 - | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
254 - | ///
|
255 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
256 - | ///
|
257 - | #[derive(
|
258 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
259 - | )]
|
260 - | pub(crate) struct LengthString(pub(crate) ::std::string::String);
|
261 - | #[allow(dead_code)]
|
262 - | impl LengthString {
|
263 - | /// Extracts a string slice containing the entire underlying `String`.
|
264 - | pub fn as_str(&self) -> &str {
|
265 - | &self.0
|
298 + | #[allow(missing_docs)] // documentation missing in model
|
299 + | pub fn con_b_set(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
300 + | self.con_b_set.as_deref()
|
266 301 | }
|
267 - |
|
268 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
269 - | pub fn inner(&self) -> &::std::string::String {
|
270 - | &self.0
|
302 + | #[allow(missing_docs)] // documentation missing in model
|
303 + | pub fn con_b_map(
|
304 + | &self,
|
305 + | ) -> ::std::option::Option<
|
306 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
307 + | > {
|
308 + | self.con_b_map.as_ref()
|
271 309 | }
|
272 - |
|
273 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
274 - | pub fn into_inner(self) -> ::std::string::String {
|
275 - | self.0
|
310 + | #[allow(missing_docs)] // documentation missing in model
|
311 + | pub fn length_map(
|
312 + | &self,
|
313 + | ) -> ::std::option::Option<
|
314 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
315 + | > {
|
316 + | self.length_map.as_ref()
|
276 317 | }
|
277 - | }
|
278 - | impl LengthString {
|
279 - | fn check_length(
|
280 - | string: &str,
|
281 - | ) -> ::std::result::Result<(), crate::model::length_string_internal::ConstraintViolation> {
|
282 - | let length = string.chars().count();
|
283 - |
|
284 - | if (2..=69).contains(&length) {
|
285 - | Ok(())
|
286 - | } else {
|
287 - | Err(crate::model::length_string_internal::ConstraintViolation::Length(length))
|
318 + | #[allow(missing_docs)] // documentation missing in model
|
319 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
320 + | &self,
|
321 + | ) -> ::std::option::Option<
|
322 + | &::std::collections::HashMap<
|
323 + | ::std::string::String,
|
324 + | ::std::collections::HashMap<
|
325 + | ::std::string::String,
|
326 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
327 + | >,
|
328 + | >,
|
329 + | > {
|
330 + | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
288 331 | }
|
332 + | #[allow(missing_docs)] // documentation missing in model
|
333 + | pub fn sparse_map(
|
334 + | &self,
|
335 + | ) -> ::std::option::Option<
|
336 + | &::std::collections::HashMap<
|
337 + | ::std::string::String,
|
338 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
339 + | >,
|
340 + | > {
|
341 + | self.sparse_map.as_ref()
|
289 342 | }
|
290 - | }
|
291 - | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
292 - | type Error = crate::model::length_string_internal::ConstraintViolation;
|
293 - |
|
294 - | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
295 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
296 - | Self::check_length(&value)?;
|
297 - |
|
298 - | Ok(Self(value))
|
343 + | #[allow(missing_docs)] // documentation missing in model
|
344 + | pub fn sparse_list(
|
345 + | &self,
|
346 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
347 + | self.sparse_list.as_deref()
|
299 348 | }
|
300 - | }
|
301 - | impl crate::constrained::Constrained for LengthString {
|
302 - | type Unconstrained = ::std::string::String;
|
303 - | }
|
304 - |
|
305 - | impl ::std::convert::From<::std::string::String>
|
306 - | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
307 - | {
|
308 - | fn from(value: ::std::string::String) -> Self {
|
309 - | Self::Unconstrained(value)
|
349 + | #[allow(missing_docs)] // documentation missing in model
|
350 + | pub fn sparse_length_map(
|
351 + | &self,
|
352 + | ) -> ::std::option::Option<
|
353 + | &::std::collections::HashMap<
|
354 + | ::std::string::String,
|
355 + | ::std::option::Option<::std::string::String>,
|
356 + | >,
|
357 + | > {
|
358 + | self.sparse_length_map.as_ref()
|
310 359 | }
|
311 - | }
|
312 - |
|
313 - | impl ::std::fmt::Display for LengthString {
|
314 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
315 - | self.0.fmt(f)
|
360 + | #[allow(missing_docs)] // documentation missing in model
|
361 + | pub fn sparse_length_list(
|
362 + | &self,
|
363 + | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
364 + | self.sparse_length_list.as_deref()
|
316 365 | }
|
317 - | }
|
318 - |
|
319 - | impl ::std::convert::From<LengthString> for ::std::string::String {
|
320 - | fn from(value: LengthString) -> Self {
|
321 - | value.into_inner()
|
366 + | /// A union with constrained members.
|
367 + | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
368 + | self.constrained_union.as_ref()
|
322 369 | }
|
323 - | }
|
324 - |
|
325 - | #[allow(missing_docs)] // documentation missing in model
|
326 - | ///
|
327 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
328 - | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
329 - | ///
|
330 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
331 - | ///
|
332 - | #[derive(
|
333 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
334 - | )]
|
335 - | pub(crate) struct LengthPatternString(pub(crate) ::std::string::String);
|
336 - | #[allow(dead_code)]
|
337 - | impl LengthPatternString {
|
338 - | /// Extracts a string slice containing the entire underlying `String`.
|
339 - | pub fn as_str(&self) -> &str {
|
340 - | &self.0
|
370 + | #[allow(missing_docs)] // documentation missing in model
|
371 + | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
372 + | self.enum_string.as_ref()
|
341 373 | }
|
342 - |
|
343 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
344 - | pub fn inner(&self) -> &::std::string::String {
|
345 - | &self.0
|
374 + | #[allow(missing_docs)] // documentation missing in model
|
375 + | pub fn list_of_length_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
376 + | self.list_of_length_string.as_deref()
|
346 377 | }
|
347 - |
|
348 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
349 - | pub fn into_inner(self) -> ::std::string::String {
|
350 - | self.0
|
378 + | #[allow(missing_docs)] // documentation missing in model
|
379 + | pub fn set_of_length_string(
|
380 + | &self,
|
381 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
382 + | self.set_of_length_string.as_ref()
|
351 383 | }
|
352 - | }
|
353 - | impl LengthPatternString {
|
354 - | fn check_length(
|
355 - | string: &str,
|
356 - | ) -> ::std::result::Result<(), crate::model::length_pattern_string_internal::ConstraintViolation>
|
357 - | {
|
358 - | let length = string.chars().count();
|
359 - |
|
360 - | if (5..=10).contains(&length) {
|
361 - | Ok(())
|
362 - | } else {
|
363 - | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Length(length))
|
384 + | #[allow(missing_docs)] // documentation missing in model
|
385 + | pub fn map_of_length_string(
|
386 + | &self,
|
387 + | ) -> ::std::option::Option<
|
388 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
389 + | > {
|
390 + | self.map_of_length_string.as_ref()
|
364 391 | }
|
392 + | #[allow(missing_docs)] // documentation missing in model
|
393 + | pub fn list_of_length_blob(&self) -> ::std::option::Option<&[::aws_smithy_types::Blob]> {
|
394 + | self.list_of_length_blob.as_deref()
|
365 395 | }
|
366 - |
|
367 - | fn check_pattern(
|
368 - | string: ::std::string::String,
|
369 - | ) -> ::std::result::Result<
|
370 - | ::std::string::String,
|
371 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
396 + | #[allow(missing_docs)] // documentation missing in model
|
397 + | pub fn map_of_length_blob(
|
398 + | &self,
|
399 + | ) -> ::std::option::Option<
|
400 + | &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
372 401 | > {
|
373 - | let regex = Self::compile_regex();
|
374 - |
|
375 - | if regex.is_match(&string) {
|
376 - | Ok(string)
|
377 - | } else {
|
378 - | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Pattern(string))
|
402 + | self.map_of_length_blob.as_ref()
|
379 403 | }
|
404 + | #[allow(missing_docs)] // documentation missing in model
|
405 + | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
406 + | self.list_of_range_integer.as_deref()
|
380 407 | }
|
381 - |
|
382 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
383 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
384 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
385 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
386 - | ::regex::Regex::new(r#"[a-f0-5]*"#).expect(r#"The regular expression [a-f0-5]* is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
387 - | });
|
388 - |
|
389 - | ®EX
|
408 + | #[allow(missing_docs)] // documentation missing in model
|
409 + | pub fn set_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
410 + | self.set_of_range_integer.as_deref()
|
390 411 | }
|
391 - | }
|
392 - | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
393 - | type Error = crate::model::length_pattern_string_internal::ConstraintViolation;
|
394 - |
|
395 - | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
396 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
397 - | Self::check_length(&value)?;
|
398 - |
|
399 - | let value = Self::check_pattern(value)?;
|
400 - |
|
401 - | Ok(Self(value))
|
412 + | #[allow(missing_docs)] // documentation missing in model
|
413 + | pub fn map_of_range_integer(
|
414 + | &self,
|
415 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
416 + | self.map_of_range_integer.as_ref()
|
402 417 | }
|
403 - | }
|
404 - | impl crate::constrained::Constrained for LengthPatternString {
|
405 - | type Unconstrained = ::std::string::String;
|
406 - | }
|
407 - |
|
408 - | impl ::std::convert::From<::std::string::String>
|
409 - | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
410 - | {
|
411 - | fn from(value: ::std::string::String) -> Self {
|
412 - | Self::Unconstrained(value)
|
418 + | #[allow(missing_docs)] // documentation missing in model
|
419 + | pub fn list_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
420 + | self.list_of_range_short.as_deref()
|
413 421 | }
|
414 - | }
|
415 - |
|
416 - | impl ::std::fmt::Display for LengthPatternString {
|
417 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
418 - | self.0.fmt(f)
|
422 + | #[allow(missing_docs)] // documentation missing in model
|
423 + | pub fn set_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
424 + | self.set_of_range_short.as_deref()
|
419 425 | }
|
420 - | }
|
421 - |
|
422 - | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
423 - | fn from(value: LengthPatternString) -> Self {
|
424 - | value.into_inner()
|
426 + | #[allow(missing_docs)] // documentation missing in model
|
427 + | pub fn map_of_range_short(
|
428 + | &self,
|
429 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i16>> {
|
430 + | self.map_of_range_short.as_ref()
|
425 431 | }
|
426 - | }
|
427 - |
|
428 - | #[cfg(test)]
|
429 - | mod test_length_pattern_string {
|
430 - | #[test]
|
431 - | fn regex_compiles() {
|
432 - | crate::model::LengthPatternString::compile_regex();
|
432 + | #[allow(missing_docs)] // documentation missing in model
|
433 + | pub fn list_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
434 + | self.list_of_range_long.as_deref()
|
433 435 | }
|
434 - | }
|
435 - |
|
436 - | #[allow(missing_docs)] // documentation missing in model
|
437 - | ///
|
438 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
439 - | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
440 - | ///
|
441 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
442 - | ///
|
443 - | #[derive(
|
444 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
445 - | )]
|
446 - | pub(crate) struct PatternString(pub(crate) ::std::string::String);
|
447 - | #[allow(dead_code)]
|
448 - | impl PatternString {
|
449 - | /// Extracts a string slice containing the entire underlying `String`.
|
450 - | pub fn as_str(&self) -> &str {
|
451 - | &self.0
|
436 + | #[allow(missing_docs)] // documentation missing in model
|
437 + | pub fn set_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
438 + | self.set_of_range_long.as_deref()
|
452 439 | }
|
453 - |
|
454 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
455 - | pub fn inner(&self) -> &::std::string::String {
|
456 - | &self.0
|
440 + | #[allow(missing_docs)] // documentation missing in model
|
441 + | pub fn map_of_range_long(
|
442 + | &self,
|
443 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i64>> {
|
444 + | self.map_of_range_long.as_ref()
|
457 445 | }
|
458 - |
|
459 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
460 - | pub fn into_inner(self) -> ::std::string::String {
|
461 - | self.0
|
446 + | #[allow(missing_docs)] // documentation missing in model
|
447 + | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
448 + | self.list_of_range_byte.as_deref()
|
462 449 | }
|
463 - | }
|
464 - | impl PatternString {
|
465 - | fn check_pattern(
|
466 - | string: ::std::string::String,
|
467 - | ) -> ::std::result::Result<
|
468 - | ::std::string::String,
|
469 - | crate::model::pattern_string_internal::ConstraintViolation,
|
450 + | #[allow(missing_docs)] // documentation missing in model
|
451 + | pub fn set_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
452 + | self.set_of_range_byte.as_deref()
|
453 + | }
|
454 + | #[allow(missing_docs)] // documentation missing in model
|
455 + | pub fn map_of_range_byte(
|
456 + | &self,
|
457 + | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i8>> {
|
458 + | self.map_of_range_byte.as_ref()
|
459 + | }
|
460 + | #[allow(missing_docs)] // documentation missing in model
|
461 + | pub fn non_streaming_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
462 + | self.non_streaming_blob.as_ref()
|
463 + | }
|
464 + | #[allow(missing_docs)] // documentation missing in model
|
465 + | pub fn pattern_string(&self) -> ::std::option::Option<&str> {
|
466 + | self.pattern_string.as_deref()
|
467 + | }
|
468 + | #[allow(missing_docs)] // documentation missing in model
|
469 + | pub fn map_of_pattern_string(
|
470 + | &self,
|
471 + | ) -> ::std::option::Option<
|
472 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
470 473 | > {
|
471 - | let regex = Self::compile_regex();
|
472 - |
|
473 - | if regex.is_match(&string) {
|
474 - | Ok(string)
|
475 - | } else {
|
476 - | Err(crate::model::pattern_string_internal::ConstraintViolation::Pattern(string))
|
474 + | self.map_of_pattern_string.as_ref()
|
477 475 | }
|
476 + | #[allow(missing_docs)] // documentation missing in model
|
477 + | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
478 + | self.list_of_pattern_string.as_deref()
|
478 479 | }
|
479 - |
|
480 - | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
481 - | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
482 - | pub fn compile_regex() -> &'static ::regex::Regex {
|
483 - | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
484 - | ::regex::Regex::new(r#"[a-d]{5}"#).expect(r#"The regular expression [a-d]{5} is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
485 - | });
|
486 - |
|
487 - | ®EX
|
480 + | #[allow(missing_docs)] // documentation missing in model
|
481 + | pub fn set_of_pattern_string(
|
482 + | &self,
|
483 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
484 + | self.set_of_pattern_string.as_ref()
|
488 485 | }
|
489 - | }
|
490 - | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
491 - | type Error = crate::model::pattern_string_internal::ConstraintViolation;
|
492 - |
|
493 - | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
494 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
495 - | let value = Self::check_pattern(value)?;
|
496 - |
|
497 - | Ok(Self(value))
|
486 + | #[allow(missing_docs)] // documentation missing in model
|
487 + | pub fn length_length_pattern_string(&self) -> ::std::option::Option<&str> {
|
488 + | self.length_length_pattern_string.as_deref()
|
498 489 | }
|
499 - | }
|
500 - | impl crate::constrained::Constrained for PatternString {
|
501 - | type Unconstrained = ::std::string::String;
|
502 - | }
|
503 - |
|
504 - | impl ::std::convert::From<::std::string::String>
|
505 - | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
506 - | {
|
507 - | fn from(value: ::std::string::String) -> Self {
|
508 - | Self::Unconstrained(value)
|
490 + | #[allow(missing_docs)] // documentation missing in model
|
491 + | pub fn map_of_length_pattern_string(
|
492 + | &self,
|
493 + | ) -> ::std::option::Option<
|
494 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
495 + | > {
|
496 + | self.map_of_length_pattern_string.as_ref()
|
509 497 | }
|
510 - | }
|
511 - |
|
512 - | impl ::std::fmt::Display for PatternString {
|
513 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
514 - | self.0.fmt(f)
|
498 + | #[allow(missing_docs)] // documentation missing in model
|
499 + | pub fn list_of_length_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
500 + | self.list_of_length_pattern_string.as_deref()
|
515 501 | }
|
516 - | }
|
517 - |
|
518 - | impl ::std::convert::From<PatternString> for ::std::string::String {
|
519 - | fn from(value: PatternString) -> Self {
|
520 - | value.into_inner()
|
502 + | #[allow(missing_docs)] // documentation missing in model
|
503 + | pub fn set_of_length_pattern_string(
|
504 + | &self,
|
505 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
506 + | self.set_of_length_pattern_string.as_ref()
|
507 + | }
|
508 + | #[allow(missing_docs)] // documentation missing in model
|
509 + | pub fn length_list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
510 + | self.length_list_of_pattern_string.as_deref()
|
511 + | }
|
512 + | #[allow(missing_docs)] // documentation missing in model
|
513 + | pub fn length_set_of_pattern_string(
|
514 + | &self,
|
515 + | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
516 + | self.length_set_of_pattern_string.as_ref()
|
521 517 | }
|
522 518 | }
|
523 - |
|
524 - | #[cfg(test)]
|
525 - | mod test_pattern_string {
|
526 - | #[test]
|
527 - | fn regex_compiles() {
|
528 - | crate::model::PatternString::compile_regex();
|
519 + | impl crate::constrained::Constrained for crate::model::ConA {
|
520 + | type Unconstrained = crate::model::con_a_internal::Builder;
|
521 + | }
|
522 + | impl ConA {
|
523 + | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
524 + | pub fn builder() -> crate::model::con_a::Builder {
|
525 + | crate::model::con_a::Builder::default()
|
529 526 | }
|
530 527 | }
|
531 528 |
|
532 529 | #[allow(missing_docs)] // documentation missing in model
|
533 530 | ///
|
534 531 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
535 - | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
532 + | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
536 533 | ///
|
537 534 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
538 535 | ///
|
539 536 | #[derive(
|
540 537 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
541 538 | )]
|
542 - | pub(crate) struct LengthListOfPatternString(
|
543 - | pub(crate) ::std::vec::Vec<crate::model::PatternString>,
|
539 + | pub(crate) struct ConstrainedListInOutput(
|
540 + | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
544 541 | );
|
545 - | impl LengthListOfPatternString {
|
546 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
547 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
542 + | impl ConstrainedListInOutput {
|
543 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
544 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
548 545 | self.0
|
549 546 | }
|
550 547 |
|
551 548 | fn check_length(
|
552 549 | length: usize,
|
553 550 | ) -> ::std::result::Result<
|
554 551 | (),
|
555 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
552 + | crate::model::constrained_list_in_output_internal::ConstraintViolation,
|
556 553 | > {
|
557 - | if (12..=39).contains(&length) {
|
554 + | if 69 <= length {
|
558 555 | Ok(())
|
559 556 | } else {
|
560 557 | Err(
|
561 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation::Length(
|
558 + | crate::model::constrained_list_in_output_internal::ConstraintViolation::Length(
|
562 559 | length,
|
563 560 | ),
|
564 561 | )
|
565 562 | }
|
566 563 | }
|
567 564 | }
|
568 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
569 - | for LengthListOfPatternString
|
565 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
566 + | for ConstrainedListInOutput
|
570 567 | {
|
571 - | type Error = crate::model::length_list_of_pattern_string_internal::ConstraintViolation;
|
568 + | type Error = crate::model::constrained_list_in_output_internal::ConstraintViolation;
|
572 569 |
|
573 - | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
570 + | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
574 571 | fn try_from(
|
575 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
572 + | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
576 573 | ) -> ::std::result::Result<Self, Self::Error> {
|
577 574 | Self::check_length(value.len())?;
|
578 575 |
|
579 576 | Ok(Self(value))
|
580 577 | }
|
581 578 | }
|
582 579 |
|
583 - | impl ::std::convert::From<LengthListOfPatternString>
|
584 - | for ::std::vec::Vec<crate::model::PatternString>
|
580 + | impl ::std::convert::From<ConstrainedListInOutput>
|
581 + | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
585 582 | {
|
586 - | fn from(value: LengthListOfPatternString) -> Self {
|
583 + | fn from(value: ConstrainedListInOutput) -> Self {
|
587 584 | value.into_inner()
|
588 585 | }
|
589 586 | }
|
590 - | impl ::std::convert::From<LengthListOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
591 - | fn from(value: LengthListOfPatternString) -> Self {
|
592 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
593 - | }
|
594 - | }
|
595 - | impl crate::constrained::Constrained for LengthListOfPatternString {
|
596 - | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
597 - | }
|
598 587 |
|
599 588 | #[allow(missing_docs)] // documentation missing in model
|
600 589 | ///
|
601 590 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
602 - | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
591 + | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
603 592 | ///
|
604 593 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
605 594 | ///
|
606 - | #[derive(
|
607 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
608 - | )]
|
609 - | pub(crate) struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
610 - | impl SetOfLengthString {
|
611 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
612 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
595 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
596 + | pub(crate) struct ConstrainedMapInOutput(
|
597 + | pub(crate) ::std::collections::HashMap<
|
598 + | ::std::string::String,
|
599 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
600 + | >,
|
601 + | );
|
602 + | impl ConstrainedMapInOutput {
|
603 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
604 + | pub fn into_inner(
|
605 + | self,
|
606 + | ) -> ::std::collections::HashMap<
|
607 + | ::std::string::String,
|
608 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
609 + | > {
|
613 610 | self.0
|
614 611 | }
|
612 + | }
|
613 + | impl
|
614 + | ::std::convert::TryFrom<
|
615 + | ::std::collections::HashMap<
|
616 + | ::std::string::String,
|
617 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
618 + | >,
|
619 + | > for ConstrainedMapInOutput
|
620 + | {
|
621 + | type Error = crate::model::constrained_map_in_output_internal::ConstraintViolation;
|
615 622 |
|
616 - | fn check_unique_items(
|
617 - | items: ::std::vec::Vec<crate::model::LengthString>,
|
618 - | ) -> ::std::result::Result<
|
619 - | ::std::vec::Vec<crate::model::LengthString>,
|
620 - | crate::model::set_of_length_string_internal::ConstraintViolation,
|
621 - | > {
|
622 - | let mut seen = ::std::collections::HashMap::new();
|
623 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
624 - | for (idx, item) in items.iter().enumerate() {
|
625 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
626 - | duplicate_indices.push(prev_idx);
|
623 + | /// Constructs a `ConstrainedMapInOutput` from an [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
624 + | fn try_from(
|
625 + | value: ::std::collections::HashMap<
|
626 + | ::std::string::String,
|
627 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
628 + | >,
|
629 + | ) -> ::std::result::Result<Self, Self::Error> {
|
630 + | let length = value.len();
|
631 + | if 69 <= length {
|
632 + | Ok(Self(value))
|
633 + | } else {
|
634 + | Err(
|
635 + | crate::model::constrained_map_in_output_internal::ConstraintViolation::Length(
|
636 + | length,
|
637 + | ),
|
638 + | )
|
627 639 | }
|
628 640 | }
|
641 + | }
|
629 642 |
|
630 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
631 - | for idx in &duplicate_indices {
|
632 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
633 - | last_duplicate_indices.push(prev_idx);
|
634 - | }
|
643 + | impl ::std::convert::From<ConstrainedMapInOutput>
|
644 + | for ::std::collections::HashMap<
|
645 + | ::std::string::String,
|
646 + | crate::model::TransitivelyConstrainedStructureInOutput,
|
647 + | >
|
648 + | {
|
649 + | fn from(value: ConstrainedMapInOutput) -> Self {
|
650 + | value.into_inner()
|
635 651 | }
|
636 - | duplicate_indices.extend(last_duplicate_indices);
|
652 + | }
|
637 653 |
|
638 - | if !duplicate_indices.is_empty() {
|
639 - | debug_assert!(duplicate_indices.len() >= 2);
|
640 - | Err(
|
641 - | crate::model::set_of_length_string_internal::ConstraintViolation::UniqueItems {
|
642 - | duplicate_indices,
|
643 - | original: items,
|
644 - | },
|
645 - | )
|
654 + | #[allow(missing_docs)] // documentation missing in model
|
655 + | #[derive(
|
656 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
657 + | )]
|
658 + | pub enum ConstrainedUnionInOutput {
|
659 + | #[allow(missing_docs)] // documentation missing in model
|
660 + | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
661 + | }
|
662 + | impl ConstrainedUnionInOutput {
|
663 + | #[allow(irrefutable_let_patterns)]
|
664 + | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
665 + | /// Returns `Err(&Self)` if it can't be converted.
|
666 + | pub fn as_structure(
|
667 + | &self,
|
668 + | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
669 + | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
670 + | ::std::result::Result::Ok(val)
|
646 671 | } else {
|
647 - | Ok(items)
|
672 + | ::std::result::Result::Err(self)
|
673 + | }
|
648 674 | }
|
675 + | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
676 + | pub fn is_structure(&self) -> bool {
|
677 + | self.as_structure().is_ok()
|
649 678 | }
|
650 679 | }
|
651 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
652 - | type Error = crate::model::set_of_length_string_internal::ConstraintViolation;
|
653 680 |
|
654 - | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
655 - | fn try_from(
|
656 - | value: ::std::vec::Vec<crate::model::LengthString>,
|
657 - | ) -> ::std::result::Result<Self, Self::Error> {
|
658 - | let value = Self::check_unique_items(value)?;
|
681 + | #[allow(missing_docs)] // documentation missing in model
|
682 + | ///
|
683 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
684 + | /// [constraint traits]. Use [`LengthString::try_from`] to construct values of this type.
|
685 + | ///
|
686 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
687 + | ///
|
688 + | #[derive(
|
689 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
690 + | )]
|
691 + | pub(crate) struct LengthString(pub(crate) ::std::string::String);
|
692 + | #[allow(dead_code)]
|
693 + | impl LengthString {
|
694 + | /// Extracts a string slice containing the entire underlying `String`.
|
695 + | pub fn as_str(&self) -> &str {
|
696 + | &self.0
|
697 + | }
|
698 + |
|
699 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
700 + | pub fn inner(&self) -> &::std::string::String {
|
701 + | &self.0
|
702 + | }
|
703 + |
|
704 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
705 + | pub fn into_inner(self) -> ::std::string::String {
|
706 + | self.0
|
707 + | }
|
708 + | }
|
709 + | impl LengthString {
|
710 + | fn check_length(
|
711 + | string: &str,
|
712 + | ) -> ::std::result::Result<(), crate::model::length_string_internal::ConstraintViolation> {
|
713 + | let length = string.chars().count();
|
714 + |
|
715 + | if (2..=69).contains(&length) {
|
716 + | Ok(())
|
717 + | } else {
|
718 + | Err(crate::model::length_string_internal::ConstraintViolation::Length(length))
|
719 + | }
|
720 + | }
|
721 + | }
|
722 + | impl ::std::convert::TryFrom<::std::string::String> for LengthString {
|
723 + | type Error = crate::model::length_string_internal::ConstraintViolation;
|
724 + |
|
725 + | /// Constructs a `LengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
726 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
727 + | Self::check_length(&value)?;
|
659 728 |
|
660 729 | Ok(Self(value))
|
661 730 | }
|
662 731 | }
|
732 + | impl crate::constrained::Constrained for LengthString {
|
733 + | type Unconstrained = ::std::string::String;
|
734 + | }
|
663 735 |
|
664 - | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
665 - | fn from(value: SetOfLengthString) -> Self {
|
666 - | value.into_inner()
|
736 + | impl ::std::convert::From<::std::string::String>
|
737 + | for crate::constrained::MaybeConstrained<crate::model::LengthString>
|
738 + | {
|
739 + | fn from(value: ::std::string::String) -> Self {
|
740 + | Self::Unconstrained(value)
|
667 741 | }
|
668 742 | }
|
669 - | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
|
670 - | fn from(value: SetOfLengthString) -> Self {
|
671 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
743 + |
|
744 + | impl ::std::fmt::Display for LengthString {
|
745 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
746 + | self.0.fmt(f)
|
672 747 | }
|
673 748 | }
|
674 - | impl crate::constrained::Constrained for SetOfLengthString {
|
675 - | type Unconstrained =
|
676 - | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
749 + |
|
750 + | impl ::std::convert::From<LengthString> for ::std::string::String {
|
751 + | fn from(value: LengthString) -> Self {
|
752 + | value.into_inner()
|
753 + | }
|
677 754 | }
|
678 755 |
|
679 756 | #[allow(missing_docs)] // documentation missing in model
|
757 + | ///
|
758 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
759 + | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
760 + | ///
|
761 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
762 + | ///
|
680 763 | #[derive(
|
681 764 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
682 765 | )]
|
683 - | pub struct RecursiveShapesInputOutputNested1 {
|
684 - | #[allow(missing_docs)] // documentation missing in model
|
685 - | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
766 + | pub(crate) struct RangeInteger(pub(crate) i32);
|
767 + | #[allow(dead_code)]
|
768 + | impl RangeInteger {
|
769 + | /// Returns an immutable reference to the underlying [`i32`].
|
770 + | pub fn inner(&self) -> &i32 {
|
771 + | &self.0
|
772 + | }
|
773 + |
|
774 + | /// Consumes the value, returning the underlying [`i32`].
|
775 + | pub fn into_inner(self) -> i32 {
|
776 + | self.0
|
777 + | }
|
686 778 | }
|
687 - | impl RecursiveShapesInputOutputNested1 {
|
688 - | #[allow(missing_docs)] // documentation missing in model
|
689 - | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
690 - | use std::ops::Deref;
|
691 - | self.recursive_member.deref()
|
779 + |
|
780 + | impl crate::constrained::Constrained for RangeInteger {
|
781 + | type Unconstrained = i32;
|
782 + | }
|
783 + |
|
784 + | impl ::std::convert::From<i32>
|
785 + | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
786 + | {
|
787 + | fn from(value: i32) -> Self {
|
788 + | Self::Unconstrained(value)
|
692 789 | }
|
693 790 | }
|
694 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
695 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
791 + |
|
792 + | impl ::std::fmt::Display for RangeInteger {
|
793 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
794 + | self.0.fmt(f)
|
795 + | }
|
696 796 | }
|
697 - | impl RecursiveShapesInputOutputNested1 {
|
698 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
699 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
700 - | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
797 + |
|
798 + | impl ::std::convert::From<RangeInteger> for i32 {
|
799 + | fn from(value: RangeInteger) -> Self {
|
800 + | value.into_inner()
|
801 + | }
|
802 + | }
|
803 + | impl RangeInteger {
|
804 + | fn check_range(
|
805 + | value: i32,
|
806 + | ) -> ::std::result::Result<(), crate::model::range_integer_internal::ConstraintViolation> {
|
807 + | if (0..=69).contains(&value) {
|
808 + | Ok(())
|
809 + | } else {
|
810 + | Err(crate::model::range_integer_internal::ConstraintViolation::Range(value))
|
811 + | }
|
812 + | }
|
813 + | }
|
814 + | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
815 + | type Error = crate::model::range_integer_internal::ConstraintViolation;
|
816 + |
|
817 + | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
818 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
819 + | Self::check_range(value)?;
|
820 + |
|
821 + | Ok(Self(value))
|
701 822 | }
|
702 823 | }
|
703 824 |
|
704 825 | #[allow(missing_docs)] // documentation missing in model
|
826 + | ///
|
827 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
828 + | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
829 + | ///
|
830 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
831 + | ///
|
705 832 | #[derive(
|
706 833 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
707 834 | )]
|
708 - | pub struct RecursiveShapesInputOutputNested2 {
|
709 - | #[allow(missing_docs)] // documentation missing in model
|
710 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
835 + | pub(crate) struct RangeShort(pub(crate) i16);
|
836 + | #[allow(dead_code)]
|
837 + | impl RangeShort {
|
838 + | /// Returns an immutable reference to the underlying [`i16`].
|
839 + | pub fn inner(&self) -> &i16 {
|
840 + | &self.0
|
841 + | }
|
842 + |
|
843 + | /// Consumes the value, returning the underlying [`i16`].
|
844 + | pub fn into_inner(self) -> i16 {
|
845 + | self.0
|
846 + | }
|
711 847 | }
|
712 - | impl RecursiveShapesInputOutputNested2 {
|
713 - | #[allow(missing_docs)] // documentation missing in model
|
714 - | pub fn recursive_member(
|
715 - | &self,
|
716 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
717 - | self.recursive_member.as_ref()
|
848 + |
|
849 + | impl crate::constrained::Constrained for RangeShort {
|
850 + | type Unconstrained = i16;
|
851 + | }
|
852 + |
|
853 + | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
854 + | fn from(value: i16) -> Self {
|
855 + | Self::Unconstrained(value)
|
718 856 | }
|
719 857 | }
|
720 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
721 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
858 + |
|
859 + | impl ::std::fmt::Display for RangeShort {
|
860 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
861 + | self.0.fmt(f)
|
862 + | }
|
722 863 | }
|
723 - | impl RecursiveShapesInputOutputNested2 {
|
724 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
725 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
726 - | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
864 + |
|
865 + | impl ::std::convert::From<RangeShort> for i16 {
|
866 + | fn from(value: RangeShort) -> Self {
|
867 + | value.into_inner()
|
868 + | }
|
869 + | }
|
870 + | impl RangeShort {
|
871 + | fn check_range(
|
872 + | value: i16,
|
873 + | ) -> ::std::result::Result<(), crate::model::range_short_internal::ConstraintViolation> {
|
874 + | if (0..=10).contains(&value) {
|
875 + | Ok(())
|
876 + | } else {
|
877 + | Err(crate::model::range_short_internal::ConstraintViolation::Range(value))
|
878 + | }
|
727 879 | }
|
728 880 | }
|
881 + | impl ::std::convert::TryFrom<i16> for RangeShort {
|
882 + | type Error = crate::model::range_short_internal::ConstraintViolation;
|
729 883 |
|
730 - | #[allow(missing_docs)] // documentation missing in model
|
731 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
732 - | pub struct ConA {
|
733 - | #[allow(missing_docs)] // documentation missing in model
|
734 - | pub con_b: crate::model::ConB,
|
735 - | #[allow(missing_docs)] // documentation missing in model
|
736 - | pub opt_con_b: ::std::option::Option<crate::model::ConB>,
|
737 - | #[allow(missing_docs)] // documentation missing in model
|
738 - | pub length_string: ::std::option::Option<::std::string::String>,
|
739 - | #[allow(missing_docs)] // documentation missing in model
|
740 - | pub min_length_string: ::std::option::Option<::std::string::String>,
|
741 - | #[allow(missing_docs)] // documentation missing in model
|
742 - | pub max_length_string: ::std::option::Option<::std::string::String>,
|
743 - | #[allow(missing_docs)] // documentation missing in model
|
744 - | pub fixed_length_string: ::std::option::Option<::std::string::String>,
|
745 - | #[allow(missing_docs)] // documentation missing in model
|
746 - | pub length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
747 - | #[allow(missing_docs)] // documentation missing in model
|
748 - | pub min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
749 - | #[allow(missing_docs)] // documentation missing in model
|
750 - | pub max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
751 - | #[allow(missing_docs)] // documentation missing in model
|
752 - | pub fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
753 - | #[allow(missing_docs)] // documentation missing in model
|
754 - | pub range_integer: i32,
|
755 - | #[allow(missing_docs)] // documentation missing in model
|
756 - | pub min_range_integer: i32,
|
757 - | #[allow(missing_docs)] // documentation missing in model
|
758 - | pub max_range_integer: i32,
|
759 - | #[allow(missing_docs)] // documentation missing in model
|
760 - | pub fixed_value_integer: i32,
|
761 - | #[allow(missing_docs)] // documentation missing in model
|
762 - | pub range_short: i16,
|
763 - | #[allow(missing_docs)] // documentation missing in model
|
764 - | pub min_range_short: i16,
|
765 - | #[allow(missing_docs)] // documentation missing in model
|
766 - | pub max_range_short: i16,
|
767 - | #[allow(missing_docs)] // documentation missing in model
|
768 - | pub fixed_value_short: i16,
|
769 - | #[allow(missing_docs)] // documentation missing in model
|
770 - | pub range_long: i64,
|
771 - | #[allow(missing_docs)] // documentation missing in model
|
772 - | pub min_range_long: i64,
|
773 - | #[allow(missing_docs)] // documentation missing in model
|
774 - | pub max_range_long: i64,
|
775 - | #[allow(missing_docs)] // documentation missing in model
|
776 - | pub fixed_value_long: i64,
|
777 - | #[allow(missing_docs)] // documentation missing in model
|
778 - | pub range_byte: i8,
|
779 - | #[allow(missing_docs)] // documentation missing in model
|
780 - | pub min_range_byte: i8,
|
781 - | #[allow(missing_docs)] // documentation missing in model
|
782 - | pub max_range_byte: i8,
|
783 - | #[allow(missing_docs)] // documentation missing in model
|
784 - | pub fixed_value_byte: i8,
|
785 - | #[allow(missing_docs)] // documentation missing in model
|
786 - | pub con_b_list: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
787 - | #[allow(missing_docs)] // documentation missing in model
|
788 - | pub length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
789 - | #[allow(missing_docs)] // documentation missing in model
|
790 - | pub sensitive_length_list:
|
791 - | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
792 - | #[allow(missing_docs)] // documentation missing in model
|
793 - | pub con_b_set: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
794 - | #[allow(missing_docs)] // documentation missing in model
|
795 - | pub con_b_map: ::std::option::Option<
|
796 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
797 - | >,
|
798 - | #[allow(missing_docs)] // documentation missing in model
|
799 - | pub length_map: ::std::option::Option<
|
800 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
801 - | >,
|
802 - | #[allow(missing_docs)] // documentation missing in model
|
803 - | pub map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
804 - | ::std::collections::HashMap<
|
805 - | ::std::string::String,
|
806 - | ::std::collections::HashMap<
|
807 - | ::std::string::String,
|
808 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
809 - | >,
|
810 - | >,
|
811 - | >,
|
812 - | #[allow(missing_docs)] // documentation missing in model
|
813 - | pub sparse_map: ::std::option::Option<
|
814 - | ::std::collections::HashMap<
|
815 - | ::std::string::String,
|
816 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
817 - | >,
|
818 - | >,
|
819 - | #[allow(missing_docs)] // documentation missing in model
|
820 - | pub sparse_list:
|
821 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
822 - | #[allow(missing_docs)] // documentation missing in model
|
823 - | pub sparse_length_map: ::std::option::Option<
|
824 - | ::std::collections::HashMap<
|
825 - | ::std::string::String,
|
826 - | ::std::option::Option<::std::string::String>,
|
827 - | >,
|
828 - | >,
|
829 - | #[allow(missing_docs)] // documentation missing in model
|
830 - | pub sparse_length_list:
|
831 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
832 - | /// A union with constrained members.
|
833 - | pub constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
834 - | #[allow(missing_docs)] // documentation missing in model
|
835 - | pub enum_string: ::std::option::Option<crate::model::EnumString>,
|
836 - | #[allow(missing_docs)] // documentation missing in model
|
837 - | pub list_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
838 - | #[allow(missing_docs)] // documentation missing in model
|
839 - | pub set_of_length_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
840 - | #[allow(missing_docs)] // documentation missing in model
|
841 - | pub map_of_length_string: ::std::option::Option<
|
842 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
843 - | >,
|
844 - | #[allow(missing_docs)] // documentation missing in model
|
845 - | pub list_of_length_blob: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
846 - | #[allow(missing_docs)] // documentation missing in model
|
847 - | pub map_of_length_blob: ::std::option::Option<
|
848 - | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
849 - | >,
|
850 - | #[allow(missing_docs)] // documentation missing in model
|
851 - | pub list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
852 - | #[allow(missing_docs)] // documentation missing in model
|
853 - | pub set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
854 - | #[allow(missing_docs)] // documentation missing in model
|
855 - | pub map_of_range_integer:
|
856 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
857 - | #[allow(missing_docs)] // documentation missing in model
|
858 - | pub list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
859 - | #[allow(missing_docs)] // documentation missing in model
|
860 - | pub set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
861 - | #[allow(missing_docs)] // documentation missing in model
|
862 - | pub map_of_range_short:
|
863 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
864 - | #[allow(missing_docs)] // documentation missing in model
|
865 - | pub list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
866 - | #[allow(missing_docs)] // documentation missing in model
|
867 - | pub set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
868 - | #[allow(missing_docs)] // documentation missing in model
|
869 - | pub map_of_range_long:
|
870 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
871 - | #[allow(missing_docs)] // documentation missing in model
|
872 - | pub list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
873 - | #[allow(missing_docs)] // documentation missing in model
|
874 - | pub set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
875 - | #[allow(missing_docs)] // documentation missing in model
|
876 - | pub map_of_range_byte:
|
877 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
878 - | #[allow(missing_docs)] // documentation missing in model
|
879 - | pub non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
880 - | #[allow(missing_docs)] // documentation missing in model
|
881 - | pub pattern_string: ::std::option::Option<::std::string::String>,
|
882 - | #[allow(missing_docs)] // documentation missing in model
|
883 - | pub map_of_pattern_string: ::std::option::Option<
|
884 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
885 - | >,
|
886 - | #[allow(missing_docs)] // documentation missing in model
|
887 - | pub list_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
888 - | #[allow(missing_docs)] // documentation missing in model
|
889 - | pub set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
890 - | #[allow(missing_docs)] // documentation missing in model
|
891 - | pub length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
892 - | #[allow(missing_docs)] // documentation missing in model
|
893 - | pub map_of_length_pattern_string: ::std::option::Option<
|
894 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
895 - | >,
|
896 - | #[allow(missing_docs)] // documentation missing in model
|
897 - | pub list_of_length_pattern_string:
|
898 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
899 - | #[allow(missing_docs)] // documentation missing in model
|
900 - | pub set_of_length_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
901 - | #[allow(missing_docs)] // documentation missing in model
|
902 - | pub length_list_of_pattern_string:
|
903 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
904 - | #[allow(missing_docs)] // documentation missing in model
|
905 - | pub length_set_of_pattern_string: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
884 + | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
885 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
886 + | Self::check_range(value)?;
|
887 + |
|
888 + | Ok(Self(value))
|
889 + | }
|
906 890 | }
|
907 - | impl ConA {
|
908 - | #[allow(missing_docs)] // documentation missing in model
|
909 - | pub fn con_b(&self) -> &crate::model::ConB {
|
910 - | &self.con_b
|
891 + |
|
892 + | #[allow(missing_docs)] // documentation missing in model
|
893 + | ///
|
894 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
895 + | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
896 + | ///
|
897 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
898 + | ///
|
899 + | #[derive(
|
900 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
901 + | )]
|
902 + | pub(crate) struct RangeLong(pub(crate) i64);
|
903 + | #[allow(dead_code)]
|
904 + | impl RangeLong {
|
905 + | /// Returns an immutable reference to the underlying [`i64`].
|
906 + | pub fn inner(&self) -> &i64 {
|
907 + | &self.0
|
911 908 | }
|
912 - | #[allow(missing_docs)] // documentation missing in model
|
913 - | pub fn opt_con_b(&self) -> ::std::option::Option<&crate::model::ConB> {
|
914 - | self.opt_con_b.as_ref()
|
909 + |
|
910 + | /// Consumes the value, returning the underlying [`i64`].
|
911 + | pub fn into_inner(self) -> i64 {
|
912 + | self.0
|
915 913 | }
|
916 - | #[allow(missing_docs)] // documentation missing in model
|
917 - | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
918 - | self.length_string.as_deref()
|
914 + | }
|
915 + |
|
916 + | impl crate::constrained::Constrained for RangeLong {
|
917 + | type Unconstrained = i64;
|
918 + | }
|
919 + |
|
920 + | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
921 + | fn from(value: i64) -> Self {
|
922 + | Self::Unconstrained(value)
|
919 923 | }
|
920 - | #[allow(missing_docs)] // documentation missing in model
|
921 - | pub fn min_length_string(&self) -> ::std::option::Option<&str> {
|
922 - | self.min_length_string.as_deref()
|
924 + | }
|
925 + |
|
926 + | impl ::std::fmt::Display for RangeLong {
|
927 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
928 + | self.0.fmt(f)
|
923 929 | }
|
924 - | #[allow(missing_docs)] // documentation missing in model
|
925 - | pub fn max_length_string(&self) -> ::std::option::Option<&str> {
|
926 - | self.max_length_string.as_deref()
|
930 + | }
|
931 + |
|
932 + | impl ::std::convert::From<RangeLong> for i64 {
|
933 + | fn from(value: RangeLong) -> Self {
|
934 + | value.into_inner()
|
927 935 | }
|
928 - | #[allow(missing_docs)] // documentation missing in model
|
929 - | pub fn fixed_length_string(&self) -> ::std::option::Option<&str> {
|
930 - | self.fixed_length_string.as_deref()
|
936 + | }
|
937 + | impl RangeLong {
|
938 + | fn check_range(
|
939 + | value: i64,
|
940 + | ) -> ::std::result::Result<(), crate::model::range_long_internal::ConstraintViolation> {
|
941 + | if (0..=10).contains(&value) {
|
942 + | Ok(())
|
943 + | } else {
|
944 + | Err(crate::model::range_long_internal::ConstraintViolation::Range(value))
|
931 945 | }
|
932 - | #[allow(missing_docs)] // documentation missing in model
|
933 - | pub fn length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
934 - | self.length_blob.as_ref()
|
935 946 | }
|
936 - | #[allow(missing_docs)] // documentation missing in model
|
937 - | pub fn min_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
938 - | self.min_length_blob.as_ref()
|
939 - | }
|
940 - | #[allow(missing_docs)] // documentation missing in model
|
941 - | pub fn max_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
942 - | self.max_length_blob.as_ref()
|
947 + | }
|
948 + | impl ::std::convert::TryFrom<i64> for RangeLong {
|
949 + | type Error = crate::model::range_long_internal::ConstraintViolation;
|
950 + |
|
951 + | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
952 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
953 + | Self::check_range(value)?;
|
954 + |
|
955 + | Ok(Self(value))
|
943 956 | }
|
944 - | #[allow(missing_docs)] // documentation missing in model
|
945 - | pub fn fixed_length_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
946 - | self.fixed_length_blob.as_ref()
|
957 + | }
|
958 + |
|
959 + | #[allow(missing_docs)] // documentation missing in model
|
960 + | ///
|
961 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
962 + | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
963 + | ///
|
964 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
965 + | ///
|
966 + | #[derive(
|
967 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
968 + | )]
|
969 + | pub(crate) struct RangeByte(pub(crate) i8);
|
970 + | #[allow(dead_code)]
|
971 + | impl RangeByte {
|
972 + | /// Returns an immutable reference to the underlying [`i8`].
|
973 + | pub fn inner(&self) -> &i8 {
|
974 + | &self.0
|
947 975 | }
|
948 - | #[allow(missing_docs)] // documentation missing in model
|
949 - | pub fn range_integer(&self) -> i32 {
|
950 - | self.range_integer
|
976 + |
|
977 + | /// Consumes the value, returning the underlying [`i8`].
|
978 + | pub fn into_inner(self) -> i8 {
|
979 + | self.0
|
951 980 | }
|
952 - | #[allow(missing_docs)] // documentation missing in model
|
953 - | pub fn min_range_integer(&self) -> i32 {
|
954 - | self.min_range_integer
|
981 + | }
|
982 + |
|
983 + | impl crate::constrained::Constrained for RangeByte {
|
984 + | type Unconstrained = i8;
|
985 + | }
|
986 + |
|
987 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
988 + | fn from(value: i8) -> Self {
|
989 + | Self::Unconstrained(value)
|
955 990 | }
|
956 - | #[allow(missing_docs)] // documentation missing in model
|
957 - | pub fn max_range_integer(&self) -> i32 {
|
958 - | self.max_range_integer
|
991 + | }
|
992 + |
|
993 + | impl ::std::fmt::Display for RangeByte {
|
994 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
995 + | self.0.fmt(f)
|
959 996 | }
|
960 - | #[allow(missing_docs)] // documentation missing in model
|
961 - | pub fn fixed_value_integer(&self) -> i32 {
|
962 - | self.fixed_value_integer
|
997 + | }
|
998 + |
|
999 + | impl ::std::convert::From<RangeByte> for i8 {
|
1000 + | fn from(value: RangeByte) -> Self {
|
1001 + | value.into_inner()
|
963 1002 | }
|
964 - | #[allow(missing_docs)] // documentation missing in model
|
965 - | pub fn range_short(&self) -> i16 {
|
966 - | self.range_short
|
1003 + | }
|
1004 + | impl RangeByte {
|
1005 + | fn check_range(
|
1006 + | value: i8,
|
1007 + | ) -> ::std::result::Result<(), crate::model::range_byte_internal::ConstraintViolation> {
|
1008 + | if (0..=10).contains(&value) {
|
1009 + | Ok(())
|
1010 + | } else {
|
1011 + | Err(crate::model::range_byte_internal::ConstraintViolation::Range(value))
|
967 1012 | }
|
968 - | #[allow(missing_docs)] // documentation missing in model
|
969 - | pub fn min_range_short(&self) -> i16 {
|
970 - | self.min_range_short
|
971 1013 | }
|
972 - | #[allow(missing_docs)] // documentation missing in model
|
973 - | pub fn max_range_short(&self) -> i16 {
|
974 - | self.max_range_short
|
1014 + | }
|
1015 + | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1016 + | type Error = crate::model::range_byte_internal::ConstraintViolation;
|
1017 + |
|
1018 + | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1019 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1020 + | Self::check_range(value)?;
|
1021 + |
|
1022 + | Ok(Self(value))
|
975 1023 | }
|
1024 + | }
|
1025 + |
|
1026 + | #[allow(missing_docs)] // documentation missing in model
|
1027 + | #[derive(
|
1028 + | ::std::clone::Clone,
|
1029 + | ::std::cmp::Eq,
|
1030 + | ::std::cmp::Ord,
|
1031 + | ::std::cmp::PartialEq,
|
1032 + | ::std::cmp::PartialOrd,
|
1033 + | ::std::fmt::Debug,
|
1034 + | ::std::hash::Hash,
|
1035 + | )]
|
1036 + | pub enum EnumString {
|
976 1037 | #[allow(missing_docs)] // documentation missing in model
|
977 - | pub fn fixed_value_short(&self) -> i16 {
|
978 - | self.fixed_value_short
|
979 - | }
|
1038 + | M256Mega,
|
980 1039 | #[allow(missing_docs)] // documentation missing in model
|
981 - | pub fn range_long(&self) -> i64 {
|
982 - | self.range_long
|
983 - | }
|
1040 + | T2Micro,
|
984 1041 | #[allow(missing_docs)] // documentation missing in model
|
985 - | pub fn min_range_long(&self) -> i64 {
|
986 - | self.min_range_long
|
1042 + | T2Nano,
|
1043 + | }
|
1044 + | pub(crate) mod enum_string_internal {
|
1045 + | #[derive(Debug, PartialEq)]
|
1046 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
1047 + |
|
1048 + | impl ::std::fmt::Display for ConstraintViolation {
|
1049 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1050 + | write!(
|
1051 + | f,
|
1052 + | r#"Value provided for 'com.amazonaws.constraints#EnumString' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#
|
1053 + | )
|
987 1054 | }
|
988 - | #[allow(missing_docs)] // documentation missing in model
|
989 - | pub fn max_range_long(&self) -> i64 {
|
990 - | self.max_range_long
|
991 1055 | }
|
992 - | #[allow(missing_docs)] // documentation missing in model
|
993 - | pub fn fixed_value_long(&self) -> i64 {
|
994 - | self.fixed_value_long
|
1056 + |
|
1057 + | impl ::std::error::Error for ConstraintViolation {}
|
1058 + | impl ConstraintViolation {
|
1059 + | pub(crate) fn as_validation_exception_field(
|
1060 + | self,
|
1061 + | path: ::std::string::String,
|
1062 + | ) -> crate::model::ValidationExceptionField {
|
1063 + | crate::model::ValidationExceptionField {
|
1064 + | message: format!(
|
1065 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [t2.nano, t2.micro, m256.mega]"#,
|
1066 + | &path
|
1067 + | ),
|
1068 + | path,
|
995 1069 | }
|
996 - | #[allow(missing_docs)] // documentation missing in model
|
997 - | pub fn range_byte(&self) -> i8 {
|
998 - | self.range_byte
|
999 1070 | }
|
1000 - | #[allow(missing_docs)] // documentation missing in model
|
1001 - | pub fn min_range_byte(&self) -> i8 {
|
1002 - | self.min_range_byte
|
1003 1071 | }
|
1004 - | #[allow(missing_docs)] // documentation missing in model
|
1005 - | pub fn max_range_byte(&self) -> i8 {
|
1006 - | self.max_range_byte
|
1072 + | }
|
1073 + | impl ::std::convert::TryFrom<&str> for EnumString {
|
1074 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
1075 + | fn try_from(
|
1076 + | s: &str,
|
1077 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1078 + | match s {
|
1079 + | "m256.mega" => Ok(EnumString::M256Mega),
|
1080 + | "t2.micro" => Ok(EnumString::T2Micro),
|
1081 + | "t2.nano" => Ok(EnumString::T2Nano),
|
1082 + | _ => Err(crate::model::enum_string_internal::ConstraintViolation(
|
1083 + | s.to_owned(),
|
1084 + | )),
|
1007 1085 | }
|
1008 - | #[allow(missing_docs)] // documentation missing in model
|
1009 - | pub fn fixed_value_byte(&self) -> i8 {
|
1010 - | self.fixed_value_byte
|
1011 1086 | }
|
1012 - | #[allow(missing_docs)] // documentation missing in model
|
1013 - | pub fn con_b_list(&self) -> ::std::option::Option<&[::std::vec::Vec<crate::model::ConB>]> {
|
1014 - | self.con_b_list.as_deref()
|
1087 + | }
|
1088 + | impl ::std::convert::TryFrom<::std::string::String> for EnumString {
|
1089 + | type Error = crate::model::enum_string_internal::ConstraintViolation;
|
1090 + | fn try_from(
|
1091 + | s: ::std::string::String,
|
1092 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1093 + | {
|
1094 + | s.as_str().try_into()
|
1015 1095 | }
|
1016 - | #[allow(missing_docs)] // documentation missing in model
|
1017 - | pub fn length_list(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1018 - | self.length_list.as_deref()
|
1096 + | }
|
1097 + | impl std::str::FromStr for EnumString {
|
1098 + | type Err = crate::model::enum_string_internal::ConstraintViolation;
|
1099 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1100 + | Self::try_from(s)
|
1019 1101 | }
|
1020 - | #[allow(missing_docs)] // documentation missing in model
|
1021 - | pub fn sensitive_length_list(
|
1022 - | &self,
|
1023 - | ) -> ::std::option::Option<&[crate::model::SensitiveStructure]> {
|
1024 - | self.sensitive_length_list.as_deref()
|
1102 + | }
|
1103 + | impl EnumString {
|
1104 + | /// Returns the `&str` value of the enum member.
|
1105 + | pub fn as_str(&self) -> &str {
|
1106 + | match self {
|
1107 + | EnumString::M256Mega => "m256.mega",
|
1108 + | EnumString::T2Micro => "t2.micro",
|
1109 + | EnumString::T2Nano => "t2.nano",
|
1025 1110 | }
|
1026 - | #[allow(missing_docs)] // documentation missing in model
|
1027 - | pub fn con_b_set(&self) -> ::std::option::Option<&[::std::vec::Vec<::std::string::String>]> {
|
1028 - | self.con_b_set.as_deref()
|
1029 1111 | }
|
1030 - | #[allow(missing_docs)] // documentation missing in model
|
1031 - | pub fn con_b_map(
|
1032 - | &self,
|
1033 - | ) -> ::std::option::Option<
|
1034 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1035 - | > {
|
1036 - | self.con_b_map.as_ref()
|
1112 + | /// Returns all the `&str` representations of the enum members.
|
1113 + | pub const fn values() -> &'static [&'static str] {
|
1114 + | &["m256.mega", "t2.micro", "t2.nano"]
|
1037 1115 | }
|
1038 - | #[allow(missing_docs)] // documentation missing in model
|
1039 - | pub fn length_map(
|
1040 - | &self,
|
1041 - | ) -> ::std::option::Option<
|
1042 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1043 - | > {
|
1044 - | self.length_map.as_ref()
|
1116 + | }
|
1117 + | impl ::std::convert::AsRef<str> for EnumString {
|
1118 + | fn as_ref(&self) -> &str {
|
1119 + | self.as_str()
|
1045 1120 | }
|
1046 - | #[allow(missing_docs)] // documentation missing in model
|
1047 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
1048 - | &self,
|
1049 - | ) -> ::std::option::Option<
|
1050 - | &::std::collections::HashMap<
|
1051 - | ::std::string::String,
|
1052 - | ::std::collections::HashMap<
|
1053 - | ::std::string::String,
|
1054 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
1055 - | >,
|
1056 - | >,
|
1057 - | > {
|
1058 - | self.map_of_map_of_list_of_list_of_con_b.as_ref()
|
1059 - | }
|
1060 - | #[allow(missing_docs)] // documentation missing in model
|
1061 - | pub fn sparse_map(
|
1062 - | &self,
|
1063 - | ) -> ::std::option::Option<
|
1064 - | &::std::collections::HashMap<
|
1065 - | ::std::string::String,
|
1066 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1067 - | >,
|
1068 - | > {
|
1069 - | self.sparse_map.as_ref()
|
1070 - | }
|
1071 - | #[allow(missing_docs)] // documentation missing in model
|
1072 - | pub fn sparse_list(
|
1073 - | &self,
|
1074 - | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1075 - | self.sparse_list.as_deref()
|
1076 - | }
|
1077 - | #[allow(missing_docs)] // documentation missing in model
|
1078 - | pub fn sparse_length_map(
|
1079 - | &self,
|
1080 - | ) -> ::std::option::Option<
|
1081 - | &::std::collections::HashMap<
|
1082 - | ::std::string::String,
|
1083 - | ::std::option::Option<::std::string::String>,
|
1084 - | >,
|
1085 - | > {
|
1086 - | self.sparse_length_map.as_ref()
|
1087 - | }
|
1088 - | #[allow(missing_docs)] // documentation missing in model
|
1089 - | pub fn sparse_length_list(
|
1090 - | &self,
|
1091 - | ) -> ::std::option::Option<&[::std::option::Option<::std::string::String>]> {
|
1092 - | self.sparse_length_list.as_deref()
|
1093 - | }
|
1094 - | /// A union with constrained members.
|
1095 - | pub fn constrained_union(&self) -> ::std::option::Option<&crate::model::ConstrainedUnion> {
|
1096 - | self.constrained_union.as_ref()
|
1097 - | }
|
1098 - | #[allow(missing_docs)] // documentation missing in model
|
1099 - | pub fn enum_string(&self) -> ::std::option::Option<&crate::model::EnumString> {
|
1100 - | self.enum_string.as_ref()
|
1101 - | }
|
1102 - | #[allow(missing_docs)] // documentation missing in model
|
1103 - | pub fn list_of_length_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1104 - | self.list_of_length_string.as_deref()
|
1105 - | }
|
1106 - | #[allow(missing_docs)] // documentation missing in model
|
1107 - | pub fn set_of_length_string(
|
1108 - | &self,
|
1109 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1110 - | self.set_of_length_string.as_ref()
|
1111 - | }
|
1112 - | #[allow(missing_docs)] // documentation missing in model
|
1113 - | pub fn map_of_length_string(
|
1114 - | &self,
|
1115 - | ) -> ::std::option::Option<
|
1116 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1117 - | > {
|
1118 - | self.map_of_length_string.as_ref()
|
1119 - | }
|
1120 - | #[allow(missing_docs)] // documentation missing in model
|
1121 - | pub fn list_of_length_blob(&self) -> ::std::option::Option<&[::aws_smithy_types::Blob]> {
|
1122 - | self.list_of_length_blob.as_deref()
|
1123 - | }
|
1124 - | #[allow(missing_docs)] // documentation missing in model
|
1125 - | pub fn map_of_length_blob(
|
1126 - | &self,
|
1127 - | ) -> ::std::option::Option<
|
1128 - | &::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
1129 - | > {
|
1130 - | self.map_of_length_blob.as_ref()
|
1131 - | }
|
1132 - | #[allow(missing_docs)] // documentation missing in model
|
1133 - | pub fn list_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1134 - | self.list_of_range_integer.as_deref()
|
1135 - | }
|
1136 - | #[allow(missing_docs)] // documentation missing in model
|
1137 - | pub fn set_of_range_integer(&self) -> ::std::option::Option<&[i32]> {
|
1138 - | self.set_of_range_integer.as_deref()
|
1139 - | }
|
1140 - | #[allow(missing_docs)] // documentation missing in model
|
1141 - | pub fn map_of_range_integer(
|
1142 - | &self,
|
1143 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
|
1144 - | self.map_of_range_integer.as_ref()
|
1145 - | }
|
1146 - | #[allow(missing_docs)] // documentation missing in model
|
1147 - | pub fn list_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1148 - | self.list_of_range_short.as_deref()
|
1149 - | }
|
1150 - | #[allow(missing_docs)] // documentation missing in model
|
1151 - | pub fn set_of_range_short(&self) -> ::std::option::Option<&[i16]> {
|
1152 - | self.set_of_range_short.as_deref()
|
1153 - | }
|
1154 - | #[allow(missing_docs)] // documentation missing in model
|
1155 - | pub fn map_of_range_short(
|
1156 - | &self,
|
1157 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i16>> {
|
1158 - | self.map_of_range_short.as_ref()
|
1159 - | }
|
1160 - | #[allow(missing_docs)] // documentation missing in model
|
1161 - | pub fn list_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1162 - | self.list_of_range_long.as_deref()
|
1163 - | }
|
1164 - | #[allow(missing_docs)] // documentation missing in model
|
1165 - | pub fn set_of_range_long(&self) -> ::std::option::Option<&[i64]> {
|
1166 - | self.set_of_range_long.as_deref()
|
1167 - | }
|
1168 - | #[allow(missing_docs)] // documentation missing in model
|
1169 - | pub fn map_of_range_long(
|
1170 - | &self,
|
1171 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i64>> {
|
1172 - | self.map_of_range_long.as_ref()
|
1173 - | }
|
1174 - | #[allow(missing_docs)] // documentation missing in model
|
1175 - | pub fn list_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1176 - | self.list_of_range_byte.as_deref()
|
1177 - | }
|
1178 - | #[allow(missing_docs)] // documentation missing in model
|
1179 - | pub fn set_of_range_byte(&self) -> ::std::option::Option<&[i8]> {
|
1180 - | self.set_of_range_byte.as_deref()
|
1181 - | }
|
1182 - | #[allow(missing_docs)] // documentation missing in model
|
1183 - | pub fn map_of_range_byte(
|
1184 - | &self,
|
1185 - | ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i8>> {
|
1186 - | self.map_of_range_byte.as_ref()
|
1187 - | }
|
1188 - | #[allow(missing_docs)] // documentation missing in model
|
1189 - | pub fn non_streaming_blob(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
1190 - | self.non_streaming_blob.as_ref()
|
1191 - | }
|
1192 - | #[allow(missing_docs)] // documentation missing in model
|
1193 - | pub fn pattern_string(&self) -> ::std::option::Option<&str> {
|
1194 - | self.pattern_string.as_deref()
|
1195 - | }
|
1196 - | #[allow(missing_docs)] // documentation missing in model
|
1197 - | pub fn map_of_pattern_string(
|
1198 - | &self,
|
1199 - | ) -> ::std::option::Option<
|
1200 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1201 - | > {
|
1202 - | self.map_of_pattern_string.as_ref()
|
1203 - | }
|
1204 - | #[allow(missing_docs)] // documentation missing in model
|
1205 - | pub fn list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1206 - | self.list_of_pattern_string.as_deref()
|
1207 - | }
|
1208 - | #[allow(missing_docs)] // documentation missing in model
|
1209 - | pub fn set_of_pattern_string(
|
1210 - | &self,
|
1211 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1212 - | self.set_of_pattern_string.as_ref()
|
1213 - | }
|
1214 - | #[allow(missing_docs)] // documentation missing in model
|
1215 - | pub fn length_length_pattern_string(&self) -> ::std::option::Option<&str> {
|
1216 - | self.length_length_pattern_string.as_deref()
|
1217 - | }
|
1218 - | #[allow(missing_docs)] // documentation missing in model
|
1219 - | pub fn map_of_length_pattern_string(
|
1220 - | &self,
|
1221 - | ) -> ::std::option::Option<
|
1222 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1223 - | > {
|
1224 - | self.map_of_length_pattern_string.as_ref()
|
1225 - | }
|
1226 - | #[allow(missing_docs)] // documentation missing in model
|
1227 - | pub fn list_of_length_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1228 - | self.list_of_length_pattern_string.as_deref()
|
1229 - | }
|
1230 - | #[allow(missing_docs)] // documentation missing in model
|
1231 - | pub fn set_of_length_pattern_string(
|
1232 - | &self,
|
1233 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1234 - | self.set_of_length_pattern_string.as_ref()
|
1235 - | }
|
1236 - | #[allow(missing_docs)] // documentation missing in model
|
1237 - | pub fn length_list_of_pattern_string(&self) -> ::std::option::Option<&[::std::string::String]> {
|
1238 - | self.length_list_of_pattern_string.as_deref()
|
1239 - | }
|
1240 - | #[allow(missing_docs)] // documentation missing in model
|
1241 - | pub fn length_set_of_pattern_string(
|
1242 - | &self,
|
1243 - | ) -> ::std::option::Option<&::std::vec::Vec<::std::string::String>> {
|
1244 - | self.length_set_of_pattern_string.as_ref()
|
1245 - | }
|
1246 - | }
|
1247 - | impl crate::constrained::Constrained for crate::model::ConA {
|
1248 - | type Unconstrained = crate::model::con_a_internal::Builder;
|
1249 - | }
|
1250 - | impl ConA {
|
1251 - | /// Creates a new builder-style object to manufacture [`ConA`](crate::model::ConA).
|
1252 - | pub fn builder() -> crate::model::con_a::Builder {
|
1253 - | crate::model::con_a::Builder::default()
|
1121 + | }
|
1122 + | impl crate::constrained::Constrained for EnumString {
|
1123 + | type Unconstrained = ::std::string::String;
|
1124 + | }
|
1125 + |
|
1126 + | impl ::std::convert::From<::std::string::String>
|
1127 + | for crate::constrained::MaybeConstrained<crate::model::EnumString>
|
1128 + | {
|
1129 + | fn from(value: ::std::string::String) -> Self {
|
1130 + | Self::Unconstrained(value)
|
1254 1131 | }
|
1255 1132 | }
|
1256 1133 |
|
1257 1134 | #[allow(missing_docs)] // documentation missing in model
|
1258 1135 | ///
|
1259 1136 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1260 - | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1137 + | /// [constraint traits]. Use [`SetOfLengthString::try_from`] to construct values of this type.
|
1261 1138 | ///
|
1262 1139 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1263 1140 | ///
|
1264 1141 | #[derive(
|
1265 1142 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1266 1143 | )]
|
1267 - | pub(crate) struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1268 - | impl LengthSetOfPatternString {
|
1269 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1270 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1144 + | pub(crate) struct SetOfLengthString(pub(crate) ::std::vec::Vec<crate::model::LengthString>);
|
1145 + | impl SetOfLengthString {
|
1146 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthString>`].
|
1147 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthString> {
|
1271 1148 | self.0
|
1272 1149 | }
|
1273 1150 |
|
1274 - | fn check_length(
|
1275 - | length: usize,
|
1276 - | ) -> ::std::result::Result<
|
1277 - | (),
|
1278 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1279 - | > {
|
1280 - | if (5..=9).contains(&length) {
|
1281 - | Ok(())
|
1282 - | } else {
|
1283 - | Err(
|
1284 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation::Length(
|
1285 - | length,
|
1286 - | ),
|
1287 - | )
|
1288 - | }
|
1289 - | }
|
1290 - |
|
1291 1151 | fn check_unique_items(
|
1292 - | items: ::std::vec::Vec<crate::model::PatternString>,
|
1152 + | items: ::std::vec::Vec<crate::model::LengthString>,
|
1293 1153 | ) -> ::std::result::Result<
|
1294 - | ::std::vec::Vec<crate::model::PatternString>,
|
1295 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1154 + | ::std::vec::Vec<crate::model::LengthString>,
|
1155 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
1296 1156 | > {
|
1297 1157 | let mut seen = ::std::collections::HashMap::new();
|
1298 1158 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1299 1159 | for (idx, item) in items.iter().enumerate() {
|
1300 1160 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1301 1161 | duplicate_indices.push(prev_idx);
|
1302 1162 | }
|
1303 1163 | }
|
1304 1164 |
|
1305 1165 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1306 1166 | for idx in &duplicate_indices {
|
1307 1167 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1308 1168 | last_duplicate_indices.push(prev_idx);
|
1309 1169 | }
|
1310 1170 | }
|
1311 1171 | duplicate_indices.extend(last_duplicate_indices);
|
1312 1172 |
|
1313 1173 | if !duplicate_indices.is_empty() {
|
1314 1174 | debug_assert!(duplicate_indices.len() >= 2);
|
1315 - | Err(crate::model::length_set_of_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1175 + | Err(
|
1176 + | crate::model::set_of_length_string_internal::ConstraintViolation::UniqueItems {
|
1177 + | duplicate_indices,
|
1178 + | original: items,
|
1179 + | },
|
1180 + | )
|
1316 1181 | } else {
|
1317 1182 | Ok(items)
|
1318 1183 | }
|
1319 1184 | }
|
1320 1185 | }
|
1321 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1322 - | for LengthSetOfPatternString
|
1323 - | {
|
1324 - | type Error = crate::model::length_set_of_pattern_string_internal::ConstraintViolation;
|
1186 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthString>> for SetOfLengthString {
|
1187 + | type Error = crate::model::set_of_length_string_internal::ConstraintViolation;
|
1325 1188 |
|
1326 - | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1189 + | /// Constructs a `SetOfLengthString` from an [`::std::vec::Vec<crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
1327 1190 | fn try_from(
|
1328 - | value: ::std::vec::Vec<crate::model::PatternString>,
|
1191 + | value: ::std::vec::Vec<crate::model::LengthString>,
|
1329 1192 | ) -> ::std::result::Result<Self, Self::Error> {
|
1330 - | Self::check_length(value.len())?;
|
1331 - |
|
1332 1193 | let value = Self::check_unique_items(value)?;
|
1333 1194 |
|
1334 1195 | Ok(Self(value))
|
1335 1196 | }
|
1336 1197 | }
|
1337 1198 |
|
1338 - | impl ::std::convert::From<LengthSetOfPatternString>
|
1339 - | for ::std::vec::Vec<crate::model::PatternString>
|
1340 - | {
|
1341 - | fn from(value: LengthSetOfPatternString) -> Self {
|
1199 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<crate::model::LengthString> {
|
1200 + | fn from(value: SetOfLengthString) -> Self {
|
1342 1201 | value.into_inner()
|
1343 1202 | }
|
1344 1203 | }
|
1345 - | impl ::std::convert::From<LengthSetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1346 - | fn from(value: LengthSetOfPatternString) -> Self {
|
1204 + | impl ::std::convert::From<SetOfLengthString> for ::std::vec::Vec<::std::string::String> {
|
1205 + | fn from(value: SetOfLengthString) -> Self {
|
1347 1206 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1348 1207 | }
|
1349 1208 | }
|
1350 - | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1351 - | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1209 + | impl crate::constrained::Constrained for SetOfLengthString {
|
1210 + | type Unconstrained =
|
1211 + | crate::unconstrained::set_of_length_string_unconstrained::SetOfLengthStringUnconstrained;
|
1352 1212 | }
|
1353 1213 |
|
1354 1214 | #[allow(missing_docs)] // documentation missing in model
|
1355 1215 | ///
|
1356 1216 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1357 - | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
1217 + | /// [constraint traits]. Use [`LengthListOfPatternString::try_from`] to construct values of this type.
|
1358 1218 | ///
|
1359 1219 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1360 1220 | ///
|
1361 1221 | #[derive(
|
1362 1222 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1363 1223 | )]
|
1364 - | pub(crate) struct SetOfLengthPatternString(
|
1365 - | pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>,
|
1224 + | pub(crate) struct LengthListOfPatternString(
|
1225 + | pub(crate) ::std::vec::Vec<crate::model::PatternString>,
|
1366 1226 | );
|
1367 - | impl SetOfLengthPatternString {
|
1368 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
1369 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
1227 + | impl LengthListOfPatternString {
|
1228 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1229 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1370 1230 | self.0
|
1371 1231 | }
|
1372 1232 |
|
1373 - | fn check_unique_items(
|
1374 - | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1233 + | fn check_length(
|
1234 + | length: usize,
|
1375 1235 | ) -> ::std::result::Result<
|
1376 - | ::std::vec::Vec<crate::model::LengthPatternString>,
|
1377 - | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
1236 + | (),
|
1237 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
1378 1238 | > {
|
1379 - | let mut seen = ::std::collections::HashMap::new();
|
1380 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
1381 - | for (idx, item) in items.iter().enumerate() {
|
1382 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
1383 - | duplicate_indices.push(prev_idx);
|
1384 - | }
|
1385 - | }
|
1386 - |
|
1387 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1388 - | for idx in &duplicate_indices {
|
1389 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1390 - | last_duplicate_indices.push(prev_idx);
|
1391 - | }
|
1392 - | }
|
1393 - | duplicate_indices.extend(last_duplicate_indices);
|
1394 - |
|
1395 - | if !duplicate_indices.is_empty() {
|
1396 - | debug_assert!(duplicate_indices.len() >= 2);
|
1397 - | Err(crate::model::set_of_length_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1239 + | if (12..=39).contains(&length) {
|
1240 + | Ok(())
|
1398 1241 | } else {
|
1399 - | Ok(items)
|
1242 + | Err(
|
1243 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation::Length(
|
1244 + | length,
|
1245 + | ),
|
1246 + | )
|
1400 1247 | }
|
1401 1248 | }
|
1402 1249 | }
|
1403 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
1404 - | for SetOfLengthPatternString
|
1250 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1251 + | for LengthListOfPatternString
|
1405 1252 | {
|
1406 - | type Error = crate::model::set_of_length_pattern_string_internal::ConstraintViolation;
|
1253 + | type Error = crate::model::length_list_of_pattern_string_internal::ConstraintViolation;
|
1407 1254 |
|
1408 - | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1255 + | /// Constructs a `LengthListOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1409 1256 | fn try_from(
|
1410 - | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
1257 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
1411 1258 | ) -> ::std::result::Result<Self, Self::Error> {
|
1412 - | let value = Self::check_unique_items(value)?;
|
1259 + | Self::check_length(value.len())?;
|
1413 1260 |
|
1414 1261 | Ok(Self(value))
|
1415 1262 | }
|
1416 1263 | }
|
1417 1264 |
|
1418 - | impl ::std::convert::From<SetOfLengthPatternString>
|
1419 - | for ::std::vec::Vec<crate::model::LengthPatternString>
|
1265 + | impl ::std::convert::From<LengthListOfPatternString>
|
1266 + | for ::std::vec::Vec<crate::model::PatternString>
|
1420 1267 | {
|
1421 - | fn from(value: SetOfLengthPatternString) -> Self {
|
1268 + | fn from(value: LengthListOfPatternString) -> Self {
|
1422 1269 | value.into_inner()
|
1423 1270 | }
|
1424 1271 | }
|
1425 - | impl ::std::convert::From<SetOfLengthPatternString> for ::std::vec::Vec<::std::string::String> {
|
1426 - | fn from(value: SetOfLengthPatternString) -> Self {
|
1272 + | impl ::std::convert::From<LengthListOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1273 + | fn from(value: LengthListOfPatternString) -> Self {
|
1427 1274 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1428 1275 | }
|
1429 1276 | }
|
1430 - | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
1431 - | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
1277 + | impl crate::constrained::Constrained for LengthListOfPatternString {
|
1278 + | type Unconstrained = crate::unconstrained::length_list_of_pattern_string_unconstrained::LengthListOfPatternStringUnconstrained;
|
1432 1279 | }
|
1433 1280 |
|
1434 1281 | #[allow(missing_docs)] // documentation missing in model
|
1435 1282 | ///
|
1436 1283 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1437 - | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
1284 + | /// [constraint traits]. Use [`LengthSetOfPatternString::try_from`] to construct values of this type.
|
1438 1285 | ///
|
1439 1286 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1440 1287 | ///
|
1441 1288 | #[derive(
|
1442 1289 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1443 1290 | )]
|
1444 - | pub(crate) struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1445 - | impl SetOfPatternString {
|
1291 + | pub(crate) struct LengthSetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
1292 + | impl LengthSetOfPatternString {
|
1446 1293 | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
1447 1294 | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
1448 1295 | self.0
|
1449 1296 | }
|
1450 1297 |
|
1298 + | fn check_length(
|
1299 + | length: usize,
|
1300 + | ) -> ::std::result::Result<
|
1301 + | (),
|
1302 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1303 + | > {
|
1304 + | if (5..=9).contains(&length) {
|
1305 + | Ok(())
|
1306 + | } else {
|
1307 + | Err(
|
1308 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation::Length(
|
1309 + | length,
|
1310 + | ),
|
1311 + | )
|
1312 + | }
|
1313 + | }
|
1314 + |
|
1451 1315 | fn check_unique_items(
|
1452 1316 | items: ::std::vec::Vec<crate::model::PatternString>,
|
1453 1317 | ) -> ::std::result::Result<
|
1454 1318 | ::std::vec::Vec<crate::model::PatternString>,
|
1455 - | crate::model::set_of_pattern_string_internal::ConstraintViolation,
|
1319 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
1456 1320 | > {
|
1457 1321 | let mut seen = ::std::collections::HashMap::new();
|
1458 1322 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1459 1323 | for (idx, item) in items.iter().enumerate() {
|
1460 1324 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1461 1325 | duplicate_indices.push(prev_idx);
|
1462 1326 | }
|
1463 1327 | }
|
1464 1328 |
|
1465 1329 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1466 1330 | for idx in &duplicate_indices {
|
1467 1331 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1468 1332 | last_duplicate_indices.push(prev_idx);
|
1469 1333 | }
|
1470 1334 | }
|
1471 1335 | duplicate_indices.extend(last_duplicate_indices);
|
1472 1336 |
|
1473 1337 | if !duplicate_indices.is_empty() {
|
1474 1338 | debug_assert!(duplicate_indices.len() >= 2);
|
1475 - | Err(
|
1476 - | crate::model::set_of_pattern_string_internal::ConstraintViolation::UniqueItems {
|
1477 - | duplicate_indices,
|
1478 - | original: items,
|
1479 - | },
|
1480 - | )
|
1339 + | Err(crate::model::length_set_of_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
1481 1340 | } else {
|
1482 1341 | Ok(items)
|
1483 1342 | }
|
1484 1343 | }
|
1485 1344 | }
|
1486 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
1487 - | type Error = crate::model::set_of_pattern_string_internal::ConstraintViolation;
|
1345 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>>
|
1346 + | for LengthSetOfPatternString
|
1347 + | {
|
1348 + | type Error = crate::model::length_set_of_pattern_string_internal::ConstraintViolation;
|
1488 1349 |
|
1489 - | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1350 + | /// Constructs a `LengthSetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
1490 1351 | fn try_from(
|
1491 1352 | value: ::std::vec::Vec<crate::model::PatternString>,
|
1492 1353 | ) -> ::std::result::Result<Self, Self::Error> {
|
1354 + | Self::check_length(value.len())?;
|
1355 + |
|
1493 1356 | let value = Self::check_unique_items(value)?;
|
1494 1357 |
|
1495 1358 | Ok(Self(value))
|
1496 1359 | }
|
1497 1360 | }
|
1498 1361 |
|
1499 - | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
1500 - | fn from(value: SetOfPatternString) -> Self {
|
1362 + | impl ::std::convert::From<LengthSetOfPatternString>
|
1363 + | for ::std::vec::Vec<crate::model::PatternString>
|
1364 + | {
|
1365 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1501 1366 | value.into_inner()
|
1502 1367 | }
|
1503 1368 | }
|
1504 - | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1505 - | fn from(value: SetOfPatternString) -> Self {
|
1369 + | impl ::std::convert::From<LengthSetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
1370 + | fn from(value: LengthSetOfPatternString) -> Self {
|
1506 1371 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1507 1372 | }
|
1508 1373 | }
|
1509 - | impl crate::constrained::Constrained for SetOfPatternString {
|
1510 - | type Unconstrained =
|
1511 - | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
1512 - | }
|
1513 - |
|
1514 - | #[allow(missing_docs)] // documentation missing in model
|
1515 - | ///
|
1516 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1517 - | /// [constraint traits]. Use [`RangeByte::try_from`] to construct values of this type.
|
1518 - | ///
|
1519 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1520 - | ///
|
1521 - | #[derive(
|
1522 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1523 - | )]
|
1524 - | pub(crate) struct RangeByte(pub(crate) i8);
|
1525 - | #[allow(dead_code)]
|
1526 - | impl RangeByte {
|
1527 - | /// Returns an immutable reference to the underlying [`i8`].
|
1528 - | pub fn inner(&self) -> &i8 {
|
1529 - | &self.0
|
1530 - | }
|
1531 - |
|
1532 - | /// Consumes the value, returning the underlying [`i8`].
|
1533 - | pub fn into_inner(self) -> i8 {
|
1534 - | self.0
|
1535 - | }
|
1536 - | }
|
1537 - |
|
1538 - | impl crate::constrained::Constrained for RangeByte {
|
1539 - | type Unconstrained = i8;
|
1540 - | }
|
1541 - |
|
1542 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::RangeByte> {
|
1543 - | fn from(value: i8) -> Self {
|
1544 - | Self::Unconstrained(value)
|
1545 - | }
|
1546 - | }
|
1547 - |
|
1548 - | impl ::std::fmt::Display for RangeByte {
|
1549 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1550 - | self.0.fmt(f)
|
1551 - | }
|
1552 - | }
|
1553 - |
|
1554 - | impl ::std::convert::From<RangeByte> for i8 {
|
1555 - | fn from(value: RangeByte) -> Self {
|
1556 - | value.into_inner()
|
1557 - | }
|
1558 - | }
|
1559 - | impl RangeByte {
|
1560 - | fn check_range(
|
1561 - | value: i8,
|
1562 - | ) -> ::std::result::Result<(), crate::model::range_byte_internal::ConstraintViolation> {
|
1563 - | if (0..=10).contains(&value) {
|
1564 - | Ok(())
|
1565 - | } else {
|
1566 - | Err(crate::model::range_byte_internal::ConstraintViolation::Range(value))
|
1567 - | }
|
1568 - | }
|
1569 - | }
|
1570 - | impl ::std::convert::TryFrom<i8> for RangeByte {
|
1571 - | type Error = crate::model::range_byte_internal::ConstraintViolation;
|
1572 - |
|
1573 - | /// Constructs a `RangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
1574 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
1575 - | Self::check_range(value)?;
|
1576 - |
|
1577 - | Ok(Self(value))
|
1578 - | }
|
1374 + | impl crate::constrained::Constrained for LengthSetOfPatternString {
|
1375 + | type Unconstrained = crate::unconstrained::length_set_of_pattern_string_unconstrained::LengthSetOfPatternStringUnconstrained;
|
1579 1376 | }
|
1580 1377 |
|
1581 1378 | #[allow(missing_docs)] // documentation missing in model
|
1582 1379 | ///
|
1583 1380 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1584 1381 | /// [constraint traits]. Use [`SetOfRangeByte::try_from`] to construct values of this type.
|
1585 1382 | ///
|
1586 1383 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1587 1384 | ///
|
1588 1385 | #[derive(
|
1654 1451 | }
|
1655 1452 | }
|
1656 1453 | impl crate::constrained::Constrained for SetOfRangeByte {
|
1657 1454 | type Unconstrained =
|
1658 1455 | crate::unconstrained::set_of_range_byte_unconstrained::SetOfRangeByteUnconstrained;
|
1659 1456 | }
|
1660 1457 |
|
1661 1458 | #[allow(missing_docs)] // documentation missing in model
|
1662 1459 | ///
|
1663 1460 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1664 - | /// [constraint traits]. Use [`RangeLong::try_from`] to construct values of this type.
|
1461 + | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
1665 1462 | ///
|
1666 1463 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1667 1464 | ///
|
1668 1465 | #[derive(
|
1669 1466 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1670 1467 | )]
|
1671 - | pub(crate) struct RangeLong(pub(crate) i64);
|
1672 - | #[allow(dead_code)]
|
1673 - | impl RangeLong {
|
1674 - | /// Returns an immutable reference to the underlying [`i64`].
|
1675 - | pub fn inner(&self) -> &i64 {
|
1676 - | &self.0
|
1468 + | pub(crate) struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1469 + | impl SetOfRangeShort {
|
1470 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1471 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1472 + | self.0
|
1677 1473 | }
|
1678 1474 |
|
1679 - | /// Consumes the value, returning the underlying [`i64`].
|
1680 - | pub fn into_inner(self) -> i64 {
|
1681 - | self.0
|
1475 + | fn check_unique_items(
|
1476 + | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1477 + | ) -> ::std::result::Result<
|
1478 + | ::std::vec::Vec<crate::model::RangeShort>,
|
1479 + | crate::model::set_of_range_short_internal::ConstraintViolation,
|
1480 + | > {
|
1481 + | let mut seen = ::std::collections::HashMap::new();
|
1482 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1483 + | for (idx, item) in items.iter().enumerate() {
|
1484 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1485 + | duplicate_indices.push(prev_idx);
|
1486 + | }
|
1682 1487 | }
|
1683 - | }
|
1684 1488 |
|
1685 - | impl crate::constrained::Constrained for RangeLong {
|
1686 - | type Unconstrained = i64;
|
1687 - | }
|
1489 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1490 + | for idx in &duplicate_indices {
|
1491 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1492 + | last_duplicate_indices.push(prev_idx);
|
1493 + | }
|
1494 + | }
|
1495 + | duplicate_indices.extend(last_duplicate_indices);
|
1688 1496 |
|
1689 - | impl ::std::convert::From<i64> for crate::constrained::MaybeConstrained<crate::model::RangeLong> {
|
1690 - | fn from(value: i64) -> Self {
|
1691 - | Self::Unconstrained(value)
|
1497 + | if !duplicate_indices.is_empty() {
|
1498 + | debug_assert!(duplicate_indices.len() >= 2);
|
1499 + | Err(
|
1500 + | crate::model::set_of_range_short_internal::ConstraintViolation::UniqueItems {
|
1501 + | duplicate_indices,
|
1502 + | original: items,
|
1503 + | },
|
1504 + | )
|
1505 + | } else {
|
1506 + | Ok(items)
|
1507 + | }
|
1692 1508 | }
|
1693 1509 | }
|
1510 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
1511 + | type Error = crate::model::set_of_range_short_internal::ConstraintViolation;
|
1694 1512 |
|
1695 - | impl ::std::fmt::Display for RangeLong {
|
1696 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1697 - | self.0.fmt(f)
|
1513 + | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
1514 + | fn try_from(
|
1515 + | value: ::std::vec::Vec<crate::model::RangeShort>,
|
1516 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1517 + | let value = Self::check_unique_items(value)?;
|
1518 + |
|
1519 + | Ok(Self(value))
|
1698 1520 | }
|
1699 1521 | }
|
1700 1522 |
|
1701 - | impl ::std::convert::From<RangeLong> for i64 {
|
1702 - | fn from(value: RangeLong) -> Self {
|
1523 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
1524 + | fn from(value: SetOfRangeShort) -> Self {
|
1703 1525 | value.into_inner()
|
1704 1526 | }
|
1705 1527 | }
|
1706 - | impl RangeLong {
|
1707 - | fn check_range(
|
1708 - | value: i64,
|
1709 - | ) -> ::std::result::Result<(), crate::model::range_long_internal::ConstraintViolation> {
|
1710 - | if (0..=10).contains(&value) {
|
1711 - | Ok(())
|
1712 - | } else {
|
1713 - | Err(crate::model::range_long_internal::ConstraintViolation::Range(value))
|
1714 - | }
|
1528 + | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<i16> {
|
1529 + | fn from(value: SetOfRangeShort) -> Self {
|
1530 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1715 1531 | }
|
1716 1532 | }
|
1717 - | impl ::std::convert::TryFrom<i64> for RangeLong {
|
1718 - | type Error = crate::model::range_long_internal::ConstraintViolation;
|
1719 - |
|
1720 - | /// Constructs a `RangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
1721 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
1722 - | Self::check_range(value)?;
|
1723 - |
|
1724 - | Ok(Self(value))
|
1725 - | }
|
1533 + | impl crate::constrained::Constrained for SetOfRangeShort {
|
1534 + | type Unconstrained =
|
1535 + | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
1726 1536 | }
|
1727 1537 |
|
1728 1538 | #[allow(missing_docs)] // documentation missing in model
|
1729 1539 | ///
|
1730 1540 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1731 - | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
1541 + | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
1732 1542 | ///
|
1733 1543 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1734 1544 | ///
|
1735 1545 | #[derive(
|
1736 1546 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1737 1547 | )]
|
1738 - | pub(crate) struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
1739 - | impl SetOfRangeLong {
|
1740 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1741 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
1548 + | pub(crate) struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
1549 + | impl SetOfRangeInteger {
|
1550 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
1551 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
1742 1552 | self.0
|
1743 1553 | }
|
1744 1554 |
|
1745 1555 | fn check_unique_items(
|
1746 - | items: ::std::vec::Vec<crate::model::RangeLong>,
|
1556 + | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
1747 1557 | ) -> ::std::result::Result<
|
1748 - | ::std::vec::Vec<crate::model::RangeLong>,
|
1749 - | crate::model::set_of_range_long_internal::ConstraintViolation,
|
1558 + | ::std::vec::Vec<crate::model::RangeInteger>,
|
1559 + | crate::model::set_of_range_integer_internal::ConstraintViolation,
|
1750 1560 | > {
|
1751 1561 | let mut seen = ::std::collections::HashMap::new();
|
1752 1562 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1753 1563 | for (idx, item) in items.iter().enumerate() {
|
1754 1564 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1755 1565 | duplicate_indices.push(prev_idx);
|
1756 1566 | }
|
1757 1567 | }
|
1758 1568 |
|
1759 1569 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1760 1570 | for idx in &duplicate_indices {
|
1761 1571 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1762 1572 | last_duplicate_indices.push(prev_idx);
|
1763 1573 | }
|
1764 1574 | }
|
1765 1575 | duplicate_indices.extend(last_duplicate_indices);
|
1766 1576 |
|
1767 1577 | if !duplicate_indices.is_empty() {
|
1768 1578 | debug_assert!(duplicate_indices.len() >= 2);
|
1769 1579 | Err(
|
1770 - | crate::model::set_of_range_long_internal::ConstraintViolation::UniqueItems {
|
1580 + | crate::model::set_of_range_integer_internal::ConstraintViolation::UniqueItems {
|
1771 1581 | duplicate_indices,
|
1772 1582 | original: items,
|
1773 1583 | },
|
1774 1584 | )
|
1775 1585 | } else {
|
1776 1586 | Ok(items)
|
1777 1587 | }
|
1778 1588 | }
|
1779 1589 | }
|
1780 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
1781 - | type Error = crate::model::set_of_range_long_internal::ConstraintViolation;
|
1590 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
1591 + | type Error = crate::model::set_of_range_integer_internal::ConstraintViolation;
|
1782 1592 |
|
1783 - | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
1593 + | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
1784 1594 | fn try_from(
|
1785 - | value: ::std::vec::Vec<crate::model::RangeLong>,
|
1595 + | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
1786 1596 | ) -> ::std::result::Result<Self, Self::Error> {
|
1787 1597 | let value = Self::check_unique_items(value)?;
|
1788 1598 |
|
1789 1599 | Ok(Self(value))
|
1790 1600 | }
|
1791 1601 | }
|
1792 1602 |
|
1793 - | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
1794 - | fn from(value: SetOfRangeLong) -> Self {
|
1603 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
1604 + | fn from(value: SetOfRangeInteger) -> Self {
|
1795 1605 | value.into_inner()
|
1796 1606 | }
|
1797 1607 | }
|
1798 - | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<i64> {
|
1799 - | fn from(value: SetOfRangeLong) -> Self {
|
1608 + | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<i32> {
|
1609 + | fn from(value: SetOfRangeInteger) -> Self {
|
1800 1610 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1801 1611 | }
|
1802 1612 | }
|
1803 - | impl crate::constrained::Constrained for SetOfRangeLong {
|
1613 + | impl crate::constrained::Constrained for SetOfRangeInteger {
|
1804 1614 | type Unconstrained =
|
1805 - | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
1806 - | }
|
1807 - |
|
1808 - | #[allow(missing_docs)] // documentation missing in model
|
1809 - | ///
|
1810 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1811 - | /// [constraint traits]. Use [`RangeShort::try_from`] to construct values of this type.
|
1812 - | ///
|
1813 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1814 - | ///
|
1815 - | #[derive(
|
1816 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1817 - | )]
|
1818 - | pub(crate) struct RangeShort(pub(crate) i16);
|
1819 - | #[allow(dead_code)]
|
1820 - | impl RangeShort {
|
1821 - | /// Returns an immutable reference to the underlying [`i16`].
|
1822 - | pub fn inner(&self) -> &i16 {
|
1823 - | &self.0
|
1824 - | }
|
1825 - |
|
1826 - | /// Consumes the value, returning the underlying [`i16`].
|
1827 - | pub fn into_inner(self) -> i16 {
|
1828 - | self.0
|
1829 - | }
|
1830 - | }
|
1831 - |
|
1832 - | impl crate::constrained::Constrained for RangeShort {
|
1833 - | type Unconstrained = i16;
|
1834 - | }
|
1835 - |
|
1836 - | impl ::std::convert::From<i16> for crate::constrained::MaybeConstrained<crate::model::RangeShort> {
|
1837 - | fn from(value: i16) -> Self {
|
1838 - | Self::Unconstrained(value)
|
1839 - | }
|
1840 - | }
|
1841 - |
|
1842 - | impl ::std::fmt::Display for RangeShort {
|
1843 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1844 - | self.0.fmt(f)
|
1845 - | }
|
1846 - | }
|
1847 - |
|
1848 - | impl ::std::convert::From<RangeShort> for i16 {
|
1849 - | fn from(value: RangeShort) -> Self {
|
1850 - | value.into_inner()
|
1851 - | }
|
1852 - | }
|
1853 - | impl RangeShort {
|
1854 - | fn check_range(
|
1855 - | value: i16,
|
1856 - | ) -> ::std::result::Result<(), crate::model::range_short_internal::ConstraintViolation> {
|
1857 - | if (0..=10).contains(&value) {
|
1858 - | Ok(())
|
1859 - | } else {
|
1860 - | Err(crate::model::range_short_internal::ConstraintViolation::Range(value))
|
1861 - | }
|
1862 - | }
|
1863 - | }
|
1864 - | impl ::std::convert::TryFrom<i16> for RangeShort {
|
1865 - | type Error = crate::model::range_short_internal::ConstraintViolation;
|
1866 - |
|
1867 - | /// Constructs a `RangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
1868 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
1869 - | Self::check_range(value)?;
|
1870 - |
|
1871 - | Ok(Self(value))
|
1872 - | }
|
1615 + | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
1873 1616 | }
|
1874 1617 |
|
1875 1618 | #[allow(missing_docs)] // documentation missing in model
|
1876 1619 | ///
|
1877 1620 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1878 - | /// [constraint traits]. Use [`SetOfRangeShort::try_from`] to construct values of this type.
|
1621 + | /// [constraint traits]. Use [`SetOfRangeLong::try_from`] to construct values of this type.
|
1879 1622 | ///
|
1880 1623 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1881 1624 | ///
|
1882 1625 | #[derive(
|
1883 1626 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1884 1627 | )]
|
1885 - | pub(crate) struct SetOfRangeShort(pub(crate) ::std::vec::Vec<crate::model::RangeShort>);
|
1886 - | impl SetOfRangeShort {
|
1887 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeShort>`].
|
1888 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeShort> {
|
1628 + | pub(crate) struct SetOfRangeLong(pub(crate) ::std::vec::Vec<crate::model::RangeLong>);
|
1629 + | impl SetOfRangeLong {
|
1630 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeLong>`].
|
1631 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeLong> {
|
1889 1632 | self.0
|
1890 1633 | }
|
1891 1634 |
|
1892 1635 | fn check_unique_items(
|
1893 - | items: ::std::vec::Vec<crate::model::RangeShort>,
|
1636 + | items: ::std::vec::Vec<crate::model::RangeLong>,
|
1894 1637 | ) -> ::std::result::Result<
|
1895 - | ::std::vec::Vec<crate::model::RangeShort>,
|
1896 - | crate::model::set_of_range_short_internal::ConstraintViolation,
|
1638 + | ::std::vec::Vec<crate::model::RangeLong>,
|
1639 + | crate::model::set_of_range_long_internal::ConstraintViolation,
|
1897 1640 | > {
|
1898 1641 | let mut seen = ::std::collections::HashMap::new();
|
1899 1642 | let mut duplicate_indices = ::std::vec::Vec::new();
|
1900 1643 | for (idx, item) in items.iter().enumerate() {
|
1901 1644 | if let Some(prev_idx) = seen.insert(item, idx) {
|
1902 1645 | duplicate_indices.push(prev_idx);
|
1903 1646 | }
|
1904 1647 | }
|
1905 1648 |
|
1906 1649 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1907 1650 | for idx in &duplicate_indices {
|
1908 1651 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1909 1652 | last_duplicate_indices.push(prev_idx);
|
1910 1653 | }
|
1911 1654 | }
|
1912 1655 | duplicate_indices.extend(last_duplicate_indices);
|
1913 1656 |
|
1914 1657 | if !duplicate_indices.is_empty() {
|
1915 1658 | debug_assert!(duplicate_indices.len() >= 2);
|
1916 1659 | Err(
|
1917 - | crate::model::set_of_range_short_internal::ConstraintViolation::UniqueItems {
|
1660 + | crate::model::set_of_range_long_internal::ConstraintViolation::UniqueItems {
|
1918 1661 | duplicate_indices,
|
1919 1662 | original: items,
|
1920 1663 | },
|
1921 1664 | )
|
1922 1665 | } else {
|
1923 1666 | Ok(items)
|
1924 1667 | }
|
1925 1668 | }
|
1926 1669 | }
|
1927 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeShort>> for SetOfRangeShort {
|
1928 - | type Error = crate::model::set_of_range_short_internal::ConstraintViolation;
|
1670 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeLong>> for SetOfRangeLong {
|
1671 + | type Error = crate::model::set_of_range_long_internal::ConstraintViolation;
|
1929 1672 |
|
1930 - | /// Constructs a `SetOfRangeShort` from an [`::std::vec::Vec<crate::model::RangeShort>`], failing when the provided value does not satisfy the modeled constraints.
|
1673 + | /// Constructs a `SetOfRangeLong` from an [`::std::vec::Vec<crate::model::RangeLong>`], failing when the provided value does not satisfy the modeled constraints.
|
1931 1674 | fn try_from(
|
1932 - | value: ::std::vec::Vec<crate::model::RangeShort>,
|
1675 + | value: ::std::vec::Vec<crate::model::RangeLong>,
|
1933 1676 | ) -> ::std::result::Result<Self, Self::Error> {
|
1934 1677 | let value = Self::check_unique_items(value)?;
|
1935 1678 |
|
1936 1679 | Ok(Self(value))
|
1937 1680 | }
|
1938 1681 | }
|
1939 1682 |
|
1940 - | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<crate::model::RangeShort> {
|
1941 - | fn from(value: SetOfRangeShort) -> Self {
|
1683 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<crate::model::RangeLong> {
|
1684 + | fn from(value: SetOfRangeLong) -> Self {
|
1942 1685 | value.into_inner()
|
1943 1686 | }
|
1944 1687 | }
|
1945 - | impl ::std::convert::From<SetOfRangeShort> for ::std::vec::Vec<i16> {
|
1946 - | fn from(value: SetOfRangeShort) -> Self {
|
1688 + | impl ::std::convert::From<SetOfRangeLong> for ::std::vec::Vec<i64> {
|
1689 + | fn from(value: SetOfRangeLong) -> Self {
|
1947 1690 | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1948 1691 | }
|
1949 1692 | }
|
1950 - | impl crate::constrained::Constrained for SetOfRangeShort {
|
1693 + | impl crate::constrained::Constrained for SetOfRangeLong {
|
1951 1694 | type Unconstrained =
|
1952 - | crate::unconstrained::set_of_range_short_unconstrained::SetOfRangeShortUnconstrained;
|
1695 + | crate::unconstrained::set_of_range_long_unconstrained::SetOfRangeLongUnconstrained;
|
1953 1696 | }
|
1954 1697 |
|
1955 1698 | #[allow(missing_docs)] // documentation missing in model
|
1956 - | ///
|
1957 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1958 - | /// [constraint traits]. Use [`RangeInteger::try_from`] to construct values of this type.
|
1959 - | ///
|
1960 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1961 - | ///
|
1962 1699 | #[derive(
|
1963 1700 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1964 1701 | )]
|
1965 - | pub(crate) struct RangeInteger(pub(crate) i32);
|
1966 - | #[allow(dead_code)]
|
1967 - | impl RangeInteger {
|
1968 - | /// Returns an immutable reference to the underlying [`i32`].
|
1969 - | pub fn inner(&self) -> &i32 {
|
1970 - | &self.0
|
1971 - | }
|
1972 - |
|
1973 - | /// Consumes the value, returning the underlying [`i32`].
|
1974 - | pub fn into_inner(self) -> i32 {
|
1975 - | self.0
|
1976 - | }
|
1977 - | }
|
1978 - |
|
1979 - | impl crate::constrained::Constrained for RangeInteger {
|
1980 - | type Unconstrained = i32;
|
1981 - | }
|
1982 - |
|
1983 - | impl ::std::convert::From<i32>
|
1984 - | for crate::constrained::MaybeConstrained<crate::model::RangeInteger>
|
1985 - | {
|
1986 - | fn from(value: i32) -> Self {
|
1987 - | Self::Unconstrained(value)
|
1988 - | }
|
1989 - | }
|
1990 - |
|
1991 - | impl ::std::fmt::Display for RangeInteger {
|
1992 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1993 - | self.0.fmt(f)
|
1994 - | }
|
1702 + | pub struct RecursiveShapesInputOutputNested1 {
|
1703 + | #[allow(missing_docs)] // documentation missing in model
|
1704 + | pub recursive_member: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
1995 1705 | }
|
1996 - |
|
1997 - | impl ::std::convert::From<RangeInteger> for i32 {
|
1998 - | fn from(value: RangeInteger) -> Self {
|
1999 - | value.into_inner()
|
1706 + | impl RecursiveShapesInputOutputNested1 {
|
1707 + | #[allow(missing_docs)] // documentation missing in model
|
1708 + | pub fn recursive_member(&self) -> &crate::model::RecursiveShapesInputOutputNested2 {
|
1709 + | use std::ops::Deref;
|
1710 + | self.recursive_member.deref()
|
2000 1711 | }
|
2001 1712 | }
|
2002 - | impl RangeInteger {
|
2003 - | fn check_range(
|
2004 - | value: i32,
|
2005 - | ) -> ::std::result::Result<(), crate::model::range_integer_internal::ConstraintViolation> {
|
2006 - | if (0..=69).contains(&value) {
|
2007 - | Ok(())
|
2008 - | } else {
|
2009 - | Err(crate::model::range_integer_internal::ConstraintViolation::Range(value))
|
2010 - | }
|
2011 - | }
|
1713 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
1714 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
2012 1715 | }
|
2013 - | impl ::std::convert::TryFrom<i32> for RangeInteger {
|
2014 - | type Error = crate::model::range_integer_internal::ConstraintViolation;
|
2015 - |
|
2016 - | /// Constructs a `RangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2017 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2018 - | Self::check_range(value)?;
|
2019 - |
|
2020 - | Ok(Self(value))
|
1716 + | impl RecursiveShapesInputOutputNested1 {
|
1717 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
1718 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
1719 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
2021 1720 | }
|
2022 1721 | }
|
2023 1722 |
|
2024 1723 | #[allow(missing_docs)] // documentation missing in model
|
2025 1724 | ///
|
2026 1725 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2027 - | /// [constraint traits]. Use [`SetOfRangeInteger::try_from`] to construct values of this type.
|
1726 + | /// [constraint traits]. Use [`ConBMap::try_from`] to construct values of this type.
|
2028 1727 | ///
|
2029 1728 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2030 1729 | ///
|
2031 - | #[derive(
|
2032 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2033 - | )]
|
2034 - | pub(crate) struct SetOfRangeInteger(pub(crate) ::std::vec::Vec<crate::model::RangeInteger>);
|
2035 - | impl SetOfRangeInteger {
|
2036 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::RangeInteger>`].
|
2037 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::RangeInteger> {
|
1730 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1731 + | pub(crate) struct ConBMap(
|
1732 + | pub(crate) ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1733 + | );
|
1734 + | impl ConBMap {
|
1735 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`].
|
1736 + | pub fn into_inner(
|
1737 + | self,
|
1738 + | ) -> ::std::collections::HashMap<::std::string::String, crate::model::LengthString> {
|
2038 1739 | self.0
|
2039 1740 | }
|
1741 + | }
|
1742 + | impl
|
1743 + | ::std::convert::TryFrom<
|
1744 + | ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1745 + | > for ConBMap
|
1746 + | {
|
1747 + | type Error = crate::model::con_b_map_internal::ConstraintViolation;
|
2040 1748 |
|
2041 - | fn check_unique_items(
|
2042 - | items: ::std::vec::Vec<crate::model::RangeInteger>,
|
2043 - | ) -> ::std::result::Result<
|
2044 - | ::std::vec::Vec<crate::model::RangeInteger>,
|
2045 - | crate::model::set_of_range_integer_internal::ConstraintViolation,
|
2046 - | > {
|
2047 - | let mut seen = ::std::collections::HashMap::new();
|
2048 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2049 - | for (idx, item) in items.iter().enumerate() {
|
2050 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2051 - | duplicate_indices.push(prev_idx);
|
1749 + | /// Constructs a `ConBMap` from an [`::std::collections::HashMap<::std::string::String, crate::model::LengthString>`], failing when the provided value does not satisfy the modeled constraints.
|
1750 + | fn try_from(
|
1751 + | value: ::std::collections::HashMap<::std::string::String, crate::model::LengthString>,
|
1752 + | ) -> ::std::result::Result<Self, Self::Error> {
|
1753 + | let length = value.len();
|
1754 + | if (1..=69).contains(&length) {
|
1755 + | Ok(Self(value))
|
1756 + | } else {
|
1757 + | Err(crate::model::con_b_map_internal::ConstraintViolation::Length(length))
|
2052 1758 | }
|
2053 1759 | }
|
1760 + | }
|
2054 1761 |
|
2055 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2056 - | for idx in &duplicate_indices {
|
2057 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2058 - | last_duplicate_indices.push(prev_idx);
|
1762 + | impl ::std::convert::From<ConBMap>
|
1763 + | for ::std::collections::HashMap<::std::string::String, crate::model::LengthString>
|
1764 + | {
|
1765 + | fn from(value: ConBMap) -> Self {
|
1766 + | value.into_inner()
|
2059 1767 | }
|
1768 + | }
|
1769 + | impl ::std::convert::From<ConBMap>
|
1770 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
1771 + | {
|
1772 + | fn from(value: ConBMap) -> Self {
|
1773 + | value
|
1774 + | .into_inner()
|
1775 + | .into_iter()
|
1776 + | .map(|(k, v)| (k, v.into()))
|
1777 + | .collect()
|
2060 1778 | }
|
2061 - | duplicate_indices.extend(last_duplicate_indices);
|
1779 + | }
|
1780 + | impl crate::constrained::Constrained for ConBMap {
|
1781 + | type Unconstrained = crate::unconstrained::con_b_map_unconstrained::ConBMapUnconstrained;
|
1782 + | }
|
2062 1783 |
|
2063 - | if !duplicate_indices.is_empty() {
|
2064 - | debug_assert!(duplicate_indices.len() >= 2);
|
2065 - | Err(
|
2066 - | crate::model::set_of_range_integer_internal::ConstraintViolation::UniqueItems {
|
2067 - | duplicate_indices,
|
2068 - | original: items,
|
2069 - | },
|
2070 - | )
|
1784 + | #[allow(missing_docs)] // documentation missing in model
|
1785 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1786 + | pub enum Event {
|
1787 + | #[allow(missing_docs)] // documentation missing in model
|
1788 + | RegularMessage(crate::model::EventStreamRegularMessage),
|
1789 + | }
|
1790 + | impl Event {
|
1791 + | #[allow(irrefutable_let_patterns)]
|
1792 + | /// Tries to convert the enum instance into [`RegularMessage`](crate::model::Event::RegularMessage), extracting the inner [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
1793 + | /// Returns `Err(&Self)` if it can't be converted.
|
1794 + | pub fn as_regular_message(
|
1795 + | &self,
|
1796 + | ) -> ::std::result::Result<&crate::model::EventStreamRegularMessage, &Self> {
|
1797 + | if let Event::RegularMessage(val) = &self {
|
1798 + | ::std::result::Result::Ok(val)
|
2071 1799 | } else {
|
2072 - | Ok(items)
|
1800 + | ::std::result::Result::Err(self)
|
2073 1801 | }
|
2074 1802 | }
|
2075 - | }
|
2076 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::RangeInteger>> for SetOfRangeInteger {
|
2077 - | type Error = crate::model::set_of_range_integer_internal::ConstraintViolation;
|
2078 - |
|
2079 - | /// Constructs a `SetOfRangeInteger` from an [`::std::vec::Vec<crate::model::RangeInteger>`], failing when the provided value does not satisfy the modeled constraints.
|
2080 - | fn try_from(
|
2081 - | value: ::std::vec::Vec<crate::model::RangeInteger>,
|
2082 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2083 - | let value = Self::check_unique_items(value)?;
|
2084 - |
|
2085 - | Ok(Self(value))
|
1803 + | /// Returns true if this is a [`RegularMessage`](crate::model::Event::RegularMessage).
|
1804 + | pub fn is_regular_message(&self) -> bool {
|
1805 + | self.as_regular_message().is_ok()
|
2086 1806 | }
|
2087 1807 | }
|
2088 1808 |
|
2089 - | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<crate::model::RangeInteger> {
|
2090 - | fn from(value: SetOfRangeInteger) -> Self {
|
2091 - | value.into_inner()
|
2092 - | }
|
1809 + | #[allow(missing_docs)] // documentation missing in model
|
1810 + | #[derive(
|
1811 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1812 + | )]
|
1813 + | pub struct ConB {
|
1814 + | #[allow(missing_docs)] // documentation missing in model
|
1815 + | pub nice: ::std::string::String,
|
1816 + | #[allow(missing_docs)] // documentation missing in model
|
1817 + | pub int: i32,
|
1818 + | #[allow(missing_docs)] // documentation missing in model
|
1819 + | pub opt_nice: ::std::option::Option<::std::string::String>,
|
1820 + | #[allow(missing_docs)] // documentation missing in model
|
1821 + | pub opt_int: ::std::option::Option<i32>,
|
2093 1822 | }
|
2094 - | impl ::std::convert::From<SetOfRangeInteger> for ::std::vec::Vec<i32> {
|
2095 - | fn from(value: SetOfRangeInteger) -> Self {
|
2096 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1823 + | impl ConB {
|
1824 + | #[allow(missing_docs)] // documentation missing in model
|
1825 + | pub fn nice(&self) -> &str {
|
1826 + | use std::ops::Deref;
|
1827 + | self.nice.deref()
|
1828 + | }
|
1829 + | #[allow(missing_docs)] // documentation missing in model
|
1830 + | pub fn int(&self) -> i32 {
|
1831 + | self.int
|
1832 + | }
|
1833 + | #[allow(missing_docs)] // documentation missing in model
|
1834 + | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
1835 + | self.opt_nice.as_deref()
|
1836 + | }
|
1837 + | #[allow(missing_docs)] // documentation missing in model
|
1838 + | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
1839 + | self.opt_int
|
2097 1840 | }
|
2098 1841 | }
|
2099 - | impl crate::constrained::Constrained for SetOfRangeInteger {
|
2100 - | type Unconstrained =
|
2101 - | crate::unconstrained::set_of_range_integer_unconstrained::SetOfRangeIntegerUnconstrained;
|
1842 + | impl crate::constrained::Constrained for crate::model::ConB {
|
1843 + | type Unconstrained = crate::model::con_b_internal::Builder;
|
1844 + | }
|
1845 + | impl ConB {
|
1846 + | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
1847 + | pub fn builder() -> crate::model::con_b::Builder {
|
1848 + | crate::model::con_b::Builder::default()
|
1849 + | }
|
2102 1850 | }
|
2103 1851 |
|
2104 1852 | #[allow(missing_docs)] // documentation missing in model
|
2105 1853 | ///
|
2106 1854 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2107 - | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
1855 + | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
2108 1856 | ///
|
2109 1857 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2110 1858 | ///
|
2111 1859 | #[derive(
|
2112 1860 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2113 1861 | )]
|
2114 - | pub(crate) struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2115 - | impl LengthBlob {
|
2116 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2117 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
1862 + | pub(crate) struct MinLengthString(pub(crate) ::std::string::String);
|
1863 + | #[allow(dead_code)]
|
1864 + | impl MinLengthString {
|
1865 + | /// Extracts a string slice containing the entire underlying `String`.
|
1866 + | pub fn as_str(&self) -> &str {
|
1867 + | &self.0
|
1868 + | }
|
1869 + |
|
1870 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1871 + | pub fn inner(&self) -> &::std::string::String {
|
1872 + | &self.0
|
1873 + | }
|
1874 + |
|
1875 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1876 + | pub fn into_inner(self) -> ::std::string::String {
|
2118 1877 | self.0
|
2119 1878 | }
|
2120 1879 | }
|
2121 - | impl LengthBlob {
|
1880 + | impl MinLengthString {
|
2122 1881 | fn check_length(
|
2123 - | blob: &::aws_smithy_types::Blob,
|
2124 - | ) -> ::std::result::Result<(), crate::model::length_blob_internal::ConstraintViolation> {
|
2125 - | let length = blob.as_ref().len();
|
1882 + | string: &str,
|
1883 + | ) -> ::std::result::Result<(), crate::model::min_length_string_internal::ConstraintViolation>
|
1884 + | {
|
1885 + | let length = string.chars().count();
|
2126 1886 |
|
2127 - | if (2..=70).contains(&length) {
|
1887 + | if 2 <= length {
|
2128 1888 | Ok(())
|
2129 1889 | } else {
|
2130 - | Err(crate::model::length_blob_internal::ConstraintViolation::Length(length))
|
1890 + | Err(crate::model::min_length_string_internal::ConstraintViolation::Length(length))
|
2131 1891 | }
|
2132 1892 | }
|
2133 1893 | }
|
2134 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2135 - | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
1894 + | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
1895 + | type Error = crate::model::min_length_string_internal::ConstraintViolation;
|
2136 1896 |
|
2137 - | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2138 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
1897 + | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1898 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2139 1899 | Self::check_length(&value)?;
|
2140 1900 |
|
2141 1901 | Ok(Self(value))
|
2142 1902 | }
|
2143 1903 | }
|
2144 - | impl crate::constrained::Constrained for LengthBlob {
|
2145 - | type Unconstrained = ::aws_smithy_types::Blob;
|
1904 + | impl crate::constrained::Constrained for MinLengthString {
|
1905 + | type Unconstrained = ::std::string::String;
|
2146 1906 | }
|
2147 1907 |
|
2148 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2149 - | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
1908 + | impl ::std::convert::From<::std::string::String>
|
1909 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
2150 1910 | {
|
2151 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
1911 + | fn from(value: ::std::string::String) -> Self {
|
2152 1912 | Self::Unconstrained(value)
|
2153 1913 | }
|
2154 1914 | }
|
2155 1915 |
|
2156 - | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2157 - | fn from(value: LengthBlob) -> Self {
|
2158 - | value.into_inner()
|
1916 + | impl ::std::fmt::Display for MinLengthString {
|
1917 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1918 + | self.0.fmt(f)
|
2159 1919 | }
|
2160 1920 | }
|
2161 1921 |
|
2162 - | /// A union with constrained members.
|
2163 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2164 - | pub enum ConstrainedUnion {
|
2165 - | #[allow(missing_docs)] // documentation missing in model
|
2166 - | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
2167 - | #[allow(missing_docs)] // documentation missing in model
|
2168 - | ConBMap(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
2169 - | #[allow(missing_docs)] // documentation missing in model
|
2170 - | ConBSet(::std::vec::Vec<::std::vec::Vec<::std::string::String>>),
|
2171 - | #[allow(missing_docs)] // documentation missing in model
|
2172 - | ConstrainedStructure(crate::model::ConB),
|
2173 - | #[allow(missing_docs)] // documentation missing in model
|
2174 - | EnumString(crate::model::EnumString),
|
2175 - | #[allow(missing_docs)] // documentation missing in model
|
2176 - | LengthString(::std::string::String),
|
2177 - | }
|
2178 - | impl ConstrainedUnion {
|
2179 - | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
2180 - | /// Returns `Err(&Self)` if it can't be converted.
|
2181 - | pub fn as_con_b_list(
|
2182 - | &self,
|
2183 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
2184 - | if let ConstrainedUnion::ConBList(val) = &self {
|
2185 - | ::std::result::Result::Ok(val)
|
2186 - | } else {
|
2187 - | ::std::result::Result::Err(self)
|
2188 - | }
|
2189 - | }
|
2190 - | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
2191 - | pub fn is_con_b_list(&self) -> bool {
|
2192 - | self.as_con_b_list().is_ok()
|
2193 - | }
|
2194 - | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
2195 - | /// Returns `Err(&Self)` if it can't be converted.
|
2196 - | pub fn as_con_b_map(
|
2197 - | &self,
|
2198 - | ) -> ::std::result::Result<
|
2199 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2200 - | &Self,
|
2201 - | > {
|
2202 - | if let ConstrainedUnion::ConBMap(val) = &self {
|
2203 - | ::std::result::Result::Ok(val)
|
2204 - | } else {
|
2205 - | ::std::result::Result::Err(self)
|
2206 - | }
|
2207 - | }
|
2208 - | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
2209 - | pub fn is_con_b_map(&self) -> bool {
|
2210 - | self.as_con_b_map().is_ok()
|
2211 - | }
|
2212 - | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
2213 - | /// Returns `Err(&Self)` if it can't be converted.
|
2214 - | pub fn as_con_b_set(
|
2215 - | &self,
|
2216 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<::std::string::String>>, &Self>
|
2217 - | {
|
2218 - | if let ConstrainedUnion::ConBSet(val) = &self {
|
2219 - | ::std::result::Result::Ok(val)
|
2220 - | } else {
|
2221 - | ::std::result::Result::Err(self)
|
2222 - | }
|
2223 - | }
|
2224 - | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
2225 - | pub fn is_con_b_set(&self) -> bool {
|
2226 - | self.as_con_b_set().is_ok()
|
2227 - | }
|
2228 - | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
2229 - | /// Returns `Err(&Self)` if it can't be converted.
|
2230 - | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
2231 - | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
2232 - | ::std::result::Result::Ok(val)
|
2233 - | } else {
|
2234 - | ::std::result::Result::Err(self)
|
2235 - | }
|
2236 - | }
|
2237 - | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
2238 - | pub fn is_constrained_structure(&self) -> bool {
|
2239 - | self.as_constrained_structure().is_ok()
|
2240 - | }
|
2241 - | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
2242 - | /// Returns `Err(&Self)` if it can't be converted.
|
2243 - | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
2244 - | if let ConstrainedUnion::EnumString(val) = &self {
|
2245 - | ::std::result::Result::Ok(val)
|
2246 - | } else {
|
2247 - | ::std::result::Result::Err(self)
|
2248 - | }
|
2249 - | }
|
2250 - | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
2251 - | pub fn is_enum_string(&self) -> bool {
|
2252 - | self.as_enum_string().is_ok()
|
2253 - | }
|
2254 - | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
2255 - | /// Returns `Err(&Self)` if it can't be converted.
|
2256 - | pub fn as_length_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
2257 - | if let ConstrainedUnion::LengthString(val) = &self {
|
2258 - | ::std::result::Result::Ok(val)
|
2259 - | } else {
|
2260 - | ::std::result::Result::Err(self)
|
2261 - | }
|
2262 - | }
|
2263 - | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
2264 - | pub fn is_length_string(&self) -> bool {
|
2265 - | self.as_length_string().is_ok()
|
1922 + | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
1923 + | fn from(value: MinLengthString) -> Self {
|
1924 + | value.into_inner()
|
2266 1925 | }
|
2267 1926 | }
|
2268 1927 |
|
2269 1928 | #[allow(missing_docs)] // documentation missing in model
|
2270 1929 | ///
|
2271 1930 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2272 - | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
1931 + | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
2273 1932 | ///
|
2274 1933 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2275 1934 | ///
|
2276 1935 | #[derive(
|
2277 1936 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2278 1937 | )]
|
2279 - | pub(crate) struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
2280 - | impl ConBSet {
|
2281 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
2282 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
2283 - | self.0
|
1938 + | pub(crate) struct MaxLengthString(pub(crate) ::std::string::String);
|
1939 + | #[allow(dead_code)]
|
1940 + | impl MaxLengthString {
|
1941 + | /// Extracts a string slice containing the entire underlying `String`.
|
1942 + | pub fn as_str(&self) -> &str {
|
1943 + | &self.0
|
2284 1944 | }
|
2285 1945 |
|
2286 - | fn check_unique_items(
|
2287 - | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2288 - | ) -> ::std::result::Result<
|
2289 - | ::std::vec::Vec<crate::model::ConBSetInner>,
|
2290 - | crate::model::con_b_set_internal::ConstraintViolation,
|
2291 - | > {
|
2292 - | let mut seen = ::std::collections::HashMap::new();
|
2293 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2294 - | for (idx, item) in items.iter().enumerate() {
|
2295 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2296 - | duplicate_indices.push(prev_idx);
|
2297 - | }
|
1946 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
1947 + | pub fn inner(&self) -> &::std::string::String {
|
1948 + | &self.0
|
2298 1949 | }
|
2299 1950 |
|
2300 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2301 - | for idx in &duplicate_indices {
|
2302 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2303 - | last_duplicate_indices.push(prev_idx);
|
2304 - | }
|
1951 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
1952 + | pub fn into_inner(self) -> ::std::string::String {
|
1953 + | self.0
|
2305 1954 | }
|
2306 - | duplicate_indices.extend(last_duplicate_indices);
|
1955 + | }
|
1956 + | impl MaxLengthString {
|
1957 + | fn check_length(
|
1958 + | string: &str,
|
1959 + | ) -> ::std::result::Result<(), crate::model::max_length_string_internal::ConstraintViolation>
|
1960 + | {
|
1961 + | let length = string.chars().count();
|
2307 1962 |
|
2308 - | if !duplicate_indices.is_empty() {
|
2309 - | debug_assert!(duplicate_indices.len() >= 2);
|
2310 - | Err(
|
2311 - | crate::model::con_b_set_internal::ConstraintViolation::UniqueItems {
|
2312 - | duplicate_indices,
|
2313 - | original: items,
|
2314 - | },
|
2315 - | )
|
1963 + | if length <= 69 {
|
1964 + | Ok(())
|
2316 1965 | } else {
|
2317 - | Ok(items)
|
1966 + | Err(crate::model::max_length_string_internal::ConstraintViolation::Length(length))
|
2318 1967 | }
|
2319 1968 | }
|
2320 1969 | }
|
2321 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
2322 - | type Error = crate::model::con_b_set_internal::ConstraintViolation;
|
1970 + | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
1971 + | type Error = crate::model::max_length_string_internal::ConstraintViolation;
|
2323 1972 |
|
2324 - | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
2325 - | fn try_from(
|
2326 - | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
2327 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2328 - | let value = Self::check_unique_items(value)?;
|
1973 + | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
1974 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
1975 + | Self::check_length(&value)?;
|
2329 1976 |
|
2330 1977 | Ok(Self(value))
|
2331 1978 | }
|
2332 1979 | }
|
1980 + | impl crate::constrained::Constrained for MaxLengthString {
|
1981 + | type Unconstrained = ::std::string::String;
|
1982 + | }
|
2333 1983 |
|
2334 - | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
2335 - | fn from(value: ConBSet) -> Self {
|
2336 - | value.into_inner()
|
1984 + | impl ::std::convert::From<::std::string::String>
|
1985 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
1986 + | {
|
1987 + | fn from(value: ::std::string::String) -> Self {
|
1988 + | Self::Unconstrained(value)
|
2337 1989 | }
|
2338 1990 | }
|
2339 - | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
2340 - | fn from(value: ConBSet) -> Self {
|
2341 - | value.into_inner().into_iter().map(|v| v.into()).collect()
|
1991 + |
|
1992 + | impl ::std::fmt::Display for MaxLengthString {
|
1993 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1994 + | self.0.fmt(f)
|
2342 1995 | }
|
2343 1996 | }
|
2344 - | impl crate::constrained::Constrained for ConBSet {
|
2345 - | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
1997 + |
|
1998 + | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
1999 + | fn from(value: MaxLengthString) -> Self {
|
2000 + | value.into_inner()
|
2001 + | }
|
2346 2002 | }
|
2347 2003 |
|
2348 2004 | #[allow(missing_docs)] // documentation missing in model
|
2349 2005 | ///
|
2350 2006 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2351 - | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
2007 + | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
2352 2008 | ///
|
2353 2009 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2354 2010 | ///
|
2355 2011 | #[derive(
|
2356 2012 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2357 2013 | )]
|
2358 - | pub(crate) struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2359 - | impl ConBSetInner {
|
2360 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2361 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2362 - | self.0
|
2014 + | pub(crate) struct FixedLengthString(pub(crate) ::std::string::String);
|
2015 + | #[allow(dead_code)]
|
2016 + | impl FixedLengthString {
|
2017 + | /// Extracts a string slice containing the entire underlying `String`.
|
2018 + | pub fn as_str(&self) -> &str {
|
2019 + | &self.0
|
2363 2020 | }
|
2364 2021 |
|
2365 - | fn check_unique_items(
|
2366 - | items: ::std::vec::Vec<::std::string::String>,
|
2367 - | ) -> ::std::result::Result<
|
2368 - | ::std::vec::Vec<::std::string::String>,
|
2369 - | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
2370 - | > {
|
2371 - | let mut seen = ::std::collections::HashMap::new();
|
2372 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2373 - | for (idx, item) in items.iter().enumerate() {
|
2374 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2375 - | duplicate_indices.push(prev_idx);
|
2376 - | }
|
2022 + | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
2023 + | pub fn inner(&self) -> &::std::string::String {
|
2024 + | &self.0
|
2377 2025 | }
|
2378 2026 |
|
2379 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2380 - | for idx in &duplicate_indices {
|
2381 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2382 - | last_duplicate_indices.push(prev_idx);
|
2383 - | }
|
2027 + | /// Consumes the value, returning the underlying [`::std::string::String`].
|
2028 + | pub fn into_inner(self) -> ::std::string::String {
|
2029 + | self.0
|
2384 2030 | }
|
2385 - | duplicate_indices.extend(last_duplicate_indices);
|
2031 + | }
|
2032 + | impl FixedLengthString {
|
2033 + | fn check_length(
|
2034 + | string: &str,
|
2035 + | ) -> ::std::result::Result<(), crate::model::fixed_length_string_internal::ConstraintViolation>
|
2036 + | {
|
2037 + | let length = string.chars().count();
|
2386 2038 |
|
2387 - | if !duplicate_indices.is_empty() {
|
2388 - | debug_assert!(duplicate_indices.len() >= 2);
|
2389 - | Err(
|
2390 - | crate::model::con_b_set_inner_internal::ConstraintViolation::UniqueItems {
|
2391 - | duplicate_indices,
|
2392 - | original: items,
|
2393 - | },
|
2394 - | )
|
2039 + | if (69..=69).contains(&length) {
|
2040 + | Ok(())
|
2395 2041 | } else {
|
2396 - | Ok(items)
|
2042 + | Err(crate::model::fixed_length_string_internal::ConstraintViolation::Length(length))
|
2397 2043 | }
|
2398 2044 | }
|
2399 2045 | }
|
2400 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
2401 - | type Error = crate::model::con_b_set_inner_internal::ConstraintViolation;
|
2046 + | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
2047 + | type Error = crate::model::fixed_length_string_internal::ConstraintViolation;
|
2402 2048 |
|
2403 - | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2404 - | fn try_from(
|
2405 - | value: ::std::vec::Vec<::std::string::String>,
|
2406 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2407 - | let value = Self::check_unique_items(value)?;
|
2049 + | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
2050 + | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
2051 + | Self::check_length(&value)?;
|
2408 2052 |
|
2409 2053 | Ok(Self(value))
|
2410 2054 | }
|
2411 2055 | }
|
2056 + | impl crate::constrained::Constrained for FixedLengthString {
|
2057 + | type Unconstrained = ::std::string::String;
|
2058 + | }
|
2412 2059 |
|
2413 - | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
2414 - | fn from(value: ConBSetInner) -> Self {
|
2415 - | value.into_inner()
|
2060 + | impl ::std::convert::From<::std::string::String>
|
2061 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
2062 + | {
|
2063 + | fn from(value: ::std::string::String) -> Self {
|
2064 + | Self::Unconstrained(value)
|
2416 2065 | }
|
2417 2066 | }
|
2418 - | impl crate::constrained::Constrained for ConBSetInner {
|
2419 - | type Unconstrained =
|
2420 - | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
2067 + |
|
2068 + | impl ::std::fmt::Display for FixedLengthString {
|
2069 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2070 + | self.0.fmt(f)
|
2071 + | }
|
2072 + | }
|
2073 + |
|
2074 + | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
2075 + | fn from(value: FixedLengthString) -> Self {
|
2076 + | value.into_inner()
|
2077 + | }
|
2421 2078 | }
|
2422 2079 |
|
2423 2080 | #[allow(missing_docs)] // documentation missing in model
|
2081 + | ///
|
2082 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2083 + | /// [constraint traits]. Use [`LengthBlob::try_from`] to construct values of this type.
|
2084 + | ///
|
2085 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2086 + | ///
|
2424 2087 | #[derive(
|
2425 2088 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2426 2089 | )]
|
2427 - | pub struct ConB {
|
2428 - | #[allow(missing_docs)] // documentation missing in model
|
2429 - | pub nice: ::std::string::String,
|
2430 - | #[allow(missing_docs)] // documentation missing in model
|
2431 - | pub int: i32,
|
2432 - | #[allow(missing_docs)] // documentation missing in model
|
2433 - | pub opt_nice: ::std::option::Option<::std::string::String>,
|
2434 - | #[allow(missing_docs)] // documentation missing in model
|
2435 - | pub opt_int: ::std::option::Option<i32>,
|
2436 - | }
|
2437 - | impl ConB {
|
2438 - | #[allow(missing_docs)] // documentation missing in model
|
2439 - | pub fn nice(&self) -> &str {
|
2440 - | use std::ops::Deref;
|
2441 - | self.nice.deref()
|
2090 + | pub(crate) struct LengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2091 + | impl LengthBlob {
|
2092 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2093 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2094 + | self.0
|
2442 2095 | }
|
2443 - | #[allow(missing_docs)] // documentation missing in model
|
2444 - | pub fn int(&self) -> i32 {
|
2445 - | self.int
|
2096 + | }
|
2097 + | impl LengthBlob {
|
2098 + | fn check_length(
|
2099 + | blob: &::aws_smithy_types::Blob,
|
2100 + | ) -> ::std::result::Result<(), crate::model::length_blob_internal::ConstraintViolation> {
|
2101 + | let length = blob.as_ref().len();
|
2102 + |
|
2103 + | if (2..=70).contains(&length) {
|
2104 + | Ok(())
|
2105 + | } else {
|
2106 + | Err(crate::model::length_blob_internal::ConstraintViolation::Length(length))
|
2446 2107 | }
|
2447 - | #[allow(missing_docs)] // documentation missing in model
|
2448 - | pub fn opt_nice(&self) -> ::std::option::Option<&str> {
|
2449 - | self.opt_nice.as_deref()
|
2450 2108 | }
|
2451 - | #[allow(missing_docs)] // documentation missing in model
|
2452 - | pub fn opt_int(&self) -> ::std::option::Option<i32> {
|
2453 - | self.opt_int
|
2109 + | }
|
2110 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for LengthBlob {
|
2111 + | type Error = crate::model::length_blob_internal::ConstraintViolation;
|
2112 + |
|
2113 + | /// Constructs a `LengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2114 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2115 + | Self::check_length(&value)?;
|
2116 + |
|
2117 + | Ok(Self(value))
|
2454 2118 | }
|
2455 2119 | }
|
2456 - | impl crate::constrained::Constrained for crate::model::ConB {
|
2457 - | type Unconstrained = crate::model::con_b_internal::Builder;
|
2120 + | impl crate::constrained::Constrained for LengthBlob {
|
2121 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2458 2122 | }
|
2459 - | impl ConB {
|
2460 - | /// Creates a new builder-style object to manufacture [`ConB`](crate::model::ConB).
|
2461 - | pub fn builder() -> crate::model::con_b::Builder {
|
2462 - | crate::model::con_b::Builder::default()
|
2123 + |
|
2124 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2125 + | for crate::constrained::MaybeConstrained<crate::model::LengthBlob>
|
2126 + | {
|
2127 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2128 + | Self::Unconstrained(value)
|
2129 + | }
|
2130 + | }
|
2131 + |
|
2132 + | impl ::std::convert::From<LengthBlob> for ::aws_smithy_types::Blob {
|
2133 + | fn from(value: LengthBlob) -> Self {
|
2134 + | value.into_inner()
|
2463 2135 | }
|
2464 2136 | }
|
2465 2137 |
|
2466 2138 | #[allow(missing_docs)] // documentation missing in model
|
2467 2139 | ///
|
2468 2140 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2469 - | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
2141 + | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
2470 2142 | ///
|
2471 2143 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2472 2144 | ///
|
2473 2145 | #[derive(
|
2474 2146 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2475 2147 | )]
|
2476 - | pub(crate) struct SparseLengthList(
|
2477 - | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2478 - | );
|
2479 - | impl SparseLengthList {
|
2480 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
2481 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
2148 + | pub(crate) struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2149 + | impl MinLengthBlob {
|
2150 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2151 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2482 2152 | self.0
|
2483 2153 | }
|
2484 - |
|
2154 + | }
|
2155 + | impl MinLengthBlob {
|
2485 2156 | fn check_length(
|
2486 - | length: usize,
|
2487 - | ) -> ::std::result::Result<(), crate::model::sparse_length_list_internal::ConstraintViolation>
|
2157 + | blob: &::aws_smithy_types::Blob,
|
2158 + | ) -> ::std::result::Result<(), crate::model::min_length_blob_internal::ConstraintViolation>
|
2488 2159 | {
|
2489 - | if 69 <= length {
|
2160 + | let length = blob.as_ref().len();
|
2161 + |
|
2162 + | if 2 <= length {
|
2490 2163 | Ok(())
|
2491 2164 | } else {
|
2492 - | Err(crate::model::sparse_length_list_internal::ConstraintViolation::Length(length))
|
2165 + | Err(crate::model::min_length_blob_internal::ConstraintViolation::Length(length))
|
2493 2166 | }
|
2494 2167 | }
|
2495 2168 | }
|
2496 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
2497 - | for SparseLengthList
|
2498 - | {
|
2499 - | type Error = crate::model::sparse_length_list_internal::ConstraintViolation;
|
2169 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
2170 + | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
2500 2171 |
|
2501 - | /// Constructs a `SparseLengthList` from an [`::std::vec::Vec<::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
2502 - | fn try_from(
|
2503 - | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
2504 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2505 - | Self::check_length(value.len())?;
|
2172 + | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2173 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2174 + | Self::check_length(&value)?;
|
2506 2175 |
|
2507 2176 | Ok(Self(value))
|
2508 2177 | }
|
2509 2178 | }
|
2179 + | impl crate::constrained::Constrained for MinLengthBlob {
|
2180 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2181 + | }
|
2510 2182 |
|
2511 - | impl ::std::convert::From<SparseLengthList>
|
2512 - | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
2183 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2184 + | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
2513 2185 | {
|
2514 - | fn from(value: SparseLengthList) -> Self {
|
2515 - | value.into_inner()
|
2186 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2187 + | Self::Unconstrained(value)
|
2516 2188 | }
|
2517 2189 | }
|
2518 - | impl crate::constrained::Constrained for SparseLengthList {
|
2519 - | type Unconstrained =
|
2520 - | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
2190 + |
|
2191 + | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
2192 + | fn from(value: MinLengthBlob) -> Self {
|
2193 + | value.into_inner()
|
2194 + | }
|
2521 2195 | }
|
2522 2196 |
|
2523 2197 | #[allow(missing_docs)] // documentation missing in model
|
2524 2198 | ///
|
2525 2199 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2526 - | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
2200 + | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
2527 2201 | ///
|
2528 2202 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2529 2203 | ///
|
2530 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2531 - | pub(crate) struct SparseLengthMap(
|
2532 - | pub(crate) ::std::collections::HashMap<
|
2533 - | ::std::string::String,
|
2534 - | ::std::option::Option<::std::string::String>,
|
2535 - | >,
|
2536 - | );
|
2537 - | impl SparseLengthMap {
|
2538 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
2539 - | pub fn into_inner(
|
2540 - | self,
|
2541 - | ) -> ::std::collections::HashMap<
|
2542 - | ::std::string::String,
|
2543 - | ::std::option::Option<::std::string::String>,
|
2544 - | > {
|
2204 + | #[derive(
|
2205 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2206 + | )]
|
2207 + | pub(crate) struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2208 + | impl MaxLengthBlob {
|
2209 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2210 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2545 2211 | self.0
|
2546 2212 | }
|
2547 2213 | }
|
2548 - | impl
|
2549 - | ::std::convert::TryFrom<
|
2550 - | ::std::collections::HashMap<
|
2551 - | ::std::string::String,
|
2552 - | ::std::option::Option<::std::string::String>,
|
2553 - | >,
|
2554 - | > for SparseLengthMap
|
2555 - | {
|
2556 - | type Error = crate::model::sparse_length_map_internal::ConstraintViolation;
|
2214 + | impl MaxLengthBlob {
|
2215 + | fn check_length(
|
2216 + | blob: &::aws_smithy_types::Blob,
|
2217 + | ) -> ::std::result::Result<(), crate::model::max_length_blob_internal::ConstraintViolation>
|
2218 + | {
|
2219 + | let length = blob.as_ref().len();
|
2557 2220 |
|
2558 - | /// Constructs a `SparseLengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
2559 - | fn try_from(
|
2560 - | value: ::std::collections::HashMap<
|
2561 - | ::std::string::String,
|
2562 - | ::std::option::Option<::std::string::String>,
|
2563 - | >,
|
2564 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2565 - | let length = value.len();
|
2566 - | if 69 <= length {
|
2567 - | Ok(Self(value))
|
2221 + | if length <= 70 {
|
2222 + | Ok(())
|
2568 2223 | } else {
|
2569 - | Err(crate::model::sparse_length_map_internal::ConstraintViolation::Length(length))
|
2224 + | Err(crate::model::max_length_blob_internal::ConstraintViolation::Length(length))
|
2570 2225 | }
|
2571 2226 | }
|
2572 2227 | }
|
2228 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
2229 + | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
2573 2230 |
|
2574 - | impl ::std::convert::From<SparseLengthMap>
|
2575 - | for ::std::collections::HashMap<
|
2576 - | ::std::string::String,
|
2577 - | ::std::option::Option<::std::string::String>,
|
2578 - | >
|
2231 + | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2232 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2233 + | Self::check_length(&value)?;
|
2234 + |
|
2235 + | Ok(Self(value))
|
2236 + | }
|
2237 + | }
|
2238 + | impl crate::constrained::Constrained for MaxLengthBlob {
|
2239 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2240 + | }
|
2241 + |
|
2242 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2243 + | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
2579 2244 | {
|
2580 - | fn from(value: SparseLengthMap) -> Self {
|
2581 - | value.into_inner()
|
2245 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2246 + | Self::Unconstrained(value)
|
2582 2247 | }
|
2583 2248 | }
|
2584 - | impl crate::constrained::Constrained for SparseLengthMap {
|
2585 - | type Unconstrained =
|
2586 - | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
2249 + |
|
2250 + | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
2251 + | fn from(value: MaxLengthBlob) -> Self {
|
2252 + | value.into_inner()
|
2253 + | }
|
2587 2254 | }
|
2588 2255 |
|
2589 2256 | #[allow(missing_docs)] // documentation missing in model
|
2590 2257 | ///
|
2591 2258 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2592 - | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
2259 + | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
2593 2260 | ///
|
2594 2261 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2595 2262 | ///
|
2596 2263 | #[derive(
|
2597 2264 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2598 2265 | )]
|
2599 - | pub(crate) struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2600 - | impl UniqueItemsList {
|
2601 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2602 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2266 + | pub(crate) struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
2267 + | impl FixedLengthBlob {
|
2268 + | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
2269 + | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
2603 2270 | self.0
|
2604 2271 | }
|
2272 + | }
|
2273 + | impl FixedLengthBlob {
|
2274 + | fn check_length(
|
2275 + | blob: &::aws_smithy_types::Blob,
|
2276 + | ) -> ::std::result::Result<(), crate::model::fixed_length_blob_internal::ConstraintViolation>
|
2277 + | {
|
2278 + | let length = blob.as_ref().len();
|
2605 2279 |
|
2606 - | fn check_unique_items(
|
2607 - | items: ::std::vec::Vec<::std::string::String>,
|
2608 - | ) -> ::std::result::Result<
|
2609 - | ::std::vec::Vec<::std::string::String>,
|
2610 - | crate::model::unique_items_list_internal::ConstraintViolation,
|
2611 - | > {
|
2612 - | let mut seen = ::std::collections::HashMap::new();
|
2613 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2614 - | for (idx, item) in items.iter().enumerate() {
|
2615 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2616 - | duplicate_indices.push(prev_idx);
|
2280 + | if (70..=70).contains(&length) {
|
2281 + | Ok(())
|
2282 + | } else {
|
2283 + | Err(crate::model::fixed_length_blob_internal::ConstraintViolation::Length(length))
|
2617 2284 | }
|
2618 2285 | }
|
2286 + | }
|
2287 + | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
2288 + | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
2619 2289 |
|
2620 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2621 - | for idx in &duplicate_indices {
|
2622 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2623 - | last_duplicate_indices.push(prev_idx);
|
2624 - | }
|
2625 - | }
|
2626 - | duplicate_indices.extend(last_duplicate_indices);
|
2627 - |
|
2628 - | if !duplicate_indices.is_empty() {
|
2629 - | debug_assert!(duplicate_indices.len() >= 2);
|
2630 - | Err(
|
2631 - | crate::model::unique_items_list_internal::ConstraintViolation::UniqueItems {
|
2632 - | duplicate_indices,
|
2633 - | original: items,
|
2634 - | },
|
2635 - | )
|
2636 - | } else {
|
2637 - | Ok(items)
|
2638 - | }
|
2639 - | }
|
2640 - | }
|
2641 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
2642 - | type Error = crate::model::unique_items_list_internal::ConstraintViolation;
|
2643 - |
|
2644 - | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2645 - | fn try_from(
|
2646 - | value: ::std::vec::Vec<::std::string::String>,
|
2647 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2648 - | let value = Self::check_unique_items(value)?;
|
2290 + | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
2291 + | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
2292 + | Self::check_length(&value)?;
|
2649 2293 |
|
2650 2294 | Ok(Self(value))
|
2651 2295 | }
|
2652 2296 | }
|
2653 - |
|
2654 - | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
2655 - | fn from(value: UniqueItemsList) -> Self {
|
2656 - | value.into_inner()
|
2657 - | }
|
2658 - | }
|
2659 - | impl crate::constrained::Constrained for UniqueItemsList {
|
2660 - | type Unconstrained =
|
2661 - | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
2297 + | impl crate::constrained::Constrained for FixedLengthBlob {
|
2298 + | type Unconstrained = ::aws_smithy_types::Blob;
|
2662 2299 | }
|
2663 2300 |
|
2664 - | #[allow(missing_docs)] // documentation missing in model
|
2665 - | ///
|
2666 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2667 - | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
2668 - | ///
|
2669 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2670 - | ///
|
2671 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2672 - | pub(crate) struct LengthMap(
|
2673 - | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2674 - | );
|
2675 - | impl LengthMap {
|
2676 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
2677 - | pub fn into_inner(
|
2678 - | self,
|
2679 - | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
2680 - | self.0
|
2681 - | }
|
2682 - | }
|
2683 - | impl
|
2684 - | ::std::convert::TryFrom<
|
2685 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2686 - | > for LengthMap
|
2301 + | impl ::std::convert::From<::aws_smithy_types::Blob>
|
2302 + | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
2687 2303 | {
|
2688 - | type Error = crate::model::length_map_internal::ConstraintViolation;
|
2689 - |
|
2690 - | /// Constructs a `LengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2691 - | fn try_from(
|
2692 - | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2693 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2694 - | let length = value.len();
|
2695 - | if (1..=69).contains(&length) {
|
2696 - | Ok(Self(value))
|
2697 - | } else {
|
2698 - | Err(crate::model::length_map_internal::ConstraintViolation::Length(length))
|
2699 - | }
|
2304 + | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
2305 + | Self::Unconstrained(value)
|
2700 2306 | }
|
2701 2307 | }
|
2702 2308 |
|
2703 - | impl ::std::convert::From<LengthMap>
|
2704 - | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
2705 - | {
|
2706 - | fn from(value: LengthMap) -> Self {
|
2309 + | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
2310 + | fn from(value: FixedLengthBlob) -> Self {
|
2707 2311 | value.into_inner()
|
2708 2312 | }
|
2709 2313 | }
|
2710 - | impl crate::constrained::Constrained for LengthMap {
|
2711 - | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
2712 - | }
|
2713 2314 |
|
2714 2315 | #[allow(missing_docs)] // documentation missing in model
|
2715 2316 | ///
|
2716 2317 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2717 - | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
2318 + | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
2718 2319 | ///
|
2719 2320 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2720 2321 | ///
|
2721 2322 | #[derive(
|
2722 2323 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2723 2324 | )]
|
2724 - | pub(crate) struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
2725 - | impl SensitiveLengthList {
|
2726 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
2727 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
2728 - | self.0
|
2325 + | pub(crate) struct MinRangeInteger(pub(crate) i32);
|
2326 + | #[allow(dead_code)]
|
2327 + | impl MinRangeInteger {
|
2328 + | /// Returns an immutable reference to the underlying [`i32`].
|
2329 + | pub fn inner(&self) -> &i32 {
|
2330 + | &self.0
|
2729 2331 | }
|
2730 2332 |
|
2731 - | fn check_length(
|
2732 - | length: usize,
|
2733 - | ) -> ::std::result::Result<(), crate::model::sensitive_length_list_internal::ConstraintViolation>
|
2734 - | {
|
2735 - | if length <= 69 {
|
2736 - | Ok(())
|
2737 - | } else {
|
2738 - | Err(crate::model::sensitive_length_list_internal::ConstraintViolation::Length(length))
|
2739 - | }
|
2333 + | /// Consumes the value, returning the underlying [`i32`].
|
2334 + | pub fn into_inner(self) -> i32 {
|
2335 + | self.0
|
2740 2336 | }
|
2741 2337 | }
|
2742 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
2743 - | for SensitiveLengthList
|
2744 - | {
|
2745 - | type Error = crate::model::sensitive_length_list_internal::ConstraintViolation;
|
2746 - |
|
2747 - | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
2748 - | fn try_from(
|
2749 - | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
2750 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2751 - | Self::check_length(value.len())?;
|
2752 2338 |
|
2753 - | Ok(Self(value))
|
2754 - | }
|
2339 + | impl crate::constrained::Constrained for MinRangeInteger {
|
2340 + | type Unconstrained = i32;
|
2755 2341 | }
|
2756 2342 |
|
2757 - | impl ::std::convert::From<SensitiveLengthList>
|
2758 - | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
2343 + | impl ::std::convert::From<i32>
|
2344 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
2759 2345 | {
|
2760 - | fn from(value: SensitiveLengthList) -> Self {
|
2761 - | value.into_inner()
|
2346 + | fn from(value: i32) -> Self {
|
2347 + | Self::Unconstrained(value)
|
2762 2348 | }
|
2763 2349 | }
|
2764 - | impl crate::constrained::Constrained for SensitiveLengthList {
|
2765 - | type Unconstrained =
|
2766 - | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
2767 - | }
|
2768 2350 |
|
2769 - | #[allow(missing_docs)] // documentation missing in model
|
2770 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
2771 - | pub struct SensitiveStructure {}
|
2772 - | impl ::std::fmt::Debug for SensitiveStructure {
|
2773 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
2774 - | let mut formatter = f.debug_struct("SensitiveStructure");
|
2775 - | formatter.finish()
|
2776 - | }
|
2777 - | }
|
2778 - | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
2779 - | type Unconstrained = crate::model::sensitive_structure_internal::Builder;
|
2780 - | }
|
2781 - | impl SensitiveStructure {
|
2782 - | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
2783 - | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
2784 - | crate::model::sensitive_structure::Builder::default()
|
2351 + | impl ::std::fmt::Display for MinRangeInteger {
|
2352 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2353 + | self.0.fmt(f)
|
2785 2354 | }
|
2786 2355 | }
|
2787 2356 |
|
2788 - | #[allow(missing_docs)] // documentation missing in model
|
2789 - | ///
|
2790 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2791 - | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
2792 - | ///
|
2793 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2794 - | ///
|
2795 - | #[derive(
|
2796 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2797 - | )]
|
2798 - | pub(crate) struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
2799 - | impl LengthList {
|
2800 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
2801 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
2802 - | self.0
|
2357 + | impl ::std::convert::From<MinRangeInteger> for i32 {
|
2358 + | fn from(value: MinRangeInteger) -> Self {
|
2359 + | value.into_inner()
|
2803 2360 | }
|
2804 - |
|
2805 - | fn check_length(
|
2806 - | length: usize,
|
2807 - | ) -> ::std::result::Result<(), crate::model::length_list_internal::ConstraintViolation> {
|
2808 - | if length <= 69 {
|
2361 + | }
|
2362 + | impl MinRangeInteger {
|
2363 + | fn check_range(
|
2364 + | value: i32,
|
2365 + | ) -> ::std::result::Result<(), crate::model::min_range_integer_internal::ConstraintViolation>
|
2366 + | {
|
2367 + | if -10 <= value {
|
2809 2368 | Ok(())
|
2810 2369 | } else {
|
2811 - | Err(crate::model::length_list_internal::ConstraintViolation::Length(length))
|
2370 + | Err(crate::model::min_range_integer_internal::ConstraintViolation::Range(value))
|
2812 2371 | }
|
2813 2372 | }
|
2814 2373 | }
|
2815 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
2816 - | type Error = crate::model::length_list_internal::ConstraintViolation;
|
2374 + | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
2375 + | type Error = crate::model::min_range_integer_internal::ConstraintViolation;
|
2817 2376 |
|
2818 - | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2819 - | fn try_from(
|
2820 - | value: ::std::vec::Vec<::std::string::String>,
|
2821 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2822 - | Self::check_length(value.len())?;
|
2377 + | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2378 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2379 + | Self::check_range(value)?;
|
2823 2380 |
|
2824 2381 | Ok(Self(value))
|
2825 2382 | }
|
2826 2383 | }
|
2827 2384 |
|
2828 - | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
2829 - | fn from(value: LengthList) -> Self {
|
2830 - | value.into_inner()
|
2831 - | }
|
2832 - | }
|
2833 - | impl crate::constrained::Constrained for LengthList {
|
2834 - | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
2835 - | }
|
2836 - |
|
2837 2385 | #[allow(missing_docs)] // documentation missing in model
|
2838 2386 | ///
|
2839 2387 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2840 - | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
2388 + | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
2841 2389 | ///
|
2842 2390 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2843 2391 | ///
|
2844 2392 | #[derive(
|
2845 2393 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2846 2394 | )]
|
2847 - | pub(crate) struct FixedValueByte(pub(crate) i8);
|
2395 + | pub(crate) struct MaxRangeInteger(pub(crate) i32);
|
2848 2396 | #[allow(dead_code)]
|
2849 - | impl FixedValueByte {
|
2850 - | /// Returns an immutable reference to the underlying [`i8`].
|
2851 - | pub fn inner(&self) -> &i8 {
|
2397 + | impl MaxRangeInteger {
|
2398 + | /// Returns an immutable reference to the underlying [`i32`].
|
2399 + | pub fn inner(&self) -> &i32 {
|
2852 2400 | &self.0
|
2853 2401 | }
|
2854 2402 |
|
2855 - | /// Consumes the value, returning the underlying [`i8`].
|
2856 - | pub fn into_inner(self) -> i8 {
|
2403 + | /// Consumes the value, returning the underlying [`i32`].
|
2404 + | pub fn into_inner(self) -> i32 {
|
2857 2405 | self.0
|
2858 2406 | }
|
2859 2407 | }
|
2860 2408 |
|
2861 - | impl crate::constrained::Constrained for FixedValueByte {
|
2862 - | type Unconstrained = i8;
|
2409 + | impl crate::constrained::Constrained for MaxRangeInteger {
|
2410 + | type Unconstrained = i32;
|
2863 2411 | }
|
2864 2412 |
|
2865 - | impl ::std::convert::From<i8>
|
2866 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
2413 + | impl ::std::convert::From<i32>
|
2414 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
2867 2415 | {
|
2868 - | fn from(value: i8) -> Self {
|
2416 + | fn from(value: i32) -> Self {
|
2869 2417 | Self::Unconstrained(value)
|
2870 2418 | }
|
2871 2419 | }
|
2872 2420 |
|
2873 - | impl ::std::fmt::Display for FixedValueByte {
|
2421 + | impl ::std::fmt::Display for MaxRangeInteger {
|
2874 2422 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2875 2423 | self.0.fmt(f)
|
2876 2424 | }
|
2877 2425 | }
|
2878 2426 |
|
2879 - | impl ::std::convert::From<FixedValueByte> for i8 {
|
2880 - | fn from(value: FixedValueByte) -> Self {
|
2427 + | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
2428 + | fn from(value: MaxRangeInteger) -> Self {
|
2881 2429 | value.into_inner()
|
2882 2430 | }
|
2883 2431 | }
|
2884 - | impl FixedValueByte {
|
2432 + | impl MaxRangeInteger {
|
2885 2433 | fn check_range(
|
2886 - | value: i8,
|
2887 - | ) -> ::std::result::Result<(), crate::model::fixed_value_byte_internal::ConstraintViolation>
|
2434 + | value: i32,
|
2435 + | ) -> ::std::result::Result<(), crate::model::max_range_integer_internal::ConstraintViolation>
|
2888 2436 | {
|
2889 - | if (10..=10).contains(&value) {
|
2437 + | if value <= 69 {
|
2890 2438 | Ok(())
|
2891 2439 | } else {
|
2892 - | Err(crate::model::fixed_value_byte_internal::ConstraintViolation::Range(value))
|
2440 + | Err(crate::model::max_range_integer_internal::ConstraintViolation::Range(value))
|
2893 2441 | }
|
2894 2442 | }
|
2895 2443 | }
|
2896 - | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
2897 - | type Error = crate::model::fixed_value_byte_internal::ConstraintViolation;
|
2444 + | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
2445 + | type Error = crate::model::max_range_integer_internal::ConstraintViolation;
|
2898 2446 |
|
2899 - | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2900 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2447 + | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2448 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2901 2449 | Self::check_range(value)?;
|
2902 2450 |
|
2903 2451 | Ok(Self(value))
|
2904 2452 | }
|
2905 2453 | }
|
2906 2454 |
|
2907 2455 | #[allow(missing_docs)] // documentation missing in model
|
2908 2456 | ///
|
2909 2457 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2910 - | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
2458 + | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
2911 2459 | ///
|
2912 2460 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2913 2461 | ///
|
2914 2462 | #[derive(
|
2915 2463 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2916 2464 | )]
|
2917 - | pub(crate) struct MaxRangeByte(pub(crate) i8);
|
2465 + | pub(crate) struct FixedValueInteger(pub(crate) i32);
|
2918 2466 | #[allow(dead_code)]
|
2919 - | impl MaxRangeByte {
|
2920 - | /// Returns an immutable reference to the underlying [`i8`].
|
2921 - | pub fn inner(&self) -> &i8 {
|
2467 + | impl FixedValueInteger {
|
2468 + | /// Returns an immutable reference to the underlying [`i32`].
|
2469 + | pub fn inner(&self) -> &i32 {
|
2922 2470 | &self.0
|
2923 2471 | }
|
2924 2472 |
|
2925 - | /// Consumes the value, returning the underlying [`i8`].
|
2926 - | pub fn into_inner(self) -> i8 {
|
2473 + | /// Consumes the value, returning the underlying [`i32`].
|
2474 + | pub fn into_inner(self) -> i32 {
|
2927 2475 | self.0
|
2928 2476 | }
|
2929 2477 | }
|
2930 2478 |
|
2931 - | impl crate::constrained::Constrained for MaxRangeByte {
|
2932 - | type Unconstrained = i8;
|
2479 + | impl crate::constrained::Constrained for FixedValueInteger {
|
2480 + | type Unconstrained = i32;
|
2933 2481 | }
|
2934 2482 |
|
2935 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
2936 - | fn from(value: i8) -> Self {
|
2483 + | impl ::std::convert::From<i32>
|
2484 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
2485 + | {
|
2486 + | fn from(value: i32) -> Self {
|
2937 2487 | Self::Unconstrained(value)
|
2938 2488 | }
|
2939 2489 | }
|
2940 2490 |
|
2941 - | impl ::std::fmt::Display for MaxRangeByte {
|
2491 + | impl ::std::fmt::Display for FixedValueInteger {
|
2942 2492 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2943 2493 | self.0.fmt(f)
|
2944 2494 | }
|
2945 2495 | }
|
2946 2496 |
|
2947 - | impl ::std::convert::From<MaxRangeByte> for i8 {
|
2948 - | fn from(value: MaxRangeByte) -> Self {
|
2497 + | impl ::std::convert::From<FixedValueInteger> for i32 {
|
2498 + | fn from(value: FixedValueInteger) -> Self {
|
2949 2499 | value.into_inner()
|
2950 2500 | }
|
2951 2501 | }
|
2952 - | impl MaxRangeByte {
|
2502 + | impl FixedValueInteger {
|
2953 2503 | fn check_range(
|
2954 - | value: i8,
|
2955 - | ) -> ::std::result::Result<(), crate::model::max_range_byte_internal::ConstraintViolation> {
|
2956 - | if value <= 11 {
|
2504 + | value: i32,
|
2505 + | ) -> ::std::result::Result<(), crate::model::fixed_value_integer_internal::ConstraintViolation>
|
2506 + | {
|
2507 + | if (69..=69).contains(&value) {
|
2957 2508 | Ok(())
|
2958 2509 | } else {
|
2959 - | Err(crate::model::max_range_byte_internal::ConstraintViolation::Range(value))
|
2510 + | Err(crate::model::fixed_value_integer_internal::ConstraintViolation::Range(value))
|
2960 2511 | }
|
2961 2512 | }
|
2962 2513 | }
|
2963 - | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
2964 - | type Error = crate::model::max_range_byte_internal::ConstraintViolation;
|
2514 + | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
2515 + | type Error = crate::model::fixed_value_integer_internal::ConstraintViolation;
|
2965 2516 |
|
2966 - | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
2967 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2517 + | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
2518 + | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
2968 2519 | Self::check_range(value)?;
|
2969 2520 |
|
2970 2521 | Ok(Self(value))
|
2971 2522 | }
|
2972 2523 | }
|
2973 2524 |
|
2974 2525 | #[allow(missing_docs)] // documentation missing in model
|
2975 2526 | ///
|
2976 2527 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2977 - | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
2528 + | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
2978 2529 | ///
|
2979 2530 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2980 2531 | ///
|
2981 2532 | #[derive(
|
2982 2533 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2983 2534 | )]
|
2984 - | pub(crate) struct MinRangeByte(pub(crate) i8);
|
2535 + | pub(crate) struct MinRangeShort(pub(crate) i16);
|
2985 2536 | #[allow(dead_code)]
|
2986 - | impl MinRangeByte {
|
2987 - | /// Returns an immutable reference to the underlying [`i8`].
|
2988 - | pub fn inner(&self) -> &i8 {
|
2537 + | impl MinRangeShort {
|
2538 + | /// Returns an immutable reference to the underlying [`i16`].
|
2539 + | pub fn inner(&self) -> &i16 {
|
2989 2540 | &self.0
|
2990 2541 | }
|
2991 2542 |
|
2992 - | /// Consumes the value, returning the underlying [`i8`].
|
2993 - | pub fn into_inner(self) -> i8 {
|
2543 + | /// Consumes the value, returning the underlying [`i16`].
|
2544 + | pub fn into_inner(self) -> i16 {
|
2994 2545 | self.0
|
2995 2546 | }
|
2996 2547 | }
|
2997 2548 |
|
2998 - | impl crate::constrained::Constrained for MinRangeByte {
|
2999 - | type Unconstrained = i8;
|
2549 + | impl crate::constrained::Constrained for MinRangeShort {
|
2550 + | type Unconstrained = i16;
|
3000 2551 | }
|
3001 2552 |
|
3002 - | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
3003 - | fn from(value: i8) -> Self {
|
2553 + | impl ::std::convert::From<i16>
|
2554 + | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
2555 + | {
|
2556 + | fn from(value: i16) -> Self {
|
3004 2557 | Self::Unconstrained(value)
|
3005 2558 | }
|
3006 2559 | }
|
3007 2560 |
|
3008 - | impl ::std::fmt::Display for MinRangeByte {
|
2561 + | impl ::std::fmt::Display for MinRangeShort {
|
3009 2562 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3010 2563 | self.0.fmt(f)
|
3011 2564 | }
|
3012 2565 | }
|
3013 2566 |
|
3014 - | impl ::std::convert::From<MinRangeByte> for i8 {
|
3015 - | fn from(value: MinRangeByte) -> Self {
|
2567 + | impl ::std::convert::From<MinRangeShort> for i16 {
|
2568 + | fn from(value: MinRangeShort) -> Self {
|
3016 2569 | value.into_inner()
|
3017 2570 | }
|
3018 2571 | }
|
3019 - | impl MinRangeByte {
|
2572 + | impl MinRangeShort {
|
3020 2573 | fn check_range(
|
3021 - | value: i8,
|
3022 - | ) -> ::std::result::Result<(), crate::model::min_range_byte_internal::ConstraintViolation> {
|
2574 + | value: i16,
|
2575 + | ) -> ::std::result::Result<(), crate::model::min_range_short_internal::ConstraintViolation>
|
2576 + | {
|
3023 2577 | if -10 <= value {
|
3024 2578 | Ok(())
|
3025 2579 | } else {
|
3026 - | Err(crate::model::min_range_byte_internal::ConstraintViolation::Range(value))
|
2580 + | Err(crate::model::min_range_short_internal::ConstraintViolation::Range(value))
|
3027 2581 | }
|
3028 2582 | }
|
3029 2583 | }
|
3030 - | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3031 - | type Error = crate::model::min_range_byte_internal::ConstraintViolation;
|
2584 + | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
2585 + | type Error = crate::model::min_range_short_internal::ConstraintViolation;
|
3032 2586 |
|
3033 - | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3034 - | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
2587 + | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2588 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3035 2589 | Self::check_range(value)?;
|
3036 2590 |
|
3037 2591 | Ok(Self(value))
|
3038 2592 | }
|
3039 2593 | }
|
3040 2594 |
|
3041 2595 | #[allow(missing_docs)] // documentation missing in model
|
3042 2596 | ///
|
3043 2597 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3044 - | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
2598 + | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
3045 2599 | ///
|
3046 2600 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3047 2601 | ///
|
3048 2602 | #[derive(
|
3049 2603 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3050 2604 | )]
|
3051 - | pub(crate) struct FixedValueLong(pub(crate) i64);
|
2605 + | pub(crate) struct MaxRangeShort(pub(crate) i16);
|
3052 2606 | #[allow(dead_code)]
|
3053 - | impl FixedValueLong {
|
3054 - | /// Returns an immutable reference to the underlying [`i64`].
|
3055 - | pub fn inner(&self) -> &i64 {
|
2607 + | impl MaxRangeShort {
|
2608 + | /// Returns an immutable reference to the underlying [`i16`].
|
2609 + | pub fn inner(&self) -> &i16 {
|
3056 2610 | &self.0
|
3057 2611 | }
|
3058 2612 |
|
3059 - | /// Consumes the value, returning the underlying [`i64`].
|
3060 - | pub fn into_inner(self) -> i64 {
|
2613 + | /// Consumes the value, returning the underlying [`i16`].
|
2614 + | pub fn into_inner(self) -> i16 {
|
3061 2615 | self.0
|
3062 2616 | }
|
3063 2617 | }
|
3064 2618 |
|
3065 - | impl crate::constrained::Constrained for FixedValueLong {
|
3066 - | type Unconstrained = i64;
|
2619 + | impl crate::constrained::Constrained for MaxRangeShort {
|
2620 + | type Unconstrained = i16;
|
3067 2621 | }
|
3068 2622 |
|
3069 - | impl ::std::convert::From<i64>
|
3070 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
2623 + | impl ::std::convert::From<i16>
|
2624 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
3071 2625 | {
|
3072 - | fn from(value: i64) -> Self {
|
2626 + | fn from(value: i16) -> Self {
|
3073 2627 | Self::Unconstrained(value)
|
3074 2628 | }
|
3075 2629 | }
|
3076 2630 |
|
3077 - | impl ::std::fmt::Display for FixedValueLong {
|
2631 + | impl ::std::fmt::Display for MaxRangeShort {
|
3078 2632 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3079 2633 | self.0.fmt(f)
|
3080 2634 | }
|
3081 2635 | }
|
3082 2636 |
|
3083 - | impl ::std::convert::From<FixedValueLong> for i64 {
|
3084 - | fn from(value: FixedValueLong) -> Self {
|
2637 + | impl ::std::convert::From<MaxRangeShort> for i16 {
|
2638 + | fn from(value: MaxRangeShort) -> Self {
|
3085 2639 | value.into_inner()
|
3086 2640 | }
|
3087 2641 | }
|
3088 - | impl FixedValueLong {
|
2642 + | impl MaxRangeShort {
|
3089 2643 | fn check_range(
|
3090 - | value: i64,
|
3091 - | ) -> ::std::result::Result<(), crate::model::fixed_value_long_internal::ConstraintViolation>
|
2644 + | value: i16,
|
2645 + | ) -> ::std::result::Result<(), crate::model::max_range_short_internal::ConstraintViolation>
|
3092 2646 | {
|
3093 - | if (10..=10).contains(&value) {
|
2647 + | if value <= 11 {
|
3094 2648 | Ok(())
|
3095 2649 | } else {
|
3096 - | Err(crate::model::fixed_value_long_internal::ConstraintViolation::Range(value))
|
2650 + | Err(crate::model::max_range_short_internal::ConstraintViolation::Range(value))
|
3097 2651 | }
|
3098 2652 | }
|
3099 2653 | }
|
3100 - | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
3101 - | type Error = crate::model::fixed_value_long_internal::ConstraintViolation;
|
2654 + | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
2655 + | type Error = crate::model::max_range_short_internal::ConstraintViolation;
|
3102 2656 |
|
3103 - | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3104 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2657 + | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2658 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3105 2659 | Self::check_range(value)?;
|
3106 2660 |
|
3107 2661 | Ok(Self(value))
|
3108 2662 | }
|
3109 2663 | }
|
3110 2664 |
|
3111 2665 | #[allow(missing_docs)] // documentation missing in model
|
3112 2666 | ///
|
3113 2667 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3114 - | /// [constraint traits]. Use [`MaxRangeLong::try_from`] to construct values of this type.
|
2668 + | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
3115 2669 | ///
|
3116 2670 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3117 2671 | ///
|
3118 2672 | #[derive(
|
3119 2673 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3120 2674 | )]
|
3121 - | pub(crate) struct MaxRangeLong(pub(crate) i64);
|
2675 + | pub(crate) struct FixedValueShort(pub(crate) i16);
|
3122 2676 | #[allow(dead_code)]
|
3123 - | impl MaxRangeLong {
|
3124 - | /// Returns an immutable reference to the underlying [`i64`].
|
3125 - | pub fn inner(&self) -> &i64 {
|
2677 + | impl FixedValueShort {
|
2678 + | /// Returns an immutable reference to the underlying [`i16`].
|
2679 + | pub fn inner(&self) -> &i16 {
|
3126 2680 | &self.0
|
3127 2681 | }
|
3128 2682 |
|
3129 - | /// Consumes the value, returning the underlying [`i64`].
|
3130 - | pub fn into_inner(self) -> i64 {
|
2683 + | /// Consumes the value, returning the underlying [`i16`].
|
2684 + | pub fn into_inner(self) -> i16 {
|
3131 2685 | self.0
|
3132 2686 | }
|
3133 2687 | }
|
3134 2688 |
|
3135 - | impl crate::constrained::Constrained for MaxRangeLong {
|
3136 - | type Unconstrained = i64;
|
2689 + | impl crate::constrained::Constrained for FixedValueShort {
|
2690 + | type Unconstrained = i16;
|
3137 2691 | }
|
3138 2692 |
|
3139 - | impl ::std::convert::From<i64>
|
3140 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>
|
2693 + | impl ::std::convert::From<i16>
|
2694 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
3141 2695 | {
|
3142 - | fn from(value: i64) -> Self {
|
2696 + | fn from(value: i16) -> Self {
|
3143 2697 | Self::Unconstrained(value)
|
3144 2698 | }
|
3145 2699 | }
|
3146 2700 |
|
3147 - | impl ::std::fmt::Display for MaxRangeLong {
|
2701 + | impl ::std::fmt::Display for FixedValueShort {
|
3148 2702 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3149 2703 | self.0.fmt(f)
|
3150 2704 | }
|
3151 2705 | }
|
3152 2706 |
|
3153 - | impl ::std::convert::From<MaxRangeLong> for i64 {
|
3154 - | fn from(value: MaxRangeLong) -> Self {
|
2707 + | impl ::std::convert::From<FixedValueShort> for i16 {
|
2708 + | fn from(value: FixedValueShort) -> Self {
|
3155 2709 | value.into_inner()
|
3156 2710 | }
|
3157 2711 | }
|
3158 - | impl MaxRangeLong {
|
2712 + | impl FixedValueShort {
|
3159 2713 | fn check_range(
|
3160 - | value: i64,
|
3161 - | ) -> ::std::result::Result<(), crate::model::max_range_long_internal::ConstraintViolation> {
|
3162 - | if value <= 11 {
|
2714 + | value: i16,
|
2715 + | ) -> ::std::result::Result<(), crate::model::fixed_value_short_internal::ConstraintViolation>
|
2716 + | {
|
2717 + | if (10..=10).contains(&value) {
|
3163 2718 | Ok(())
|
3164 2719 | } else {
|
3165 - | Err(crate::model::max_range_long_internal::ConstraintViolation::Range(value))
|
2720 + | Err(crate::model::fixed_value_short_internal::ConstraintViolation::Range(value))
|
3166 2721 | }
|
3167 2722 | }
|
3168 2723 | }
|
3169 - | impl ::std::convert::TryFrom<i64> for MaxRangeLong {
|
3170 - | type Error = crate::model::max_range_long_internal::ConstraintViolation;
|
2724 + | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
2725 + | type Error = crate::model::fixed_value_short_internal::ConstraintViolation;
|
3171 2726 |
|
3172 - | /// Constructs a `MaxRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
3173 - | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
2727 + | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
2728 + | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3174 2729 | Self::check_range(value)?;
|
3175 2730 |
|
3176 2731 | Ok(Self(value))
|
3177 2732 | }
|
3178 2733 | }
|
3179 2734 |
|
3180 2735 | #[allow(missing_docs)] // documentation missing in model
|
3181 2736 | ///
|
3182 2737 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3183 2738 | /// [constraint traits]. Use [`MinRangeLong::try_from`] to construct values of this type.
|
3242 2797 | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3243 2798 | Self::check_range(value)?;
|
3244 2799 |
|
3245 2800 | Ok(Self(value))
|
3246 2801 | }
|
3247 2802 | }
|
3248 2803 |
|
3249 2804 | #[allow(missing_docs)] // documentation missing in model
|
3250 2805 | ///
|
3251 2806 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3252 - | /// [constraint traits]. Use [`FixedValueShort::try_from`] to construct values of this type.
|
2807 + | /// [constraint traits]. Use [`MaxRangeLong::try_from`] to construct values of this type.
|
3253 2808 | ///
|
3254 2809 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3255 2810 | ///
|
3256 2811 | #[derive(
|
3257 2812 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3258 2813 | )]
|
3259 - | pub(crate) struct FixedValueShort(pub(crate) i16);
|
2814 + | pub(crate) struct MaxRangeLong(pub(crate) i64);
|
3260 2815 | #[allow(dead_code)]
|
3261 - | impl FixedValueShort {
|
3262 - | /// Returns an immutable reference to the underlying [`i16`].
|
3263 - | pub fn inner(&self) -> &i16 {
|
2816 + | impl MaxRangeLong {
|
2817 + | /// Returns an immutable reference to the underlying [`i64`].
|
2818 + | pub fn inner(&self) -> &i64 {
|
3264 2819 | &self.0
|
3265 2820 | }
|
3266 2821 |
|
3267 - | /// Consumes the value, returning the underlying [`i16`].
|
3268 - | pub fn into_inner(self) -> i16 {
|
2822 + | /// Consumes the value, returning the underlying [`i64`].
|
2823 + | pub fn into_inner(self) -> i64 {
|
3269 2824 | self.0
|
3270 2825 | }
|
3271 2826 | }
|
3272 2827 |
|
3273 - | impl crate::constrained::Constrained for FixedValueShort {
|
3274 - | type Unconstrained = i16;
|
2828 + | impl crate::constrained::Constrained for MaxRangeLong {
|
2829 + | type Unconstrained = i64;
|
3275 2830 | }
|
3276 2831 |
|
3277 - | impl ::std::convert::From<i16>
|
3278 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueShort>
|
2832 + | impl ::std::convert::From<i64>
|
2833 + | for crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>
|
3279 2834 | {
|
3280 - | fn from(value: i16) -> Self {
|
2835 + | fn from(value: i64) -> Self {
|
3281 2836 | Self::Unconstrained(value)
|
3282 2837 | }
|
3283 2838 | }
|
3284 2839 |
|
3285 - | impl ::std::fmt::Display for FixedValueShort {
|
2840 + | impl ::std::fmt::Display for MaxRangeLong {
|
3286 2841 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3287 2842 | self.0.fmt(f)
|
3288 2843 | }
|
3289 2844 | }
|
3290 2845 |
|
3291 - | impl ::std::convert::From<FixedValueShort> for i16 {
|
3292 - | fn from(value: FixedValueShort) -> Self {
|
2846 + | impl ::std::convert::From<MaxRangeLong> for i64 {
|
2847 + | fn from(value: MaxRangeLong) -> Self {
|
3293 2848 | value.into_inner()
|
3294 2849 | }
|
3295 2850 | }
|
3296 - | impl FixedValueShort {
|
2851 + | impl MaxRangeLong {
|
3297 2852 | fn check_range(
|
3298 - | value: i16,
|
3299 - | ) -> ::std::result::Result<(), crate::model::fixed_value_short_internal::ConstraintViolation>
|
3300 - | {
|
3301 - | if (10..=10).contains(&value) {
|
2853 + | value: i64,
|
2854 + | ) -> ::std::result::Result<(), crate::model::max_range_long_internal::ConstraintViolation> {
|
2855 + | if value <= 11 {
|
3302 2856 | Ok(())
|
3303 2857 | } else {
|
3304 - | Err(crate::model::fixed_value_short_internal::ConstraintViolation::Range(value))
|
2858 + | Err(crate::model::max_range_long_internal::ConstraintViolation::Range(value))
|
3305 2859 | }
|
3306 2860 | }
|
3307 2861 | }
|
3308 - | impl ::std::convert::TryFrom<i16> for FixedValueShort {
|
3309 - | type Error = crate::model::fixed_value_short_internal::ConstraintViolation;
|
2862 + | impl ::std::convert::TryFrom<i64> for MaxRangeLong {
|
2863 + | type Error = crate::model::max_range_long_internal::ConstraintViolation;
|
3310 2864 |
|
3311 - | /// Constructs a `FixedValueShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3312 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2865 + | /// Constructs a `MaxRangeLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2866 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3313 2867 | Self::check_range(value)?;
|
3314 2868 |
|
3315 2869 | Ok(Self(value))
|
3316 2870 | }
|
3317 2871 | }
|
3318 2872 |
|
3319 2873 | #[allow(missing_docs)] // documentation missing in model
|
3320 2874 | ///
|
3321 2875 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3322 - | /// [constraint traits]. Use [`MaxRangeShort::try_from`] to construct values of this type.
|
2876 + | /// [constraint traits]. Use [`FixedValueLong::try_from`] to construct values of this type.
|
3323 2877 | ///
|
3324 2878 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3325 2879 | ///
|
3326 2880 | #[derive(
|
3327 2881 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3328 2882 | )]
|
3329 - | pub(crate) struct MaxRangeShort(pub(crate) i16);
|
2883 + | pub(crate) struct FixedValueLong(pub(crate) i64);
|
3330 2884 | #[allow(dead_code)]
|
3331 - | impl MaxRangeShort {
|
3332 - | /// Returns an immutable reference to the underlying [`i16`].
|
3333 - | pub fn inner(&self) -> &i16 {
|
2885 + | impl FixedValueLong {
|
2886 + | /// Returns an immutable reference to the underlying [`i64`].
|
2887 + | pub fn inner(&self) -> &i64 {
|
3334 2888 | &self.0
|
3335 2889 | }
|
3336 2890 |
|
3337 - | /// Consumes the value, returning the underlying [`i16`].
|
3338 - | pub fn into_inner(self) -> i16 {
|
2891 + | /// Consumes the value, returning the underlying [`i64`].
|
2892 + | pub fn into_inner(self) -> i64 {
|
3339 2893 | self.0
|
3340 2894 | }
|
3341 2895 | }
|
3342 2896 |
|
3343 - | impl crate::constrained::Constrained for MaxRangeShort {
|
3344 - | type Unconstrained = i16;
|
2897 + | impl crate::constrained::Constrained for FixedValueLong {
|
2898 + | type Unconstrained = i64;
|
3345 2899 | }
|
3346 2900 |
|
3347 - | impl ::std::convert::From<i16>
|
3348 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>
|
2901 + | impl ::std::convert::From<i64>
|
2902 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueLong>
|
3349 2903 | {
|
3350 - | fn from(value: i16) -> Self {
|
2904 + | fn from(value: i64) -> Self {
|
3351 2905 | Self::Unconstrained(value)
|
3352 2906 | }
|
3353 2907 | }
|
3354 2908 |
|
3355 - | impl ::std::fmt::Display for MaxRangeShort {
|
2909 + | impl ::std::fmt::Display for FixedValueLong {
|
3356 2910 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3357 2911 | self.0.fmt(f)
|
3358 2912 | }
|
3359 2913 | }
|
3360 2914 |
|
3361 - | impl ::std::convert::From<MaxRangeShort> for i16 {
|
3362 - | fn from(value: MaxRangeShort) -> Self {
|
2915 + | impl ::std::convert::From<FixedValueLong> for i64 {
|
2916 + | fn from(value: FixedValueLong) -> Self {
|
3363 2917 | value.into_inner()
|
3364 2918 | }
|
3365 2919 | }
|
3366 - | impl MaxRangeShort {
|
2920 + | impl FixedValueLong {
|
3367 2921 | fn check_range(
|
3368 - | value: i16,
|
3369 - | ) -> ::std::result::Result<(), crate::model::max_range_short_internal::ConstraintViolation>
|
2922 + | value: i64,
|
2923 + | ) -> ::std::result::Result<(), crate::model::fixed_value_long_internal::ConstraintViolation>
|
3370 2924 | {
|
3371 - | if value <= 11 {
|
2925 + | if (10..=10).contains(&value) {
|
3372 2926 | Ok(())
|
3373 2927 | } else {
|
3374 - | Err(crate::model::max_range_short_internal::ConstraintViolation::Range(value))
|
2928 + | Err(crate::model::fixed_value_long_internal::ConstraintViolation::Range(value))
|
3375 2929 | }
|
3376 2930 | }
|
3377 2931 | }
|
3378 - | impl ::std::convert::TryFrom<i16> for MaxRangeShort {
|
3379 - | type Error = crate::model::max_range_short_internal::ConstraintViolation;
|
2932 + | impl ::std::convert::TryFrom<i64> for FixedValueLong {
|
2933 + | type Error = crate::model::fixed_value_long_internal::ConstraintViolation;
|
3380 2934 |
|
3381 - | /// Constructs a `MaxRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3382 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
2935 + | /// Constructs a `FixedValueLong` from an [`i64`], failing when the provided value does not satisfy the modeled constraints.
|
2936 + | fn try_from(value: i64) -> ::std::result::Result<Self, Self::Error> {
|
3383 2937 | Self::check_range(value)?;
|
3384 2938 |
|
3385 2939 | Ok(Self(value))
|
3386 2940 | }
|
3387 2941 | }
|
3388 2942 |
|
3389 2943 | #[allow(missing_docs)] // documentation missing in model
|
3390 2944 | ///
|
3391 2945 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3392 - | /// [constraint traits]. Use [`MinRangeShort::try_from`] to construct values of this type.
|
2946 + | /// [constraint traits]. Use [`MinRangeByte::try_from`] to construct values of this type.
|
3393 2947 | ///
|
3394 2948 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3395 2949 | ///
|
3396 2950 | #[derive(
|
3397 2951 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3398 2952 | )]
|
3399 - | pub(crate) struct MinRangeShort(pub(crate) i16);
|
2953 + | pub(crate) struct MinRangeByte(pub(crate) i8);
|
3400 2954 | #[allow(dead_code)]
|
3401 - | impl MinRangeShort {
|
3402 - | /// Returns an immutable reference to the underlying [`i16`].
|
3403 - | pub fn inner(&self) -> &i16 {
|
2955 + | impl MinRangeByte {
|
2956 + | /// Returns an immutable reference to the underlying [`i8`].
|
2957 + | pub fn inner(&self) -> &i8 {
|
3404 2958 | &self.0
|
3405 2959 | }
|
3406 2960 |
|
3407 - | /// Consumes the value, returning the underlying [`i16`].
|
3408 - | pub fn into_inner(self) -> i16 {
|
2961 + | /// Consumes the value, returning the underlying [`i8`].
|
2962 + | pub fn into_inner(self) -> i8 {
|
3409 2963 | self.0
|
3410 2964 | }
|
3411 2965 | }
|
3412 2966 |
|
3413 - | impl crate::constrained::Constrained for MinRangeShort {
|
3414 - | type Unconstrained = i16;
|
2967 + | impl crate::constrained::Constrained for MinRangeByte {
|
2968 + | type Unconstrained = i8;
|
3415 2969 | }
|
3416 2970 |
|
3417 - | impl ::std::convert::From<i16>
|
3418 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeShort>
|
3419 - | {
|
3420 - | fn from(value: i16) -> Self {
|
2971 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MinRangeByte> {
|
2972 + | fn from(value: i8) -> Self {
|
3421 2973 | Self::Unconstrained(value)
|
3422 2974 | }
|
3423 2975 | }
|
3424 2976 |
|
3425 - | impl ::std::fmt::Display for MinRangeShort {
|
2977 + | impl ::std::fmt::Display for MinRangeByte {
|
3426 2978 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3427 2979 | self.0.fmt(f)
|
3428 2980 | }
|
3429 2981 | }
|
3430 2982 |
|
3431 - | impl ::std::convert::From<MinRangeShort> for i16 {
|
3432 - | fn from(value: MinRangeShort) -> Self {
|
2983 + | impl ::std::convert::From<MinRangeByte> for i8 {
|
2984 + | fn from(value: MinRangeByte) -> Self {
|
3433 2985 | value.into_inner()
|
3434 2986 | }
|
3435 2987 | }
|
3436 - | impl MinRangeShort {
|
2988 + | impl MinRangeByte {
|
3437 2989 | fn check_range(
|
3438 - | value: i16,
|
3439 - | ) -> ::std::result::Result<(), crate::model::min_range_short_internal::ConstraintViolation>
|
3440 - | {
|
2990 + | value: i8,
|
2991 + | ) -> ::std::result::Result<(), crate::model::min_range_byte_internal::ConstraintViolation> {
|
3441 2992 | if -10 <= value {
|
3442 2993 | Ok(())
|
3443 2994 | } else {
|
3444 - | Err(crate::model::min_range_short_internal::ConstraintViolation::Range(value))
|
2995 + | Err(crate::model::min_range_byte_internal::ConstraintViolation::Range(value))
|
3445 2996 | }
|
3446 2997 | }
|
3447 2998 | }
|
3448 - | impl ::std::convert::TryFrom<i16> for MinRangeShort {
|
3449 - | type Error = crate::model::min_range_short_internal::ConstraintViolation;
|
2999 + | impl ::std::convert::TryFrom<i8> for MinRangeByte {
|
3000 + | type Error = crate::model::min_range_byte_internal::ConstraintViolation;
|
3450 3001 |
|
3451 - | /// Constructs a `MinRangeShort` from an [`i16`], failing when the provided value does not satisfy the modeled constraints.
|
3452 - | fn try_from(value: i16) -> ::std::result::Result<Self, Self::Error> {
|
3002 + | /// Constructs a `MinRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3003 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3453 3004 | Self::check_range(value)?;
|
3454 3005 |
|
3455 3006 | Ok(Self(value))
|
3456 3007 | }
|
3457 3008 | }
|
3458 3009 |
|
3459 3010 | #[allow(missing_docs)] // documentation missing in model
|
3460 3011 | ///
|
3461 3012 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3462 - | /// [constraint traits]. Use [`FixedValueInteger::try_from`] to construct values of this type.
|
3013 + | /// [constraint traits]. Use [`MaxRangeByte::try_from`] to construct values of this type.
|
3463 3014 | ///
|
3464 3015 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3465 3016 | ///
|
3466 3017 | #[derive(
|
3467 3018 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3468 3019 | )]
|
3469 - | pub(crate) struct FixedValueInteger(pub(crate) i32);
|
3020 + | pub(crate) struct MaxRangeByte(pub(crate) i8);
|
3470 3021 | #[allow(dead_code)]
|
3471 - | impl FixedValueInteger {
|
3472 - | /// Returns an immutable reference to the underlying [`i32`].
|
3473 - | pub fn inner(&self) -> &i32 {
|
3022 + | impl MaxRangeByte {
|
3023 + | /// Returns an immutable reference to the underlying [`i8`].
|
3024 + | pub fn inner(&self) -> &i8 {
|
3474 3025 | &self.0
|
3475 3026 | }
|
3476 3027 |
|
3477 - | /// Consumes the value, returning the underlying [`i32`].
|
3478 - | pub fn into_inner(self) -> i32 {
|
3028 + | /// Consumes the value, returning the underlying [`i8`].
|
3029 + | pub fn into_inner(self) -> i8 {
|
3479 3030 | self.0
|
3480 3031 | }
|
3481 3032 | }
|
3482 3033 |
|
3483 - | impl crate::constrained::Constrained for FixedValueInteger {
|
3484 - | type Unconstrained = i32;
|
3034 + | impl crate::constrained::Constrained for MaxRangeByte {
|
3035 + | type Unconstrained = i8;
|
3485 3036 | }
|
3486 3037 |
|
3487 - | impl ::std::convert::From<i32>
|
3488 - | for crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>
|
3489 - | {
|
3490 - | fn from(value: i32) -> Self {
|
3038 + | impl ::std::convert::From<i8> for crate::constrained::MaybeConstrained<crate::model::MaxRangeByte> {
|
3039 + | fn from(value: i8) -> Self {
|
3491 3040 | Self::Unconstrained(value)
|
3492 3041 | }
|
3493 3042 | }
|
3494 3043 |
|
3495 - | impl ::std::fmt::Display for FixedValueInteger {
|
3044 + | impl ::std::fmt::Display for MaxRangeByte {
|
3496 3045 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3497 3046 | self.0.fmt(f)
|
3498 3047 | }
|
3499 3048 | }
|
3500 3049 |
|
3501 - | impl ::std::convert::From<FixedValueInteger> for i32 {
|
3502 - | fn from(value: FixedValueInteger) -> Self {
|
3050 + | impl ::std::convert::From<MaxRangeByte> for i8 {
|
3051 + | fn from(value: MaxRangeByte) -> Self {
|
3503 3052 | value.into_inner()
|
3504 3053 | }
|
3505 3054 | }
|
3506 - | impl FixedValueInteger {
|
3055 + | impl MaxRangeByte {
|
3507 3056 | fn check_range(
|
3508 - | value: i32,
|
3509 - | ) -> ::std::result::Result<(), crate::model::fixed_value_integer_internal::ConstraintViolation>
|
3510 - | {
|
3511 - | if (69..=69).contains(&value) {
|
3057 + | value: i8,
|
3058 + | ) -> ::std::result::Result<(), crate::model::max_range_byte_internal::ConstraintViolation> {
|
3059 + | if value <= 11 {
|
3512 3060 | Ok(())
|
3513 3061 | } else {
|
3514 - | Err(crate::model::fixed_value_integer_internal::ConstraintViolation::Range(value))
|
3062 + | Err(crate::model::max_range_byte_internal::ConstraintViolation::Range(value))
|
3515 3063 | }
|
3516 3064 | }
|
3517 3065 | }
|
3518 - | impl ::std::convert::TryFrom<i32> for FixedValueInteger {
|
3519 - | type Error = crate::model::fixed_value_integer_internal::ConstraintViolation;
|
3066 + | impl ::std::convert::TryFrom<i8> for MaxRangeByte {
|
3067 + | type Error = crate::model::max_range_byte_internal::ConstraintViolation;
|
3520 3068 |
|
3521 - | /// Constructs a `FixedValueInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3522 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3069 + | /// Constructs a `MaxRangeByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3070 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3523 3071 | Self::check_range(value)?;
|
3524 3072 |
|
3525 3073 | Ok(Self(value))
|
3526 3074 | }
|
3527 3075 | }
|
3528 3076 |
|
3529 3077 | #[allow(missing_docs)] // documentation missing in model
|
3530 3078 | ///
|
3531 3079 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3532 - | /// [constraint traits]. Use [`MaxRangeInteger::try_from`] to construct values of this type.
|
3080 + | /// [constraint traits]. Use [`FixedValueByte::try_from`] to construct values of this type.
|
3533 3081 | ///
|
3534 3082 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3535 3083 | ///
|
3536 3084 | #[derive(
|
3537 3085 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3538 3086 | )]
|
3539 - | pub(crate) struct MaxRangeInteger(pub(crate) i32);
|
3087 + | pub(crate) struct FixedValueByte(pub(crate) i8);
|
3540 3088 | #[allow(dead_code)]
|
3541 - | impl MaxRangeInteger {
|
3542 - | /// Returns an immutable reference to the underlying [`i32`].
|
3543 - | pub fn inner(&self) -> &i32 {
|
3089 + | impl FixedValueByte {
|
3090 + | /// Returns an immutable reference to the underlying [`i8`].
|
3091 + | pub fn inner(&self) -> &i8 {
|
3544 3092 | &self.0
|
3545 3093 | }
|
3546 3094 |
|
3547 - | /// Consumes the value, returning the underlying [`i32`].
|
3548 - | pub fn into_inner(self) -> i32 {
|
3095 + | /// Consumes the value, returning the underlying [`i8`].
|
3096 + | pub fn into_inner(self) -> i8 {
|
3549 3097 | self.0
|
3550 3098 | }
|
3551 3099 | }
|
3552 3100 |
|
3553 - | impl crate::constrained::Constrained for MaxRangeInteger {
|
3554 - | type Unconstrained = i32;
|
3101 + | impl crate::constrained::Constrained for FixedValueByte {
|
3102 + | type Unconstrained = i8;
|
3555 3103 | }
|
3556 3104 |
|
3557 - | impl ::std::convert::From<i32>
|
3558 - | for crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>
|
3105 + | impl ::std::convert::From<i8>
|
3106 + | for crate::constrained::MaybeConstrained<crate::model::FixedValueByte>
|
3559 3107 | {
|
3560 - | fn from(value: i32) -> Self {
|
3108 + | fn from(value: i8) -> Self {
|
3561 3109 | Self::Unconstrained(value)
|
3562 3110 | }
|
3563 3111 | }
|
3564 3112 |
|
3565 - | impl ::std::fmt::Display for MaxRangeInteger {
|
3113 + | impl ::std::fmt::Display for FixedValueByte {
|
3566 3114 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3567 3115 | self.0.fmt(f)
|
3568 3116 | }
|
3569 3117 | }
|
3570 3118 |
|
3571 - | impl ::std::convert::From<MaxRangeInteger> for i32 {
|
3572 - | fn from(value: MaxRangeInteger) -> Self {
|
3119 + | impl ::std::convert::From<FixedValueByte> for i8 {
|
3120 + | fn from(value: FixedValueByte) -> Self {
|
3573 3121 | value.into_inner()
|
3574 3122 | }
|
3575 3123 | }
|
3576 - | impl MaxRangeInteger {
|
3124 + | impl FixedValueByte {
|
3577 3125 | fn check_range(
|
3578 - | value: i32,
|
3579 - | ) -> ::std::result::Result<(), crate::model::max_range_integer_internal::ConstraintViolation>
|
3126 + | value: i8,
|
3127 + | ) -> ::std::result::Result<(), crate::model::fixed_value_byte_internal::ConstraintViolation>
|
3580 3128 | {
|
3581 - | if value <= 69 {
|
3129 + | if (10..=10).contains(&value) {
|
3582 3130 | Ok(())
|
3583 3131 | } else {
|
3584 - | Err(crate::model::max_range_integer_internal::ConstraintViolation::Range(value))
|
3132 + | Err(crate::model::fixed_value_byte_internal::ConstraintViolation::Range(value))
|
3585 3133 | }
|
3586 3134 | }
|
3587 3135 | }
|
3588 - | impl ::std::convert::TryFrom<i32> for MaxRangeInteger {
|
3589 - | type Error = crate::model::max_range_integer_internal::ConstraintViolation;
|
3136 + | impl ::std::convert::TryFrom<i8> for FixedValueByte {
|
3137 + | type Error = crate::model::fixed_value_byte_internal::ConstraintViolation;
|
3590 3138 |
|
3591 - | /// Constructs a `MaxRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3592 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3139 + | /// Constructs a `FixedValueByte` from an [`i8`], failing when the provided value does not satisfy the modeled constraints.
|
3140 + | fn try_from(value: i8) -> ::std::result::Result<Self, Self::Error> {
|
3593 3141 | Self::check_range(value)?;
|
3594 3142 |
|
3595 3143 | Ok(Self(value))
|
3596 3144 | }
|
3597 3145 | }
|
3598 3146 |
|
3599 3147 | #[allow(missing_docs)] // documentation missing in model
|
3600 3148 | ///
|
3601 3149 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3602 - | /// [constraint traits]. Use [`MinRangeInteger::try_from`] to construct values of this type.
|
3150 + | /// [constraint traits]. Use [`LengthList::try_from`] to construct values of this type.
|
3603 3151 | ///
|
3604 3152 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3605 3153 | ///
|
3606 3154 | #[derive(
|
3607 3155 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3608 3156 | )]
|
3609 - | pub(crate) struct MinRangeInteger(pub(crate) i32);
|
3610 - | #[allow(dead_code)]
|
3611 - | impl MinRangeInteger {
|
3612 - | /// Returns an immutable reference to the underlying [`i32`].
|
3613 - | pub fn inner(&self) -> &i32 {
|
3614 - | &self.0
|
3615 - | }
|
3616 - |
|
3617 - | /// Consumes the value, returning the underlying [`i32`].
|
3618 - | pub fn into_inner(self) -> i32 {
|
3157 + | pub(crate) struct LengthList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
3158 + | impl LengthList {
|
3159 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
3160 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
3619 3161 | self.0
|
3620 3162 | }
|
3621 - | }
|
3622 - |
|
3623 - | impl crate::constrained::Constrained for MinRangeInteger {
|
3624 - | type Unconstrained = i32;
|
3625 - | }
|
3626 - |
|
3627 - | impl ::std::convert::From<i32>
|
3628 - | for crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>
|
3629 - | {
|
3630 - | fn from(value: i32) -> Self {
|
3631 - | Self::Unconstrained(value)
|
3632 - | }
|
3633 - | }
|
3634 - |
|
3635 - | impl ::std::fmt::Display for MinRangeInteger {
|
3636 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3637 - | self.0.fmt(f)
|
3638 - | }
|
3639 - | }
|
3640 3163 |
|
3641 - | impl ::std::convert::From<MinRangeInteger> for i32 {
|
3642 - | fn from(value: MinRangeInteger) -> Self {
|
3643 - | value.into_inner()
|
3644 - | }
|
3645 - | }
|
3646 - | impl MinRangeInteger {
|
3647 - | fn check_range(
|
3648 - | value: i32,
|
3649 - | ) -> ::std::result::Result<(), crate::model::min_range_integer_internal::ConstraintViolation>
|
3650 - | {
|
3651 - | if -10 <= value {
|
3164 + | fn check_length(
|
3165 + | length: usize,
|
3166 + | ) -> ::std::result::Result<(), crate::model::length_list_internal::ConstraintViolation> {
|
3167 + | if length <= 69 {
|
3652 3168 | Ok(())
|
3653 3169 | } else {
|
3654 - | Err(crate::model::min_range_integer_internal::ConstraintViolation::Range(value))
|
3170 + | Err(crate::model::length_list_internal::ConstraintViolation::Length(length))
|
3655 3171 | }
|
3656 3172 | }
|
3657 3173 | }
|
3658 - | impl ::std::convert::TryFrom<i32> for MinRangeInteger {
|
3659 - | type Error = crate::model::min_range_integer_internal::ConstraintViolation;
|
3174 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for LengthList {
|
3175 + | type Error = crate::model::length_list_internal::ConstraintViolation;
|
3660 3176 |
|
3661 - | /// Constructs a `MinRangeInteger` from an [`i32`], failing when the provided value does not satisfy the modeled constraints.
|
3662 - | fn try_from(value: i32) -> ::std::result::Result<Self, Self::Error> {
|
3663 - | Self::check_range(value)?;
|
3177 + | /// Constructs a `LengthList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3178 + | fn try_from(
|
3179 + | value: ::std::vec::Vec<::std::string::String>,
|
3180 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3181 + | Self::check_length(value.len())?;
|
3664 3182 |
|
3665 3183 | Ok(Self(value))
|
3666 3184 | }
|
3667 3185 | }
|
3668 3186 |
|
3187 + | impl ::std::convert::From<LengthList> for ::std::vec::Vec<::std::string::String> {
|
3188 + | fn from(value: LengthList) -> Self {
|
3189 + | value.into_inner()
|
3190 + | }
|
3191 + | }
|
3192 + | impl crate::constrained::Constrained for LengthList {
|
3193 + | type Unconstrained = crate::unconstrained::length_list_unconstrained::LengthListUnconstrained;
|
3194 + | }
|
3195 + |
|
3669 3196 | #[allow(missing_docs)] // documentation missing in model
|
3670 3197 | ///
|
3671 3198 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3672 - | /// [constraint traits]. Use [`FixedLengthBlob::try_from`] to construct values of this type.
|
3199 + | /// [constraint traits]. Use [`SensitiveLengthList::try_from`] to construct values of this type.
|
3673 3200 | ///
|
3674 3201 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3675 3202 | ///
|
3676 3203 | #[derive(
|
3677 3204 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3678 3205 | )]
|
3679 - | pub(crate) struct FixedLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3680 - | impl FixedLengthBlob {
|
3681 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3682 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3683 - | self.0
|
3684 - | }
|
3685 - | }
|
3686 - | impl FixedLengthBlob {
|
3206 + | pub(crate) struct SensitiveLengthList(pub(crate) ::std::vec::Vec<crate::model::SensitiveStructure>);
|
3207 + | impl SensitiveLengthList {
|
3208 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::SensitiveStructure>`].
|
3209 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::SensitiveStructure> {
|
3210 + | self.0
|
3211 + | }
|
3212 + |
|
3687 3213 | fn check_length(
|
3688 - | blob: &::aws_smithy_types::Blob,
|
3689 - | ) -> ::std::result::Result<(), crate::model::fixed_length_blob_internal::ConstraintViolation>
|
3214 + | length: usize,
|
3215 + | ) -> ::std::result::Result<(), crate::model::sensitive_length_list_internal::ConstraintViolation>
|
3690 3216 | {
|
3691 - | let length = blob.as_ref().len();
|
3692 - |
|
3693 - | if (70..=70).contains(&length) {
|
3217 + | if length <= 69 {
|
3694 3218 | Ok(())
|
3695 3219 | } else {
|
3696 - | Err(crate::model::fixed_length_blob_internal::ConstraintViolation::Length(length))
|
3220 + | Err(crate::model::sensitive_length_list_internal::ConstraintViolation::Length(length))
|
3697 3221 | }
|
3698 3222 | }
|
3699 3223 | }
|
3700 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for FixedLengthBlob {
|
3701 - | type Error = crate::model::fixed_length_blob_internal::ConstraintViolation;
|
3224 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::SensitiveStructure>>
|
3225 + | for SensitiveLengthList
|
3226 + | {
|
3227 + | type Error = crate::model::sensitive_length_list_internal::ConstraintViolation;
|
3702 3228 |
|
3703 - | /// Constructs a `FixedLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3704 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3705 - | Self::check_length(&value)?;
|
3229 + | /// Constructs a `SensitiveLengthList` from an [`::std::vec::Vec<crate::model::SensitiveStructure>`], failing when the provided value does not satisfy the modeled constraints.
|
3230 + | fn try_from(
|
3231 + | value: ::std::vec::Vec<crate::model::SensitiveStructure>,
|
3232 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3233 + | Self::check_length(value.len())?;
|
3706 3234 |
|
3707 3235 | Ok(Self(value))
|
3708 3236 | }
|
3709 3237 | }
|
3710 - | impl crate::constrained::Constrained for FixedLengthBlob {
|
3711 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3712 - | }
|
3713 3238 |
|
3714 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3715 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>
|
3239 + | impl ::std::convert::From<SensitiveLengthList>
|
3240 + | for ::std::vec::Vec<crate::model::SensitiveStructure>
|
3716 3241 | {
|
3717 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3718 - | Self::Unconstrained(value)
|
3719 - | }
|
3720 - | }
|
3721 - |
|
3722 - | impl ::std::convert::From<FixedLengthBlob> for ::aws_smithy_types::Blob {
|
3723 - | fn from(value: FixedLengthBlob) -> Self {
|
3242 + | fn from(value: SensitiveLengthList) -> Self {
|
3724 3243 | value.into_inner()
|
3725 3244 | }
|
3726 3245 | }
|
3246 + | impl crate::constrained::Constrained for SensitiveLengthList {
|
3247 + | type Unconstrained =
|
3248 + | crate::unconstrained::sensitive_length_list_unconstrained::SensitiveLengthListUnconstrained;
|
3249 + | }
|
3727 3250 |
|
3728 3251 | #[allow(missing_docs)] // documentation missing in model
|
3729 3252 | ///
|
3730 3253 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3731 - | /// [constraint traits]. Use [`MaxLengthBlob::try_from`] to construct values of this type.
|
3254 + | /// [constraint traits]. Use [`ConBSet::try_from`] to construct values of this type.
|
3732 3255 | ///
|
3733 3256 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3734 3257 | ///
|
3735 3258 | #[derive(
|
3736 3259 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3737 3260 | )]
|
3738 - | pub(crate) struct MaxLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3739 - | impl MaxLengthBlob {
|
3740 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3741 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3261 + | pub(crate) struct ConBSet(pub(crate) ::std::vec::Vec<crate::model::ConBSetInner>);
|
3262 + | impl ConBSet {
|
3263 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConBSetInner>`].
|
3264 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConBSetInner> {
|
3742 3265 | self.0
|
3743 3266 | }
|
3744 - | }
|
3745 - | impl MaxLengthBlob {
|
3746 - | fn check_length(
|
3747 - | blob: &::aws_smithy_types::Blob,
|
3748 - | ) -> ::std::result::Result<(), crate::model::max_length_blob_internal::ConstraintViolation>
|
3749 - | {
|
3750 - | let length = blob.as_ref().len();
|
3751 3267 |
|
3752 - | if length <= 70 {
|
3753 - | Ok(())
|
3268 + | fn check_unique_items(
|
3269 + | items: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3270 + | ) -> ::std::result::Result<
|
3271 + | ::std::vec::Vec<crate::model::ConBSetInner>,
|
3272 + | crate::model::con_b_set_internal::ConstraintViolation,
|
3273 + | > {
|
3274 + | let mut seen = ::std::collections::HashMap::new();
|
3275 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3276 + | for (idx, item) in items.iter().enumerate() {
|
3277 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3278 + | duplicate_indices.push(prev_idx);
|
3279 + | }
|
3280 + | }
|
3281 + |
|
3282 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3283 + | for idx in &duplicate_indices {
|
3284 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3285 + | last_duplicate_indices.push(prev_idx);
|
3286 + | }
|
3287 + | }
|
3288 + | duplicate_indices.extend(last_duplicate_indices);
|
3289 + |
|
3290 + | if !duplicate_indices.is_empty() {
|
3291 + | debug_assert!(duplicate_indices.len() >= 2);
|
3292 + | Err(
|
3293 + | crate::model::con_b_set_internal::ConstraintViolation::UniqueItems {
|
3294 + | duplicate_indices,
|
3295 + | original: items,
|
3296 + | },
|
3297 + | )
|
3754 3298 | } else {
|
3755 - | Err(crate::model::max_length_blob_internal::ConstraintViolation::Length(length))
|
3299 + | Ok(items)
|
3756 3300 | }
|
3757 3301 | }
|
3758 3302 | }
|
3759 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MaxLengthBlob {
|
3760 - | type Error = crate::model::max_length_blob_internal::ConstraintViolation;
|
3303 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConBSetInner>> for ConBSet {
|
3304 + | type Error = crate::model::con_b_set_internal::ConstraintViolation;
|
3761 3305 |
|
3762 - | /// Constructs a `MaxLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3763 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3764 - | Self::check_length(&value)?;
|
3306 + | /// Constructs a `ConBSet` from an [`::std::vec::Vec<crate::model::ConBSetInner>`], failing when the provided value does not satisfy the modeled constraints.
|
3307 + | fn try_from(
|
3308 + | value: ::std::vec::Vec<crate::model::ConBSetInner>,
|
3309 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3310 + | let value = Self::check_unique_items(value)?;
|
3765 3311 |
|
3766 3312 | Ok(Self(value))
|
3767 3313 | }
|
3768 3314 | }
|
3769 - | impl crate::constrained::Constrained for MaxLengthBlob {
|
3770 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3771 - | }
|
3772 3315 |
|
3773 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3774 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>
|
3775 - | {
|
3776 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3777 - | Self::Unconstrained(value)
|
3316 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<crate::model::ConBSetInner> {
|
3317 + | fn from(value: ConBSet) -> Self {
|
3318 + | value.into_inner()
|
3778 3319 | }
|
3779 3320 | }
|
3780 - |
|
3781 - | impl ::std::convert::From<MaxLengthBlob> for ::aws_smithy_types::Blob {
|
3782 - | fn from(value: MaxLengthBlob) -> Self {
|
3783 - | value.into_inner()
|
3321 + | impl ::std::convert::From<ConBSet> for ::std::vec::Vec<::std::vec::Vec<::std::string::String>> {
|
3322 + | fn from(value: ConBSet) -> Self {
|
3323 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
3784 3324 | }
|
3785 3325 | }
|
3326 + | impl crate::constrained::Constrained for ConBSet {
|
3327 + | type Unconstrained = crate::unconstrained::con_b_set_unconstrained::ConBSetUnconstrained;
|
3328 + | }
|
3786 3329 |
|
3787 3330 | #[allow(missing_docs)] // documentation missing in model
|
3788 3331 | ///
|
3789 3332 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3790 - | /// [constraint traits]. Use [`MinLengthBlob::try_from`] to construct values of this type.
|
3333 + | /// [constraint traits]. Use [`LengthMap::try_from`] to construct values of this type.
|
3791 3334 | ///
|
3792 3335 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3793 3336 | ///
|
3794 - | #[derive(
|
3795 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3796 - | )]
|
3797 - | pub(crate) struct MinLengthBlob(pub(crate) ::aws_smithy_types::Blob);
|
3798 - | impl MinLengthBlob {
|
3799 - | /// Consumes the value, returning the underlying [`::aws_smithy_types::Blob`].
|
3800 - | pub fn into_inner(self) -> ::aws_smithy_types::Blob {
|
3337 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3338 + | pub(crate) struct LengthMap(
|
3339 + | pub(crate) ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3340 + | );
|
3341 + | impl LengthMap {
|
3342 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::string::String>`].
|
3343 + | pub fn into_inner(
|
3344 + | self,
|
3345 + | ) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
3801 3346 | self.0
|
3802 3347 | }
|
3803 3348 | }
|
3804 - | impl MinLengthBlob {
|
3805 - | fn check_length(
|
3806 - | blob: &::aws_smithy_types::Blob,
|
3807 - | ) -> ::std::result::Result<(), crate::model::min_length_blob_internal::ConstraintViolation>
|
3808 - | {
|
3809 - | let length = blob.as_ref().len();
|
3349 + | impl
|
3350 + | ::std::convert::TryFrom<
|
3351 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3352 + | > for LengthMap
|
3353 + | {
|
3354 + | type Error = crate::model::length_map_internal::ConstraintViolation;
|
3810 3355 |
|
3811 - | if 2 <= length {
|
3812 - | Ok(())
|
3356 + | /// Constructs a `LengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
3357 + | fn try_from(
|
3358 + | value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3359 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3360 + | let length = value.len();
|
3361 + | if (1..=69).contains(&length) {
|
3362 + | Ok(Self(value))
|
3813 3363 | } else {
|
3814 - | Err(crate::model::min_length_blob_internal::ConstraintViolation::Length(length))
|
3815 - | }
|
3364 + | Err(crate::model::length_map_internal::ConstraintViolation::Length(length))
|
3816 3365 | }
|
3817 - | }
|
3818 - | impl ::std::convert::TryFrom<::aws_smithy_types::Blob> for MinLengthBlob {
|
3819 - | type Error = crate::model::min_length_blob_internal::ConstraintViolation;
|
3820 - |
|
3821 - | /// Constructs a `MinLengthBlob` from an [`::aws_smithy_types::Blob`], failing when the provided value does not satisfy the modeled constraints.
|
3822 - | fn try_from(value: ::aws_smithy_types::Blob) -> ::std::result::Result<Self, Self::Error> {
|
3823 - | Self::check_length(&value)?;
|
3824 - |
|
3825 - | Ok(Self(value))
|
3826 3366 | }
|
3827 3367 | }
|
3828 - | impl crate::constrained::Constrained for MinLengthBlob {
|
3829 - | type Unconstrained = ::aws_smithy_types::Blob;
|
3830 - | }
|
3831 3368 |
|
3832 - | impl ::std::convert::From<::aws_smithy_types::Blob>
|
3833 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>
|
3369 + | impl ::std::convert::From<LengthMap>
|
3370 + | for ::std::collections::HashMap<::std::string::String, ::std::string::String>
|
3834 3371 | {
|
3835 - | fn from(value: ::aws_smithy_types::Blob) -> Self {
|
3836 - | Self::Unconstrained(value)
|
3837 - | }
|
3838 - | }
|
3839 - |
|
3840 - | impl ::std::convert::From<MinLengthBlob> for ::aws_smithy_types::Blob {
|
3841 - | fn from(value: MinLengthBlob) -> Self {
|
3372 + | fn from(value: LengthMap) -> Self {
|
3842 3373 | value.into_inner()
|
3843 3374 | }
|
3844 3375 | }
|
3376 + | impl crate::constrained::Constrained for LengthMap {
|
3377 + | type Unconstrained = crate::unconstrained::length_map_unconstrained::LengthMapUnconstrained;
|
3378 + | }
|
3845 3379 |
|
3846 3380 | #[allow(missing_docs)] // documentation missing in model
|
3847 3381 | ///
|
3848 3382 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3849 - | /// [constraint traits]. Use [`FixedLengthString::try_from`] to construct values of this type.
|
3383 + | /// [constraint traits]. Use [`SparseLengthMap::try_from`] to construct values of this type.
|
3850 3384 | ///
|
3851 3385 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3852 3386 | ///
|
3853 - | #[derive(
|
3854 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3855 - | )]
|
3856 - | pub(crate) struct FixedLengthString(pub(crate) ::std::string::String);
|
3857 - | #[allow(dead_code)]
|
3858 - | impl FixedLengthString {
|
3859 - | /// Extracts a string slice containing the entire underlying `String`.
|
3860 - | pub fn as_str(&self) -> &str {
|
3861 - | &self.0
|
3862 - | }
|
3863 - |
|
3864 - | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3865 - | pub fn inner(&self) -> &::std::string::String {
|
3866 - | &self.0
|
3867 - | }
|
3868 - |
|
3869 - | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3870 - | pub fn into_inner(self) -> ::std::string::String {
|
3387 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3388 + | pub(crate) struct SparseLengthMap(
|
3389 + | pub(crate) ::std::collections::HashMap<
|
3390 + | ::std::string::String,
|
3391 + | ::std::option::Option<::std::string::String>,
|
3392 + | >,
|
3393 + | );
|
3394 + | impl SparseLengthMap {
|
3395 + | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`].
|
3396 + | pub fn into_inner(
|
3397 + | self,
|
3398 + | ) -> ::std::collections::HashMap<
|
3399 + | ::std::string::String,
|
3400 + | ::std::option::Option<::std::string::String>,
|
3401 + | > {
|
3871 3402 | self.0
|
3872 3403 | }
|
3873 3404 | }
|
3874 - | impl FixedLengthString {
|
3875 - | fn check_length(
|
3876 - | string: &str,
|
3877 - | ) -> ::std::result::Result<(), crate::model::fixed_length_string_internal::ConstraintViolation>
|
3878 - | {
|
3879 - | let length = string.chars().count();
|
3405 + | impl
|
3406 + | ::std::convert::TryFrom<
|
3407 + | ::std::collections::HashMap<
|
3408 + | ::std::string::String,
|
3409 + | ::std::option::Option<::std::string::String>,
|
3410 + | >,
|
3411 + | > for SparseLengthMap
|
3412 + | {
|
3413 + | type Error = crate::model::sparse_length_map_internal::ConstraintViolation;
|
3880 3414 |
|
3881 - | if (69..=69).contains(&length) {
|
3882 - | Ok(())
|
3415 + | /// Constructs a `SparseLengthMap` from an [`::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
3416 + | fn try_from(
|
3417 + | value: ::std::collections::HashMap<
|
3418 + | ::std::string::String,
|
3419 + | ::std::option::Option<::std::string::String>,
|
3420 + | >,
|
3421 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3422 + | let length = value.len();
|
3423 + | if 69 <= length {
|
3424 + | Ok(Self(value))
|
3883 3425 | } else {
|
3884 - | Err(crate::model::fixed_length_string_internal::ConstraintViolation::Length(length))
|
3426 + | Err(crate::model::sparse_length_map_internal::ConstraintViolation::Length(length))
|
3885 3427 | }
|
3886 3428 | }
|
3887 3429 | }
|
3888 - | impl ::std::convert::TryFrom<::std::string::String> for FixedLengthString {
|
3889 - | type Error = crate::model::fixed_length_string_internal::ConstraintViolation;
|
3890 - |
|
3891 - | /// Constructs a `FixedLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3892 - | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3893 - | Self::check_length(&value)?;
|
3894 3430 |
|
3895 - | Ok(Self(value))
|
3431 + | impl ::std::convert::From<SparseLengthMap>
|
3432 + | for ::std::collections::HashMap<
|
3433 + | ::std::string::String,
|
3434 + | ::std::option::Option<::std::string::String>,
|
3435 + | >
|
3436 + | {
|
3437 + | fn from(value: SparseLengthMap) -> Self {
|
3438 + | value.into_inner()
|
3896 3439 | }
|
3897 3440 | }
|
3898 - | impl crate::constrained::Constrained for FixedLengthString {
|
3899 - | type Unconstrained = ::std::string::String;
|
3441 + | impl crate::constrained::Constrained for SparseLengthMap {
|
3442 + | type Unconstrained =
|
3443 + | crate::unconstrained::sparse_length_map_unconstrained::SparseLengthMapUnconstrained;
|
3900 3444 | }
|
3901 3445 |
|
3902 - | impl ::std::convert::From<::std::string::String>
|
3903 - | for crate::constrained::MaybeConstrained<crate::model::FixedLengthString>
|
3904 - | {
|
3905 - | fn from(value: ::std::string::String) -> Self {
|
3906 - | Self::Unconstrained(value)
|
3446 + | #[allow(missing_docs)] // documentation missing in model
|
3447 + | ///
|
3448 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3449 + | /// [constraint traits]. Use [`SparseLengthList::try_from`] to construct values of this type.
|
3450 + | ///
|
3451 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3452 + | ///
|
3453 + | #[derive(
|
3454 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3455 + | )]
|
3456 + | pub(crate) struct SparseLengthList(
|
3457 + | pub(crate) ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3458 + | );
|
3459 + | impl SparseLengthList {
|
3460 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::option::Option<::std::string::String>>`].
|
3461 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::option::Option<::std::string::String>> {
|
3462 + | self.0
|
3463 + | }
|
3464 + |
|
3465 + | fn check_length(
|
3466 + | length: usize,
|
3467 + | ) -> ::std::result::Result<(), crate::model::sparse_length_list_internal::ConstraintViolation>
|
3468 + | {
|
3469 + | if 69 <= length {
|
3470 + | Ok(())
|
3471 + | } else {
|
3472 + | Err(crate::model::sparse_length_list_internal::ConstraintViolation::Length(length))
|
3473 + | }
|
3907 3474 | }
|
3908 3475 | }
|
3476 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::option::Option<::std::string::String>>>
|
3477 + | for SparseLengthList
|
3478 + | {
|
3479 + | type Error = crate::model::sparse_length_list_internal::ConstraintViolation;
|
3909 3480 |
|
3910 - | impl ::std::fmt::Display for FixedLengthString {
|
3911 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3912 - | self.0.fmt(f)
|
3481 + | /// Constructs a `SparseLengthList` from an [`::std::vec::Vec<::std::option::Option<::std::string::String>>`], failing when the provided value does not satisfy the modeled constraints.
|
3482 + | fn try_from(
|
3483 + | value: ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
3484 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3485 + | Self::check_length(value.len())?;
|
3486 + |
|
3487 + | Ok(Self(value))
|
3913 3488 | }
|
3914 3489 | }
|
3915 3490 |
|
3916 - | impl ::std::convert::From<FixedLengthString> for ::std::string::String {
|
3917 - | fn from(value: FixedLengthString) -> Self {
|
3491 + | impl ::std::convert::From<SparseLengthList>
|
3492 + | for ::std::vec::Vec<::std::option::Option<::std::string::String>>
|
3493 + | {
|
3494 + | fn from(value: SparseLengthList) -> Self {
|
3918 3495 | value.into_inner()
|
3919 3496 | }
|
3920 3497 | }
|
3498 + | impl crate::constrained::Constrained for SparseLengthList {
|
3499 + | type Unconstrained =
|
3500 + | crate::unconstrained::sparse_length_list_unconstrained::SparseLengthListUnconstrained;
|
3501 + | }
|
3502 + |
|
3503 + | /// A union with constrained members.
|
3504 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3505 + | pub enum ConstrainedUnion {
|
3506 + | #[allow(missing_docs)] // documentation missing in model
|
3507 + | ConBList(::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>),
|
3508 + | #[allow(missing_docs)] // documentation missing in model
|
3509 + | ConBMap(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
3510 + | #[allow(missing_docs)] // documentation missing in model
|
3511 + | ConBSet(::std::vec::Vec<::std::vec::Vec<::std::string::String>>),
|
3512 + | #[allow(missing_docs)] // documentation missing in model
|
3513 + | ConstrainedStructure(crate::model::ConB),
|
3514 + | #[allow(missing_docs)] // documentation missing in model
|
3515 + | EnumString(crate::model::EnumString),
|
3516 + | #[allow(missing_docs)] // documentation missing in model
|
3517 + | LengthString(::std::string::String),
|
3518 + | }
|
3519 + | impl ConstrainedUnion {
|
3520 + | /// Tries to convert the enum instance into [`ConBList`](crate::model::ConstrainedUnion::ConBList), extracting the inner [`Vec`](::std::vec::Vec).
|
3521 + | /// Returns `Err(&Self)` if it can't be converted.
|
3522 + | pub fn as_con_b_list(
|
3523 + | &self,
|
3524 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>, &Self> {
|
3525 + | if let ConstrainedUnion::ConBList(val) = &self {
|
3526 + | ::std::result::Result::Ok(val)
|
3527 + | } else {
|
3528 + | ::std::result::Result::Err(self)
|
3529 + | }
|
3530 + | }
|
3531 + | /// Returns true if this is a [`ConBList`](crate::model::ConstrainedUnion::ConBList).
|
3532 + | pub fn is_con_b_list(&self) -> bool {
|
3533 + | self.as_con_b_list().is_ok()
|
3534 + | }
|
3535 + | /// Tries to convert the enum instance into [`ConBMap`](crate::model::ConstrainedUnion::ConBMap), extracting the inner [`HashMap`](::std::collections::HashMap).
|
3536 + | /// Returns `Err(&Self)` if it can't be converted.
|
3537 + | pub fn as_con_b_map(
|
3538 + | &self,
|
3539 + | ) -> ::std::result::Result<
|
3540 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3541 + | &Self,
|
3542 + | > {
|
3543 + | if let ConstrainedUnion::ConBMap(val) = &self {
|
3544 + | ::std::result::Result::Ok(val)
|
3545 + | } else {
|
3546 + | ::std::result::Result::Err(self)
|
3547 + | }
|
3548 + | }
|
3549 + | /// Returns true if this is a [`ConBMap`](crate::model::ConstrainedUnion::ConBMap).
|
3550 + | pub fn is_con_b_map(&self) -> bool {
|
3551 + | self.as_con_b_map().is_ok()
|
3552 + | }
|
3553 + | /// Tries to convert the enum instance into [`ConBSet`](crate::model::ConstrainedUnion::ConBSet), extracting the inner [`Vec`](::std::vec::Vec).
|
3554 + | /// Returns `Err(&Self)` if it can't be converted.
|
3555 + | pub fn as_con_b_set(
|
3556 + | &self,
|
3557 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::vec::Vec<::std::string::String>>, &Self>
|
3558 + | {
|
3559 + | if let ConstrainedUnion::ConBSet(val) = &self {
|
3560 + | ::std::result::Result::Ok(val)
|
3561 + | } else {
|
3562 + | ::std::result::Result::Err(self)
|
3563 + | }
|
3564 + | }
|
3565 + | /// Returns true if this is a [`ConBSet`](crate::model::ConstrainedUnion::ConBSet).
|
3566 + | pub fn is_con_b_set(&self) -> bool {
|
3567 + | self.as_con_b_set().is_ok()
|
3568 + | }
|
3569 + | /// Tries to convert the enum instance into [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure), extracting the inner [`ConB`](crate::model::ConB).
|
3570 + | /// Returns `Err(&Self)` if it can't be converted.
|
3571 + | pub fn as_constrained_structure(&self) -> ::std::result::Result<&crate::model::ConB, &Self> {
|
3572 + | if let ConstrainedUnion::ConstrainedStructure(val) = &self {
|
3573 + | ::std::result::Result::Ok(val)
|
3574 + | } else {
|
3575 + | ::std::result::Result::Err(self)
|
3576 + | }
|
3577 + | }
|
3578 + | /// Returns true if this is a [`ConstrainedStructure`](crate::model::ConstrainedUnion::ConstrainedStructure).
|
3579 + | pub fn is_constrained_structure(&self) -> bool {
|
3580 + | self.as_constrained_structure().is_ok()
|
3581 + | }
|
3582 + | /// Tries to convert the enum instance into [`EnumString`](crate::model::ConstrainedUnion::EnumString), extracting the inner [`EnumString`](crate::model::EnumString).
|
3583 + | /// Returns `Err(&Self)` if it can't be converted.
|
3584 + | pub fn as_enum_string(&self) -> ::std::result::Result<&crate::model::EnumString, &Self> {
|
3585 + | if let ConstrainedUnion::EnumString(val) = &self {
|
3586 + | ::std::result::Result::Ok(val)
|
3587 + | } else {
|
3588 + | ::std::result::Result::Err(self)
|
3589 + | }
|
3590 + | }
|
3591 + | /// Returns true if this is a [`EnumString`](crate::model::ConstrainedUnion::EnumString).
|
3592 + | pub fn is_enum_string(&self) -> bool {
|
3593 + | self.as_enum_string().is_ok()
|
3594 + | }
|
3595 + | /// Tries to convert the enum instance into [`LengthString`](crate::model::ConstrainedUnion::LengthString), extracting the inner [`String`](::std::string::String).
|
3596 + | /// Returns `Err(&Self)` if it can't be converted.
|
3597 + | pub fn as_length_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
3598 + | if let ConstrainedUnion::LengthString(val) = &self {
|
3599 + | ::std::result::Result::Ok(val)
|
3600 + | } else {
|
3601 + | ::std::result::Result::Err(self)
|
3602 + | }
|
3603 + | }
|
3604 + | /// Returns true if this is a [`LengthString`](crate::model::ConstrainedUnion::LengthString).
|
3605 + | pub fn is_length_string(&self) -> bool {
|
3606 + | self.as_length_string().is_ok()
|
3607 + | }
|
3608 + | }
|
3921 3609 |
|
3922 3610 | #[allow(missing_docs)] // documentation missing in model
|
3923 3611 | ///
|
3924 3612 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3925 - | /// [constraint traits]. Use [`MaxLengthString::try_from`] to construct values of this type.
|
3613 + | /// [constraint traits]. Use [`PatternString::try_from`] to construct values of this type.
|
3926 3614 | ///
|
3927 3615 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3928 3616 | ///
|
3929 3617 | #[derive(
|
3930 3618 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3931 3619 | )]
|
3932 - | pub(crate) struct MaxLengthString(pub(crate) ::std::string::String);
|
3620 + | pub(crate) struct PatternString(pub(crate) ::std::string::String);
|
3933 3621 | #[allow(dead_code)]
|
3934 - | impl MaxLengthString {
|
3622 + | impl PatternString {
|
3935 3623 | /// Extracts a string slice containing the entire underlying `String`.
|
3936 3624 | pub fn as_str(&self) -> &str {
|
3937 3625 | &self.0
|
3938 3626 | }
|
3939 3627 |
|
3940 3628 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
3941 3629 | pub fn inner(&self) -> &::std::string::String {
|
3942 3630 | &self.0
|
3943 3631 | }
|
3944 3632 |
|
3945 3633 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
3946 3634 | pub fn into_inner(self) -> ::std::string::String {
|
3947 3635 | self.0
|
3948 3636 | }
|
3949 3637 | }
|
3950 - | impl MaxLengthString {
|
3951 - | fn check_length(
|
3952 - | string: &str,
|
3953 - | ) -> ::std::result::Result<(), crate::model::max_length_string_internal::ConstraintViolation>
|
3954 - | {
|
3955 - | let length = string.chars().count();
|
3638 + | impl PatternString {
|
3639 + | fn check_pattern(
|
3640 + | string: ::std::string::String,
|
3641 + | ) -> ::std::result::Result<
|
3642 + | ::std::string::String,
|
3643 + | crate::model::pattern_string_internal::ConstraintViolation,
|
3644 + | > {
|
3645 + | let regex = Self::compile_regex();
|
3956 3646 |
|
3957 - | if length <= 69 {
|
3958 - | Ok(())
|
3647 + | if regex.is_match(&string) {
|
3648 + | Ok(string)
|
3959 3649 | } else {
|
3960 - | Err(crate::model::max_length_string_internal::ConstraintViolation::Length(length))
|
3650 + | Err(crate::model::pattern_string_internal::ConstraintViolation::Pattern(string))
|
3961 3651 | }
|
3962 3652 | }
|
3653 + |
|
3654 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
3655 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
3656 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
3657 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
3658 + | ::regex::Regex::new(r#"[a-d]{5}"#).expect(r#"The regular expression [a-d]{5} is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
3659 + | });
|
3660 + |
|
3661 + | ®EX
|
3662 + | }
|
3963 3663 | }
|
3964 - | impl ::std::convert::TryFrom<::std::string::String> for MaxLengthString {
|
3965 - | type Error = crate::model::max_length_string_internal::ConstraintViolation;
|
3664 + | impl ::std::convert::TryFrom<::std::string::String> for PatternString {
|
3665 + | type Error = crate::model::pattern_string_internal::ConstraintViolation;
|
3966 3666 |
|
3967 - | /// Constructs a `MaxLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3667 + | /// Constructs a `PatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3968 3668 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
3969 - | Self::check_length(&value)?;
|
3669 + | let value = Self::check_pattern(value)?;
|
3970 3670 |
|
3971 3671 | Ok(Self(value))
|
3972 3672 | }
|
3973 3673 | }
|
3974 - | impl crate::constrained::Constrained for MaxLengthString {
|
3674 + | impl crate::constrained::Constrained for PatternString {
|
3975 3675 | type Unconstrained = ::std::string::String;
|
3976 3676 | }
|
3977 3677 |
|
3978 3678 | impl ::std::convert::From<::std::string::String>
|
3979 - | for crate::constrained::MaybeConstrained<crate::model::MaxLengthString>
|
3679 + | for crate::constrained::MaybeConstrained<crate::model::PatternString>
|
3980 3680 | {
|
3981 3681 | fn from(value: ::std::string::String) -> Self {
|
3982 3682 | Self::Unconstrained(value)
|
3983 3683 | }
|
3984 3684 | }
|
3985 3685 |
|
3986 - | impl ::std::fmt::Display for MaxLengthString {
|
3686 + | impl ::std::fmt::Display for PatternString {
|
3987 3687 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3988 3688 | self.0.fmt(f)
|
3989 3689 | }
|
3990 3690 | }
|
3991 3691 |
|
3992 - | impl ::std::convert::From<MaxLengthString> for ::std::string::String {
|
3993 - | fn from(value: MaxLengthString) -> Self {
|
3692 + | impl ::std::convert::From<PatternString> for ::std::string::String {
|
3693 + | fn from(value: PatternString) -> Self {
|
3994 3694 | value.into_inner()
|
3995 3695 | }
|
3996 3696 | }
|
3997 3697 |
|
3998 - | #[allow(missing_docs)] // documentation missing in model
|
3999 - | ///
|
4000 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4001 - | /// [constraint traits]. Use [`MinLengthString::try_from`] to construct values of this type.
|
4002 - | ///
|
4003 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3698 + | #[cfg(test)]
|
3699 + | mod test_pattern_string {
|
3700 + | #[test]
|
3701 + | fn regex_compiles() {
|
3702 + | crate::model::PatternString::compile_regex();
|
3703 + | }
|
3704 + | }
|
3705 + |
|
3706 + | #[allow(missing_docs)] // documentation missing in model
|
3707 + | ///
|
3708 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3709 + | /// [constraint traits]. Use [`SetOfPatternString::try_from`] to construct values of this type.
|
3710 + | ///
|
3711 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4004 3712 | ///
|
4005 3713 | #[derive(
|
4006 3714 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4007 3715 | )]
|
4008 - | pub(crate) struct MinLengthString(pub(crate) ::std::string::String);
|
3716 + | pub(crate) struct SetOfPatternString(pub(crate) ::std::vec::Vec<crate::model::PatternString>);
|
3717 + | impl SetOfPatternString {
|
3718 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::PatternString>`].
|
3719 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::PatternString> {
|
3720 + | self.0
|
3721 + | }
|
3722 + |
|
3723 + | fn check_unique_items(
|
3724 + | items: ::std::vec::Vec<crate::model::PatternString>,
|
3725 + | ) -> ::std::result::Result<
|
3726 + | ::std::vec::Vec<crate::model::PatternString>,
|
3727 + | crate::model::set_of_pattern_string_internal::ConstraintViolation,
|
3728 + | > {
|
3729 + | let mut seen = ::std::collections::HashMap::new();
|
3730 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3731 + | for (idx, item) in items.iter().enumerate() {
|
3732 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3733 + | duplicate_indices.push(prev_idx);
|
3734 + | }
|
3735 + | }
|
3736 + |
|
3737 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3738 + | for idx in &duplicate_indices {
|
3739 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3740 + | last_duplicate_indices.push(prev_idx);
|
3741 + | }
|
3742 + | }
|
3743 + | duplicate_indices.extend(last_duplicate_indices);
|
3744 + |
|
3745 + | if !duplicate_indices.is_empty() {
|
3746 + | debug_assert!(duplicate_indices.len() >= 2);
|
3747 + | Err(
|
3748 + | crate::model::set_of_pattern_string_internal::ConstraintViolation::UniqueItems {
|
3749 + | duplicate_indices,
|
3750 + | original: items,
|
3751 + | },
|
3752 + | )
|
3753 + | } else {
|
3754 + | Ok(items)
|
3755 + | }
|
3756 + | }
|
3757 + | }
|
3758 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::PatternString>> for SetOfPatternString {
|
3759 + | type Error = crate::model::set_of_pattern_string_internal::ConstraintViolation;
|
3760 + |
|
3761 + | /// Constructs a `SetOfPatternString` from an [`::std::vec::Vec<crate::model::PatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
3762 + | fn try_from(
|
3763 + | value: ::std::vec::Vec<crate::model::PatternString>,
|
3764 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3765 + | let value = Self::check_unique_items(value)?;
|
3766 + |
|
3767 + | Ok(Self(value))
|
3768 + | }
|
3769 + | }
|
3770 + |
|
3771 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<crate::model::PatternString> {
|
3772 + | fn from(value: SetOfPatternString) -> Self {
|
3773 + | value.into_inner()
|
3774 + | }
|
3775 + | }
|
3776 + | impl ::std::convert::From<SetOfPatternString> for ::std::vec::Vec<::std::string::String> {
|
3777 + | fn from(value: SetOfPatternString) -> Self {
|
3778 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
3779 + | }
|
3780 + | }
|
3781 + | impl crate::constrained::Constrained for SetOfPatternString {
|
3782 + | type Unconstrained =
|
3783 + | crate::unconstrained::set_of_pattern_string_unconstrained::SetOfPatternStringUnconstrained;
|
3784 + | }
|
3785 + |
|
3786 + | #[allow(missing_docs)] // documentation missing in model
|
3787 + | ///
|
3788 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3789 + | /// [constraint traits]. Use [`LengthPatternString::try_from`] to construct values of this type.
|
3790 + | ///
|
3791 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3792 + | ///
|
3793 + | #[derive(
|
3794 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3795 + | )]
|
3796 + | pub(crate) struct LengthPatternString(pub(crate) ::std::string::String);
|
4009 3797 | #[allow(dead_code)]
|
4010 - | impl MinLengthString {
|
3798 + | impl LengthPatternString {
|
4011 3799 | /// Extracts a string slice containing the entire underlying `String`.
|
4012 3800 | pub fn as_str(&self) -> &str {
|
4013 3801 | &self.0
|
4014 3802 | }
|
4015 3803 |
|
4016 3804 | /// Returns an immutable reference to the underlying [`::std::string::String`].
|
4017 3805 | pub fn inner(&self) -> &::std::string::String {
|
4018 3806 | &self.0
|
4019 3807 | }
|
4020 3808 |
|
4021 3809 | /// Consumes the value, returning the underlying [`::std::string::String`].
|
4022 3810 | pub fn into_inner(self) -> ::std::string::String {
|
4023 3811 | self.0
|
4024 3812 | }
|
4025 3813 | }
|
4026 - | impl MinLengthString {
|
3814 + | impl LengthPatternString {
|
4027 3815 | fn check_length(
|
4028 3816 | string: &str,
|
4029 - | ) -> ::std::result::Result<(), crate::model::min_length_string_internal::ConstraintViolation>
|
3817 + | ) -> ::std::result::Result<(), crate::model::length_pattern_string_internal::ConstraintViolation>
|
4030 3818 | {
|
4031 3819 | let length = string.chars().count();
|
4032 3820 |
|
4033 - | if 2 <= length {
|
3821 + | if (5..=10).contains(&length) {
|
4034 3822 | Ok(())
|
4035 3823 | } else {
|
4036 - | Err(crate::model::min_length_string_internal::ConstraintViolation::Length(length))
|
3824 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Length(length))
|
3825 + | }
|
3826 + | }
|
3827 + |
|
3828 + | fn check_pattern(
|
3829 + | string: ::std::string::String,
|
3830 + | ) -> ::std::result::Result<
|
3831 + | ::std::string::String,
|
3832 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
3833 + | > {
|
3834 + | let regex = Self::compile_regex();
|
3835 + |
|
3836 + | if regex.is_match(&string) {
|
3837 + | Ok(string)
|
3838 + | } else {
|
3839 + | Err(crate::model::length_pattern_string_internal::ConstraintViolation::Pattern(string))
|
3840 + | }
|
4037 3841 | }
|
3842 + |
|
3843 + | /// Attempts to compile the regex for this constrained type's `@pattern`.
|
3844 + | /// This can fail if the specified regex is not supported by the `::regex` crate.
|
3845 + | pub fn compile_regex() -> &'static ::regex::Regex {
|
3846 + | static REGEX: std::sync::LazyLock<::regex::Regex> = std::sync::LazyLock::new(|| {
|
3847 + | ::regex::Regex::new(r#"[a-f0-5]*"#).expect(r#"The regular expression [a-f0-5]* is not supported by the `regex` crate; feel free to file an issue under https://github.com/smithy-lang/smithy-rs/issues for support"#)
|
3848 + | });
|
3849 + |
|
3850 + | ®EX
|
4038 3851 | }
|
4039 3852 | }
|
4040 - | impl ::std::convert::TryFrom<::std::string::String> for MinLengthString {
|
4041 - | type Error = crate::model::min_length_string_internal::ConstraintViolation;
|
3853 + | impl ::std::convert::TryFrom<::std::string::String> for LengthPatternString {
|
3854 + | type Error = crate::model::length_pattern_string_internal::ConstraintViolation;
|
4042 3855 |
|
4043 - | /// Constructs a `MinLengthString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
3856 + | /// Constructs a `LengthPatternString` from an [`::std::string::String`], failing when the provided value does not satisfy the modeled constraints.
|
4044 3857 | fn try_from(value: ::std::string::String) -> ::std::result::Result<Self, Self::Error> {
|
4045 3858 | Self::check_length(&value)?;
|
4046 3859 |
|
3860 + | let value = Self::check_pattern(value)?;
|
3861 + |
|
4047 3862 | Ok(Self(value))
|
4048 3863 | }
|
4049 3864 | }
|
4050 - | impl crate::constrained::Constrained for MinLengthString {
|
3865 + | impl crate::constrained::Constrained for LengthPatternString {
|
4051 3866 | type Unconstrained = ::std::string::String;
|
4052 3867 | }
|
4053 3868 |
|
4054 3869 | impl ::std::convert::From<::std::string::String>
|
4055 - | for crate::constrained::MaybeConstrained<crate::model::MinLengthString>
|
3870 + | for crate::constrained::MaybeConstrained<crate::model::LengthPatternString>
|
4056 3871 | {
|
4057 3872 | fn from(value: ::std::string::String) -> Self {
|
4058 3873 | Self::Unconstrained(value)
|
4059 3874 | }
|
4060 3875 | }
|
4061 3876 |
|
4062 - | impl ::std::fmt::Display for MinLengthString {
|
3877 + | impl ::std::fmt::Display for LengthPatternString {
|
4063 3878 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4064 3879 | self.0.fmt(f)
|
4065 3880 | }
|
4066 3881 | }
|
4067 3882 |
|
4068 - | impl ::std::convert::From<MinLengthString> for ::std::string::String {
|
4069 - | fn from(value: MinLengthString) -> Self {
|
3883 + | impl ::std::convert::From<LengthPatternString> for ::std::string::String {
|
3884 + | fn from(value: LengthPatternString) -> Self {
|
4070 3885 | value.into_inner()
|
4071 3886 | }
|
4072 3887 | }
|
4073 3888 |
|
3889 + | #[cfg(test)]
|
3890 + | mod test_length_pattern_string {
|
3891 + | #[test]
|
3892 + | fn regex_compiles() {
|
3893 + | crate::model::LengthPatternString::compile_regex();
|
3894 + | }
|
3895 + | }
|
3896 + |
|
4074 3897 | #[allow(missing_docs)] // documentation missing in model
|
3898 + | ///
|
3899 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
3900 + | /// [constraint traits]. Use [`SetOfLengthPatternString::try_from`] to construct values of this type.
|
3901 + | ///
|
3902 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
3903 + | ///
|
4075 3904 | #[derive(
|
4076 3905 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4077 3906 | )]
|
4078 - | pub enum ConstrainedUnionInOutput {
|
4079 - | #[allow(missing_docs)] // documentation missing in model
|
4080 - | Structure(crate::model::TransitivelyConstrainedStructureInOutput),
|
4081 - | }
|
4082 - | impl ConstrainedUnionInOutput {
|
4083 - | #[allow(irrefutable_let_patterns)]
|
4084 - | /// Tries to convert the enum instance into [`Structure`](crate::model::ConstrainedUnionInOutput::Structure), extracting the inner [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4085 - | /// Returns `Err(&Self)` if it can't be converted.
|
4086 - | pub fn as_structure(
|
4087 - | &self,
|
4088 - | ) -> ::std::result::Result<&crate::model::TransitivelyConstrainedStructureInOutput, &Self> {
|
4089 - | if let ConstrainedUnionInOutput::Structure(val) = &self {
|
4090 - | ::std::result::Result::Ok(val)
|
4091 - | } else {
|
4092 - | ::std::result::Result::Err(self)
|
3907 + | pub(crate) struct SetOfLengthPatternString(
|
3908 + | pub(crate) ::std::vec::Vec<crate::model::LengthPatternString>,
|
3909 + | );
|
3910 + | impl SetOfLengthPatternString {
|
3911 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::LengthPatternString>`].
|
3912 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::LengthPatternString> {
|
3913 + | self.0
|
3914 + | }
|
3915 + |
|
3916 + | fn check_unique_items(
|
3917 + | items: ::std::vec::Vec<crate::model::LengthPatternString>,
|
3918 + | ) -> ::std::result::Result<
|
3919 + | ::std::vec::Vec<crate::model::LengthPatternString>,
|
3920 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
3921 + | > {
|
3922 + | let mut seen = ::std::collections::HashMap::new();
|
3923 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
3924 + | for (idx, item) in items.iter().enumerate() {
|
3925 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
3926 + | duplicate_indices.push(prev_idx);
|
4093 3927 | }
|
4094 3928 | }
|
4095 - | /// Returns true if this is a [`Structure`](crate::model::ConstrainedUnionInOutput::Structure).
|
4096 - | pub fn is_structure(&self) -> bool {
|
4097 - | self.as_structure().is_ok()
|
3929 + |
|
3930 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
3931 + | for idx in &duplicate_indices {
|
3932 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
3933 + | last_duplicate_indices.push(prev_idx);
|
3934 + | }
|
3935 + | }
|
3936 + | duplicate_indices.extend(last_duplicate_indices);
|
3937 + |
|
3938 + | if !duplicate_indices.is_empty() {
|
3939 + | debug_assert!(duplicate_indices.len() >= 2);
|
3940 + | Err(crate::model::set_of_length_pattern_string_internal::ConstraintViolation::UniqueItems { duplicate_indices, original: items })
|
3941 + | } else {
|
3942 + | Ok(items)
|
3943 + | }
|
4098 3944 | }
|
4099 3945 | }
|
3946 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::LengthPatternString>>
|
3947 + | for SetOfLengthPatternString
|
3948 + | {
|
3949 + | type Error = crate::model::set_of_length_pattern_string_internal::ConstraintViolation;
|
4100 3950 |
|
4101 - | #[allow(missing_docs)] // documentation missing in model
|
4102 - | #[derive(
|
4103 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4104 - | )]
|
4105 - | pub struct TransitivelyConstrainedStructureInOutput {
|
4106 - | #[allow(missing_docs)] // documentation missing in model
|
4107 - | pub length_string: ::std::option::Option<::std::string::String>,
|
3951 + | /// Constructs a `SetOfLengthPatternString` from an [`::std::vec::Vec<crate::model::LengthPatternString>`], failing when the provided value does not satisfy the modeled constraints.
|
3952 + | fn try_from(
|
3953 + | value: ::std::vec::Vec<crate::model::LengthPatternString>,
|
3954 + | ) -> ::std::result::Result<Self, Self::Error> {
|
3955 + | let value = Self::check_unique_items(value)?;
|
3956 + |
|
3957 + | Ok(Self(value))
|
3958 + | }
|
4108 3959 | }
|
4109 - | impl TransitivelyConstrainedStructureInOutput {
|
4110 - | #[allow(missing_docs)] // documentation missing in model
|
4111 - | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
4112 - | self.length_string.as_deref()
|
3960 + |
|
3961 + | impl ::std::convert::From<SetOfLengthPatternString>
|
3962 + | for ::std::vec::Vec<crate::model::LengthPatternString>
|
3963 + | {
|
3964 + | fn from(value: SetOfLengthPatternString) -> Self {
|
3965 + | value.into_inner()
|
4113 3966 | }
|
4114 3967 | }
|
4115 - | impl TransitivelyConstrainedStructureInOutput {
|
4116 - | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4117 - | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4118 - | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
3968 + | impl ::std::convert::From<SetOfLengthPatternString> for ::std::vec::Vec<::std::string::String> {
|
3969 + | fn from(value: SetOfLengthPatternString) -> Self {
|
3970 + | value.into_inner().into_iter().map(|v| v.into()).collect()
|
4119 3971 | }
|
4120 3972 | }
|
3973 + | impl crate::constrained::Constrained for SetOfLengthPatternString {
|
3974 + | type Unconstrained = crate::unconstrained::set_of_length_pattern_string_unconstrained::SetOfLengthPatternStringUnconstrained;
|
3975 + | }
|
4121 3976 |
|
4122 - | #[allow(missing_docs)] // documentation missing in model
|
4123 - | ///
|
4124 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4125 - | /// [constraint traits]. Use [`ConstrainedMapInOutput::try_from`] to construct values of this type.
|
4126 - | ///
|
4127 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4128 - | ///
|
4129 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4130 - | pub(crate) struct ConstrainedMapInOutput(
|
4131 - | pub(crate) ::std::collections::HashMap<
|
4132 - | ::std::string::String,
|
4133 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4134 - | >,
|
4135 - | );
|
4136 - | impl ConstrainedMapInOutput {
|
4137 - | /// Consumes the value, returning the underlying [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`].
|
4138 - | pub fn into_inner(
|
4139 - | self,
|
4140 - | ) -> ::std::collections::HashMap<
|
4141 - | ::std::string::String,
|
4142 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4143 - | > {
|
4144 - | self.0
|
3977 + | /// Describes one specific validation failure for an input member.
|
3978 + | #[derive(
|
3979 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3980 + | )]
|
3981 + | pub struct ValidationExceptionField {
|
3982 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
3983 + | pub path: ::std::string::String,
|
3984 + | /// A detailed description of the validation failure.
|
3985 + | pub message: ::std::string::String,
|
3986 + | }
|
3987 + | impl ValidationExceptionField {
|
3988 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
3989 + | pub fn path(&self) -> &str {
|
3990 + | use std::ops::Deref;
|
3991 + | self.path.deref()
|
3992 + | }
|
3993 + | /// A detailed description of the validation failure.
|
3994 + | pub fn message(&self) -> &str {
|
3995 + | use std::ops::Deref;
|
3996 + | self.message.deref()
|
3997 + | }
|
3998 + | }
|
3999 + | impl ValidationExceptionField {
|
4000 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4001 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
4002 + | crate::model::validation_exception_field::Builder::default()
|
4145 4003 | }
|
4146 4004 | }
|
4147 - | impl
|
4148 - | ::std::convert::TryFrom<
|
4149 - | ::std::collections::HashMap<
|
4150 - | ::std::string::String,
|
4151 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4152 - | >,
|
4153 - | > for ConstrainedMapInOutput
|
4154 - | {
|
4155 - | type Error = crate::model::constrained_map_in_output_internal::ConstraintViolation;
|
4156 4005 |
|
4157 - | /// Constructs a `ConstrainedMapInOutput` from an [`::std::collections::HashMap<::std::string::String, crate::model::TransitivelyConstrainedStructureInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
4158 - | fn try_from(
|
4159 - | value: ::std::collections::HashMap<
|
4160 - | ::std::string::String,
|
4161 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4162 - | >,
|
4163 - | ) -> ::std::result::Result<Self, Self::Error> {
|
4164 - | let length = value.len();
|
4165 - | if 69 <= length {
|
4166 - | Ok(Self(value))
|
4167 - | } else {
|
4168 - | Err(
|
4169 - | crate::model::constrained_map_in_output_internal::ConstraintViolation::Length(
|
4170 - | length,
|
4171 - | ),
|
4172 - | )
|
4006 + | #[allow(missing_docs)] // documentation missing in model
|
4007 + | #[derive(
|
4008 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4009 + | )]
|
4010 + | pub struct TransitivelyConstrainedStructureInOutput {
|
4011 + | #[allow(missing_docs)] // documentation missing in model
|
4012 + | pub length_string: ::std::option::Option<::std::string::String>,
|
4013 + | }
|
4014 + | impl TransitivelyConstrainedStructureInOutput {
|
4015 + | #[allow(missing_docs)] // documentation missing in model
|
4016 + | pub fn length_string(&self) -> ::std::option::Option<&str> {
|
4017 + | self.length_string.as_deref()
|
4173 4018 | }
|
4019 + | }
|
4020 + | impl TransitivelyConstrainedStructureInOutput {
|
4021 + | /// Creates a new builder-style object to manufacture [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
4022 + | pub fn builder() -> crate::model::transitively_constrained_structure_in_output::Builder {
|
4023 + | crate::model::transitively_constrained_structure_in_output::Builder::default()
|
4174 4024 | }
|
4175 4025 | }
|
4176 4026 |
|
4177 - | impl ::std::convert::From<ConstrainedMapInOutput>
|
4178 - | for ::std::collections::HashMap<
|
4179 - | ::std::string::String,
|
4180 - | crate::model::TransitivelyConstrainedStructureInOutput,
|
4181 - | >
|
4182 - | {
|
4183 - | fn from(value: ConstrainedMapInOutput) -> Self {
|
4184 - | value.into_inner()
|
4027 + | #[allow(missing_docs)] // documentation missing in model
|
4028 + | #[derive(
|
4029 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4030 + | )]
|
4031 + | pub struct RecursiveShapesInputOutputNested2 {
|
4032 + | #[allow(missing_docs)] // documentation missing in model
|
4033 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4034 + | }
|
4035 + | impl RecursiveShapesInputOutputNested2 {
|
4036 + | #[allow(missing_docs)] // documentation missing in model
|
4037 + | pub fn recursive_member(
|
4038 + | &self,
|
4039 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
4040 + | self.recursive_member.as_ref()
|
4041 + | }
|
4042 + | }
|
4043 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
4044 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
4045 + | }
|
4046 + | impl RecursiveShapesInputOutputNested2 {
|
4047 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4048 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
4049 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
4050 + | }
|
4051 + | }
|
4052 + |
|
4053 + | #[allow(missing_docs)] // documentation missing in model
|
4054 + | #[derive(
|
4055 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4056 + | )]
|
4057 + | pub struct EventStreamRegularMessage {
|
4058 + | #[allow(missing_docs)] // documentation missing in model
|
4059 + | pub message_content: ::std::option::Option<::std::string::String>,
|
4060 + | }
|
4061 + | impl EventStreamRegularMessage {
|
4062 + | #[allow(missing_docs)] // documentation missing in model
|
4063 + | pub fn message_content(&self) -> ::std::option::Option<&str> {
|
4064 + | self.message_content.as_deref()
|
4065 + | }
|
4066 + | }
|
4067 + | impl crate::constrained::Constrained for crate::model::EventStreamRegularMessage {
|
4068 + | type Unconstrained = crate::model::event_stream_regular_message_internal::Builder;
|
4069 + | }
|
4070 + | impl EventStreamRegularMessage {
|
4071 + | /// Creates a new builder-style object to manufacture [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4072 + | pub fn builder() -> crate::model::event_stream_regular_message::Builder {
|
4073 + | crate::model::event_stream_regular_message::Builder::default()
|
4074 + | }
|
4075 + | }
|
4076 + |
|
4077 + | #[allow(missing_docs)] // documentation missing in model
|
4078 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::hash::Hash)]
|
4079 + | pub struct SensitiveStructure {}
|
4080 + | impl ::std::fmt::Debug for SensitiveStructure {
|
4081 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
4082 + | let mut formatter = f.debug_struct("SensitiveStructure");
|
4083 + | formatter.finish()
|
4084 + | }
|
4085 + | }
|
4086 + | impl crate::constrained::Constrained for crate::model::SensitiveStructure {
|
4087 + | type Unconstrained = crate::model::sensitive_structure_internal::Builder;
|
4088 + | }
|
4089 + | impl SensitiveStructure {
|
4090 + | /// Creates a new builder-style object to manufacture [`SensitiveStructure`](crate::model::SensitiveStructure).
|
4091 + | pub fn builder() -> crate::model::sensitive_structure::Builder {
|
4092 + | crate::model::sensitive_structure::Builder::default()
|
4185 4093 | }
|
4186 4094 | }
|
4187 4095 |
|
4188 4096 | #[allow(missing_docs)] // documentation missing in model
|
4189 4097 | ///
|
4190 4098 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4191 - | /// [constraint traits]. Use [`ConstrainedListInOutput::try_from`] to construct values of this type.
|
4099 + | /// [constraint traits]. Use [`ConBSetInner::try_from`] to construct values of this type.
|
4192 4100 | ///
|
4193 4101 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4194 4102 | ///
|
4195 4103 | #[derive(
|
4196 4104 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4197 4105 | )]
|
4198 - | pub(crate) struct ConstrainedListInOutput(
|
4199 - | pub(crate) ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4200 - | );
|
4201 - | impl ConstrainedListInOutput {
|
4202 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`].
|
4203 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::ConstrainedUnionInOutput> {
|
4106 + | pub(crate) struct ConBSetInner(pub(crate) ::std::vec::Vec<::std::string::String>);
|
4107 + | impl ConBSetInner {
|
4108 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
4109 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
4204 4110 | self.0
|
4205 4111 | }
|
4206 4112 |
|
4207 - | fn check_length(
|
4208 - | length: usize,
|
4113 + | fn check_unique_items(
|
4114 + | items: ::std::vec::Vec<::std::string::String>,
|
4209 4115 | ) -> ::std::result::Result<
|
4210 - | (),
|
4211 - | crate::model::constrained_list_in_output_internal::ConstraintViolation,
|
4116 + | ::std::vec::Vec<::std::string::String>,
|
4117 + | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
4212 4118 | > {
|
4213 - | if 69 <= length {
|
4214 - | Ok(())
|
4215 - | } else {
|
4119 + | let mut seen = ::std::collections::HashMap::new();
|
4120 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4121 + | for (idx, item) in items.iter().enumerate() {
|
4122 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4123 + | duplicate_indices.push(prev_idx);
|
4124 + | }
|
4125 + | }
|
4126 + |
|
4127 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4128 + | for idx in &duplicate_indices {
|
4129 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4130 + | last_duplicate_indices.push(prev_idx);
|
4131 + | }
|
4132 + | }
|
4133 + | duplicate_indices.extend(last_duplicate_indices);
|
4134 + |
|
4135 + | if !duplicate_indices.is_empty() {
|
4136 + | debug_assert!(duplicate_indices.len() >= 2);
|
4216 4137 | Err(
|
4217 - | crate::model::constrained_list_in_output_internal::ConstraintViolation::Length(
|
4218 - | length,
|
4219 - | ),
|
4138 + | crate::model::con_b_set_inner_internal::ConstraintViolation::UniqueItems {
|
4139 + | duplicate_indices,
|
4140 + | original: items,
|
4141 + | },
|
4220 4142 | )
|
4143 + | } else {
|
4144 + | Ok(items)
|
4221 4145 | }
|
4222 4146 | }
|
4223 4147 | }
|
4224 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::ConstrainedUnionInOutput>>
|
4225 - | for ConstrainedListInOutput
|
4226 - | {
|
4227 - | type Error = crate::model::constrained_list_in_output_internal::ConstraintViolation;
|
4148 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for ConBSetInner {
|
4149 + | type Error = crate::model::con_b_set_inner_internal::ConstraintViolation;
|
4228 4150 |
|
4229 - | /// Constructs a `ConstrainedListInOutput` from an [`::std::vec::Vec<crate::model::ConstrainedUnionInOutput>`], failing when the provided value does not satisfy the modeled constraints.
|
4151 + | /// Constructs a `ConBSetInner` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
4230 4152 | fn try_from(
|
4231 - | value: ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>,
|
4153 + | value: ::std::vec::Vec<::std::string::String>,
|
4232 4154 | ) -> ::std::result::Result<Self, Self::Error> {
|
4233 - | Self::check_length(value.len())?;
|
4155 + | let value = Self::check_unique_items(value)?;
|
4234 4156 |
|
4235 4157 | Ok(Self(value))
|
4236 4158 | }
|
4237 4159 | }
|
4238 4160 |
|
4239 - | impl ::std::convert::From<ConstrainedListInOutput>
|
4240 - | for ::std::vec::Vec<crate::model::ConstrainedUnionInOutput>
|
4241 - | {
|
4242 - | fn from(value: ConstrainedListInOutput) -> Self {
|
4161 + | impl ::std::convert::From<ConBSetInner> for ::std::vec::Vec<::std::string::String> {
|
4162 + | fn from(value: ConBSetInner) -> Self {
|
4243 4163 | value.into_inner()
|
4244 4164 | }
|
4245 4165 | }
|
4166 + | impl crate::constrained::Constrained for ConBSetInner {
|
4167 + | type Unconstrained =
|
4168 + | crate::unconstrained::con_b_set_inner_unconstrained::ConBSetInnerUnconstrained;
|
4169 + | }
|
4246 4170 |
|
4247 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4248 - | pub mod validation_exception_field {
|
4171 + | #[allow(missing_docs)] // documentation missing in model
|
4172 + | ///
|
4173 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
4174 + | /// [constraint traits]. Use [`UniqueItemsList::try_from`] to construct values of this type.
|
4175 + | ///
|
4176 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
4177 + | ///
|
4178 + | #[derive(
|
4179 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
4180 + | )]
|
4181 + | pub(crate) struct UniqueItemsList(pub(crate) ::std::vec::Vec<::std::string::String>);
|
4182 + | impl UniqueItemsList {
|
4183 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
4184 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
4185 + | self.0
|
4186 + | }
|
4249 4187 |
|
4250 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4251 - | /// Holds one variant for each of the ways the builder can fail.
|
4252 - | #[allow(clippy::enum_variant_names)]
|
4253 - | pub enum ConstraintViolation {
|
4254 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
4255 - | MissingPath,
|
4256 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
4257 - | MissingMessage,
|
4258 - | }
|
4259 - | impl ::std::fmt::Display for ConstraintViolation {
|
4260 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4261 - | match self {
|
4262 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
4263 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4264 - | }
|
4188 + | fn check_unique_items(
|
4189 + | items: ::std::vec::Vec<::std::string::String>,
|
4190 + | ) -> ::std::result::Result<
|
4191 + | ::std::vec::Vec<::std::string::String>,
|
4192 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
4193 + | > {
|
4194 + | let mut seen = ::std::collections::HashMap::new();
|
4195 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
4196 + | for (idx, item) in items.iter().enumerate() {
|
4197 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
4198 + | duplicate_indices.push(prev_idx);
|
4265 4199 | }
|
4266 4200 | }
|
4267 - | impl ::std::error::Error for ConstraintViolation {}
|
4268 - | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
4269 - | type Error = ConstraintViolation;
|
4270 4201 |
|
4271 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4272 - | builder.build()
|
4273 - | }
|
4274 - | }
|
4275 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4276 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4277 - | pub struct Builder {
|
4278 - | pub(crate) path: ::std::option::Option<::std::string::String>,
|
4279 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
4280 - | }
|
4281 - | impl Builder {
|
4282 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
4283 - | pub fn path(mut self, input: ::std::string::String) -> Self {
|
4284 - | self.path = Some(input);
|
4285 - | self
|
4286 - | }
|
4287 - | /// A detailed description of the validation failure.
|
4288 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
4289 - | self.message = Some(input);
|
4290 - | self
|
4202 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
4203 + | for idx in &duplicate_indices {
|
4204 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
4205 + | last_duplicate_indices.push(prev_idx);
|
4291 4206 | }
|
4292 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4293 - | ///
|
4294 - | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
4295 - | ///
|
4296 - | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4297 - | self.build_enforcing_required_and_enum_traits()
|
4298 4207 | }
|
4299 - | fn build_enforcing_required_and_enum_traits(
|
4300 - | self,
|
4301 - | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
4302 - | Ok(crate::model::ValidationExceptionField {
|
4303 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
4304 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
4305 - | })
|
4208 + | duplicate_indices.extend(last_duplicate_indices);
|
4209 + |
|
4210 + | if !duplicate_indices.is_empty() {
|
4211 + | debug_assert!(duplicate_indices.len() >= 2);
|
4212 + | Err(
|
4213 + | crate::model::unique_items_list_internal::ConstraintViolation::UniqueItems {
|
4214 + | duplicate_indices,
|
4215 + | original: items,
|
4216 + | },
|
4217 + | )
|
4218 + | } else {
|
4219 + | Ok(items)
|
4306 4220 | }
|
4307 4221 | }
|
4308 4222 | }
|
4309 - | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4310 - | pub(crate) mod event_stream_regular_message_internal {
|
4223 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for UniqueItemsList {
|
4224 + | type Error = crate::model::unique_items_list_internal::ConstraintViolation;
|
4311 4225 |
|
4312 - | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
4313 - | fn from(builder: Builder) -> Self {
|
4314 - | builder.build()
|
4315 - | }
|
4316 - | }
|
4317 - | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4318 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4319 - | pub(crate) struct Builder {
|
4320 - | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
4321 - | }
|
4322 - | impl Builder {
|
4323 - | #[allow(missing_docs)] // documentation missing in model
|
4324 - | pub(crate) fn set_message_content(
|
4325 - | mut self,
|
4326 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4327 - | ) -> Self {
|
4328 - | self.message_content = input.map(|v| v.into());
|
4329 - | self
|
4330 - | }
|
4331 - | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4332 - | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
4333 - | self.build_enforcing_all_constraints()
|
4334 - | }
|
4335 - | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
4336 - | crate::model::EventStreamRegularMessage {
|
4337 - | message_content: self.message_content,
|
4338 - | }
|
4339 - | }
|
4226 + | /// Constructs a `UniqueItemsList` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
4227 + | fn try_from(
|
4228 + | value: ::std::vec::Vec<::std::string::String>,
|
4229 + | ) -> ::std::result::Result<Self, Self::Error> {
|
4230 + | let value = Self::check_unique_items(value)?;
|
4231 + |
|
4232 + | Ok(Self(value))
|
4340 4233 | }
|
4341 4234 | }
|
4342 - | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4343 - | pub mod event_stream_regular_message {
|
4344 4235 |
|
4345 - | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
4346 - | fn from(builder: Builder) -> Self {
|
4347 - | builder.build()
|
4348 - | }
|
4349 - | }
|
4350 - | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4351 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4352 - | pub struct Builder {
|
4353 - | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
4354 - | }
|
4355 - | impl Builder {
|
4356 - | #[allow(missing_docs)] // documentation missing in model
|
4357 - | pub fn message_content(
|
4358 - | mut self,
|
4359 - | input: ::std::option::Option<::std::string::String>,
|
4360 - | ) -> Self {
|
4361 - | self.message_content = input;
|
4362 - | self
|
4363 - | }
|
4364 - | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
4365 - | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
4366 - | self.build_enforcing_required_and_enum_traits()
|
4367 - | }
|
4368 - | fn build_enforcing_required_and_enum_traits(
|
4369 - | self,
|
4370 - | ) -> crate::model::EventStreamRegularMessage {
|
4371 - | crate::model::EventStreamRegularMessage {
|
4372 - | message_content: self.message_content,
|
4373 - | }
|
4374 - | }
|
4236 + | impl ::std::convert::From<UniqueItemsList> for ::std::vec::Vec<::std::string::String> {
|
4237 + | fn from(value: UniqueItemsList) -> Self {
|
4238 + | value.into_inner()
|
4375 4239 | }
|
4376 4240 | }
|
4377 - | pub(crate) mod map_of_enum_string_internal {
|
4241 + | impl crate::constrained::Constrained for UniqueItemsList {
|
4242 + | type Unconstrained =
|
4243 + | crate::unconstrained::unique_items_list_unconstrained::UniqueItemsListUnconstrained;
|
4244 + | }
|
4245 + |
|
4246 + | /// See [`ConA`](crate::model::ConA).
|
4247 + | pub(crate) mod con_a_internal {
|
4378 4248 |
|
4249 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4250 + | /// Holds one variant for each of the ways the builder can fail.
|
4251 + | #[non_exhaustive]
|
4379 4252 | #[allow(clippy::enum_variant_names)]
|
4380 - | #[derive(Debug, PartialEq)]
|
4381 4253 | pub(crate) enum ConstraintViolation {
|
4254 + | /// `con_b` was not provided but it is required when building `ConA`.
|
4255 + | MissingConB,
|
4256 + | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
4382 4257 | #[doc(hidden)]
|
4383 - | Key(crate::model::enum_string_internal::ConstraintViolation),
|
4258 + | ConB(crate::model::con_b_internal::ConstraintViolation),
|
4259 + | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
4384 4260 | #[doc(hidden)]
|
4385 - | Value(
|
4386 - | crate::model::EnumString,
|
4387 - | crate::model::enum_string_internal::ConstraintViolation,
|
4388 - | ),
|
4389 - | }
|
4390 - |
|
4391 - | impl ::std::fmt::Display for ConstraintViolation {
|
4392 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4393 - | match self {
|
4394 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4395 - | Self::Value(_, value_constraint_violation) => {
|
4396 - | write!(f, "{}", value_constraint_violation)
|
4397 - | }
|
4398 - | }
|
4399 - | }
|
4400 - | }
|
4401 - |
|
4402 - | impl ::std::error::Error for ConstraintViolation {}
|
4403 - | impl ConstraintViolation {
|
4404 - | pub(crate) fn as_validation_exception_field(
|
4405 - | self,
|
4406 - | path: ::std::string::String,
|
4407 - | ) -> crate::model::ValidationExceptionField {
|
4408 - | match self {
|
4409 - | Self::Key(key_constraint_violation) => {
|
4410 - | key_constraint_violation.as_validation_exception_field(path)
|
4411 - | }
|
4412 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4413 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4414 - | }
|
4415 - | }
|
4416 - | }
|
4417 - | }
|
4418 - | pub(crate) mod con_b_map_internal {
|
4419 - |
|
4420 - | #[allow(clippy::enum_variant_names)]
|
4421 - | #[derive(Debug, PartialEq)]
|
4422 - | pub(crate) enum ConstraintViolation {
|
4423 - | Length(usize),
|
4424 - |
|
4261 + | OptConB(crate::model::con_b_internal::ConstraintViolation),
|
4262 + | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
4425 4263 | #[doc(hidden)]
|
4426 - | Value(
|
4427 - | ::std::string::String,
|
4428 - | crate::model::length_string_internal::ConstraintViolation,
|
4429 - | ),
|
4430 - | }
|
4431 - |
|
4432 - | impl ::std::fmt::Display for ConstraintViolation {
|
4433 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4434 - | match self {
|
4435 - | Self::Length(length) => {
|
4436 - | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConBMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
4437 - | }
|
4438 - |
|
4439 - | Self::Value(_, value_constraint_violation) => {
|
4440 - | write!(f, "{}", value_constraint_violation)
|
4441 - | }
|
4442 - | }
|
4443 - | }
|
4444 - | }
|
4445 - |
|
4446 - | impl ::std::error::Error for ConstraintViolation {}
|
4447 - | impl ConstraintViolation {
|
4448 - | pub(crate) fn as_validation_exception_field(
|
4449 - | self,
|
4450 - | path: ::std::string::String,
|
4451 - | ) -> crate::model::ValidationExceptionField {
|
4452 - | match self {
|
4453 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4454 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
4455 - | path,
|
4456 - | },
|
4457 - | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
4458 - | }
|
4459 - | }
|
4460 - | }
|
4461 - | }
|
4462 - | pub(crate) mod length_string_internal {
|
4463 - |
|
4464 - | #[derive(Debug, PartialEq)]
|
4465 - | pub enum ConstraintViolation {
|
4466 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
4467 - | Length(usize),
|
4468 - | }
|
4469 - |
|
4470 - | impl ::std::fmt::Display for ConstraintViolation {
|
4471 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4472 - | let message = match self {
|
4473 - | Self::Length(length) => {
|
4474 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
4475 - | }
|
4476 - | };
|
4477 - | write!(f, "{message}")
|
4478 - | }
|
4479 - | }
|
4480 - |
|
4481 - | impl ::std::error::Error for ConstraintViolation {}
|
4482 - | impl ConstraintViolation {
|
4483 - | pub(crate) fn as_validation_exception_field(
|
4484 - | self,
|
4485 - | path: ::std::string::String,
|
4486 - | ) -> crate::model::ValidationExceptionField {
|
4487 - | match self {
|
4488 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4489 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
4490 - | path,
|
4491 - | },
|
4492 - | }
|
4493 - | }
|
4494 - | }
|
4495 - | }
|
4496 - | pub(crate) mod map_of_list_of_length_pattern_string_internal {
|
4497 - |
|
4498 - | #[allow(clippy::enum_variant_names)]
|
4499 - | #[derive(Debug, PartialEq)]
|
4500 - | pub(crate) enum ConstraintViolation {
|
4264 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
4265 + | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
4501 4266 | #[doc(hidden)]
|
4502 - | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
4267 + | MinLengthString(crate::model::min_length_string_internal::ConstraintViolation),
|
4268 + | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
4503 4269 | #[doc(hidden)]
|
4504 - | Value(
|
4505 - | crate::model::LengthPatternString,
|
4506 - | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
4507 - | ),
|
4508 - | }
|
4509 - |
|
4510 - | impl ::std::fmt::Display for ConstraintViolation {
|
4511 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4512 - | match self {
|
4513 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4514 - | Self::Value(_, value_constraint_violation) => {
|
4515 - | write!(f, "{}", value_constraint_violation)
|
4516 - | }
|
4517 - | }
|
4518 - | }
|
4519 - | }
|
4520 - |
|
4521 - | impl ::std::error::Error for ConstraintViolation {}
|
4522 - | impl ConstraintViolation {
|
4523 - | pub(crate) fn as_validation_exception_field(
|
4524 - | self,
|
4525 - | path: ::std::string::String,
|
4526 - | ) -> crate::model::ValidationExceptionField {
|
4527 - | match self {
|
4528 - | Self::Key(key_constraint_violation) => {
|
4529 - | key_constraint_violation.as_validation_exception_field(path)
|
4530 - | }
|
4531 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4532 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4533 - | }
|
4534 - | }
|
4535 - | }
|
4536 - | }
|
4537 - | pub(crate) mod list_of_length_pattern_string_internal {
|
4538 - |
|
4539 - | #[allow(clippy::enum_variant_names)]
|
4540 - | #[derive(Debug, PartialEq)]
|
4541 - | pub(crate) enum ConstraintViolation {
|
4542 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4543 - | /// The first component of the tuple is the index in the collection where the
|
4544 - | /// first constraint violation was found.
|
4270 + | MaxLengthString(crate::model::max_length_string_internal::ConstraintViolation),
|
4271 + | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
4545 4272 | #[doc(hidden)]
|
4546 - | Member(
|
4547 - | usize,
|
4548 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4549 - | ),
|
4550 - | }
|
4551 - |
|
4552 - | impl ::std::fmt::Display for ConstraintViolation {
|
4553 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4554 - | let message = match self {
|
4555 - | Self::Member(index, failing_member) => format!(
|
4556 - | "Value at index {index} failed to satisfy constraint. {}",
|
4557 - | failing_member
|
4558 - | ),
|
4559 - | };
|
4560 - | write!(f, "{message}")
|
4561 - | }
|
4562 - | }
|
4563 - |
|
4564 - | impl ::std::error::Error for ConstraintViolation {}
|
4565 - | impl ConstraintViolation {
|
4566 - | pub(crate) fn as_validation_exception_field(
|
4567 - | self,
|
4568 - | path: ::std::string::String,
|
4569 - | ) -> crate::model::ValidationExceptionField {
|
4570 - | match self {
|
4571 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4572 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4573 - | }
|
4574 - | }
|
4575 - | }
|
4576 - | }
|
4577 - | pub(crate) mod length_pattern_string_internal {
|
4578 - |
|
4579 - | #[derive(Debug, PartialEq)]
|
4580 - | pub enum ConstraintViolation {
|
4581 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
4582 - | Length(usize),
|
4583 - | /// Error when a string doesn't satisfy its `@pattern`.
|
4584 - | /// Contains the String that failed the pattern.
|
4585 - | Pattern(String),
|
4586 - | }
|
4587 - |
|
4588 - | impl ::std::fmt::Display for ConstraintViolation {
|
4589 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4590 - | let message = match self {
|
4591 - | Self::Length(length) => {
|
4592 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
4593 - | }
|
4594 - | Self::Pattern(_) => {
|
4595 - | format!(
|
4596 - | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4597 - | r#"[a-f0-5]*"#
|
4598 - | )
|
4599 - | }
|
4600 - | };
|
4601 - | write!(f, "{message}")
|
4602 - | }
|
4603 - | }
|
4604 - |
|
4605 - | impl ::std::error::Error for ConstraintViolation {}
|
4606 - | impl ConstraintViolation {
|
4607 - | pub(crate) fn as_validation_exception_field(
|
4608 - | self,
|
4609 - | path: ::std::string::String,
|
4610 - | ) -> crate::model::ValidationExceptionField {
|
4611 - | match self {
|
4612 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4613 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
4614 - | path,
|
4615 - | },
|
4616 - |
|
4617 - | #[allow(unused_variables)]
|
4618 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4619 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
4620 - | path
|
4621 - | },
|
4622 - | }
|
4623 - | }
|
4624 - | }
|
4625 - | }
|
4626 - | pub(crate) mod map_of_length_pattern_string_internal {
|
4627 - |
|
4628 - | #[allow(clippy::enum_variant_names)]
|
4629 - | #[derive(Debug, PartialEq)]
|
4630 - | pub(crate) enum ConstraintViolation {
|
4273 + | FixedLengthString(crate::model::fixed_length_string_internal::ConstraintViolation),
|
4274 + | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
4631 4275 | #[doc(hidden)]
|
4632 - | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
4276 + | LengthBlob(crate::model::length_blob_internal::ConstraintViolation),
|
4277 + | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
4633 4278 | #[doc(hidden)]
|
4634 - | Value(
|
4635 - | crate::model::LengthPatternString,
|
4636 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4637 - | ),
|
4638 - | }
|
4639 - |
|
4640 - | impl ::std::fmt::Display for ConstraintViolation {
|
4641 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4642 - | match self {
|
4643 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4644 - | Self::Value(_, value_constraint_violation) => {
|
4645 - | write!(f, "{}", value_constraint_violation)
|
4646 - | }
|
4647 - | }
|
4648 - | }
|
4649 - | }
|
4650 - |
|
4651 - | impl ::std::error::Error for ConstraintViolation {}
|
4652 - | impl ConstraintViolation {
|
4653 - | pub(crate) fn as_validation_exception_field(
|
4654 - | self,
|
4655 - | path: ::std::string::String,
|
4656 - | ) -> crate::model::ValidationExceptionField {
|
4657 - | match self {
|
4658 - | Self::Key(key_constraint_violation) => {
|
4659 - | key_constraint_violation.as_validation_exception_field(path)
|
4660 - | }
|
4661 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4662 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4663 - | }
|
4664 - | }
|
4665 - | }
|
4666 - | }
|
4667 - | pub(crate) mod map_of_list_of_pattern_string_internal {
|
4668 - |
|
4669 - | #[allow(clippy::enum_variant_names)]
|
4670 - | #[derive(Debug, PartialEq)]
|
4671 - | pub(crate) enum ConstraintViolation {
|
4279 + | MinLengthBlob(crate::model::min_length_blob_internal::ConstraintViolation),
|
4280 + | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
4672 4281 | #[doc(hidden)]
|
4673 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4282 + | MaxLengthBlob(crate::model::max_length_blob_internal::ConstraintViolation),
|
4283 + | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
4674 4284 | #[doc(hidden)]
|
4675 - | Value(
|
4676 - | crate::model::PatternString,
|
4677 - | crate::model::list_of_pattern_string_internal::ConstraintViolation,
|
4678 - | ),
|
4679 - | }
|
4680 - |
|
4681 - | impl ::std::fmt::Display for ConstraintViolation {
|
4682 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4683 - | match self {
|
4684 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4685 - | Self::Value(_, value_constraint_violation) => {
|
4686 - | write!(f, "{}", value_constraint_violation)
|
4687 - | }
|
4688 - | }
|
4689 - | }
|
4690 - | }
|
4691 - |
|
4692 - | impl ::std::error::Error for ConstraintViolation {}
|
4693 - | impl ConstraintViolation {
|
4694 - | pub(crate) fn as_validation_exception_field(
|
4695 - | self,
|
4696 - | path: ::std::string::String,
|
4697 - | ) -> crate::model::ValidationExceptionField {
|
4698 - | match self {
|
4699 - | Self::Key(key_constraint_violation) => {
|
4700 - | key_constraint_violation.as_validation_exception_field(path)
|
4701 - | }
|
4702 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4703 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4704 - | }
|
4705 - | }
|
4706 - | }
|
4707 - | }
|
4708 - | pub(crate) mod list_of_pattern_string_internal {
|
4709 - |
|
4710 - | #[allow(clippy::enum_variant_names)]
|
4711 - | #[derive(Debug, PartialEq)]
|
4712 - | pub(crate) enum ConstraintViolation {
|
4713 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4714 - | /// The first component of the tuple is the index in the collection where the
|
4715 - | /// first constraint violation was found.
|
4285 + | FixedLengthBlob(crate::model::fixed_length_blob_internal::ConstraintViolation),
|
4286 + | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
4716 4287 | #[doc(hidden)]
|
4717 - | Member(
|
4718 - | usize,
|
4719 - | crate::model::pattern_string_internal::ConstraintViolation,
|
4288 + | RangeInteger(crate::model::range_integer_internal::ConstraintViolation),
|
4289 + | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
4290 + | #[doc(hidden)]
|
4291 + | MinRangeInteger(crate::model::min_range_integer_internal::ConstraintViolation),
|
4292 + | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
4293 + | #[doc(hidden)]
|
4294 + | MaxRangeInteger(crate::model::max_range_integer_internal::ConstraintViolation),
|
4295 + | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
4296 + | #[doc(hidden)]
|
4297 + | FixedValueInteger(crate::model::fixed_value_integer_internal::ConstraintViolation),
|
4298 + | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
4299 + | #[doc(hidden)]
|
4300 + | RangeShort(crate::model::range_short_internal::ConstraintViolation),
|
4301 + | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
4302 + | #[doc(hidden)]
|
4303 + | MinRangeShort(crate::model::min_range_short_internal::ConstraintViolation),
|
4304 + | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
4305 + | #[doc(hidden)]
|
4306 + | MaxRangeShort(crate::model::max_range_short_internal::ConstraintViolation),
|
4307 + | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
4308 + | #[doc(hidden)]
|
4309 + | FixedValueShort(crate::model::fixed_value_short_internal::ConstraintViolation),
|
4310 + | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
4311 + | #[doc(hidden)]
|
4312 + | RangeLong(crate::model::range_long_internal::ConstraintViolation),
|
4313 + | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
4314 + | #[doc(hidden)]
|
4315 + | MinRangeLong(crate::model::min_range_long_internal::ConstraintViolation),
|
4316 + | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
4317 + | #[doc(hidden)]
|
4318 + | MaxRangeLong(crate::model::max_range_long_internal::ConstraintViolation),
|
4319 + | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
4320 + | #[doc(hidden)]
|
4321 + | FixedValueLong(crate::model::fixed_value_long_internal::ConstraintViolation),
|
4322 + | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
4323 + | #[doc(hidden)]
|
4324 + | RangeByte(crate::model::range_byte_internal::ConstraintViolation),
|
4325 + | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
4326 + | #[doc(hidden)]
|
4327 + | MinRangeByte(crate::model::min_range_byte_internal::ConstraintViolation),
|
4328 + | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
4329 + | #[doc(hidden)]
|
4330 + | MaxRangeByte(crate::model::max_range_byte_internal::ConstraintViolation),
|
4331 + | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
4332 + | #[doc(hidden)]
|
4333 + | FixedValueByte(crate::model::fixed_value_byte_internal::ConstraintViolation),
|
4334 + | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
4335 + | #[doc(hidden)]
|
4336 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
4337 + | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
4338 + | #[doc(hidden)]
|
4339 + | LengthList(crate::model::length_list_internal::ConstraintViolation),
|
4340 + | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
4341 + | #[doc(hidden)]
|
4342 + | SensitiveLengthList(crate::model::sensitive_length_list_internal::ConstraintViolation),
|
4343 + | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
4344 + | #[doc(hidden)]
|
4345 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
4346 + | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
4347 + | #[doc(hidden)]
|
4348 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
4349 + | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
4350 + | #[doc(hidden)]
|
4351 + | LengthMap(crate::model::length_map_internal::ConstraintViolation),
|
4352 + | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
4353 + | #[doc(hidden)]
|
4354 + | MapOfMapOfListOfListOfConB(
|
4355 + | crate::model::map_of_map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
4720 4356 | ),
|
4721 - | }
|
4722 - |
|
4723 - | impl ::std::fmt::Display for ConstraintViolation {
|
4724 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4725 - | let message = match self {
|
4726 - | Self::Member(index, failing_member) => format!(
|
4727 - | "Value at index {index} failed to satisfy constraint. {}",
|
4728 - | failing_member
|
4357 + | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
4358 + | #[doc(hidden)]
|
4359 + | SparseMap(crate::model::sparse_map_internal::ConstraintViolation),
|
4360 + | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
4361 + | #[doc(hidden)]
|
4362 + | SparseList(crate::model::sparse_list_internal::ConstraintViolation),
|
4363 + | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
4364 + | #[doc(hidden)]
|
4365 + | SparseLengthMap(crate::model::sparse_length_map_internal::ConstraintViolation),
|
4366 + | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
4367 + | #[doc(hidden)]
|
4368 + | SparseLengthList(crate::model::sparse_length_list_internal::ConstraintViolation),
|
4369 + | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
4370 + | #[doc(hidden)]
|
4371 + | ConstrainedUnion(crate::model::constrained_union_internal::ConstraintViolation),
|
4372 + | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
4373 + | #[doc(hidden)]
|
4374 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
4375 + | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
4376 + | #[doc(hidden)]
|
4377 + | ListOfLengthString(crate::model::list_of_length_string_internal::ConstraintViolation),
|
4378 + | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
4379 + | #[doc(hidden)]
|
4380 + | SetOfLengthString(crate::model::set_of_length_string_internal::ConstraintViolation),
|
4381 + | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
4382 + | #[doc(hidden)]
|
4383 + | MapOfLengthString(crate::model::map_of_length_string_internal::ConstraintViolation),
|
4384 + | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
4385 + | #[doc(hidden)]
|
4386 + | ListOfLengthBlob(crate::model::list_of_length_blob_internal::ConstraintViolation),
|
4387 + | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
4388 + | #[doc(hidden)]
|
4389 + | MapOfLengthBlob(crate::model::map_of_length_blob_internal::ConstraintViolation),
|
4390 + | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
4391 + | #[doc(hidden)]
|
4392 + | ListOfRangeInteger(crate::model::list_of_range_integer_internal::ConstraintViolation),
|
4393 + | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
4394 + | #[doc(hidden)]
|
4395 + | SetOfRangeInteger(crate::model::set_of_range_integer_internal::ConstraintViolation),
|
4396 + | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
4397 + | #[doc(hidden)]
|
4398 + | MapOfRangeInteger(crate::model::map_of_range_integer_internal::ConstraintViolation),
|
4399 + | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
4400 + | #[doc(hidden)]
|
4401 + | ListOfRangeShort(crate::model::list_of_range_short_internal::ConstraintViolation),
|
4402 + | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
4403 + | #[doc(hidden)]
|
4404 + | SetOfRangeShort(crate::model::set_of_range_short_internal::ConstraintViolation),
|
4405 + | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
4406 + | #[doc(hidden)]
|
4407 + | MapOfRangeShort(crate::model::map_of_range_short_internal::ConstraintViolation),
|
4408 + | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
4409 + | #[doc(hidden)]
|
4410 + | ListOfRangeLong(crate::model::list_of_range_long_internal::ConstraintViolation),
|
4411 + | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
4412 + | #[doc(hidden)]
|
4413 + | SetOfRangeLong(crate::model::set_of_range_long_internal::ConstraintViolation),
|
4414 + | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
4415 + | #[doc(hidden)]
|
4416 + | MapOfRangeLong(crate::model::map_of_range_long_internal::ConstraintViolation),
|
4417 + | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
4418 + | #[doc(hidden)]
|
4419 + | ListOfRangeByte(crate::model::list_of_range_byte_internal::ConstraintViolation),
|
4420 + | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
4421 + | #[doc(hidden)]
|
4422 + | SetOfRangeByte(crate::model::set_of_range_byte_internal::ConstraintViolation),
|
4423 + | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
4424 + | #[doc(hidden)]
|
4425 + | MapOfRangeByte(crate::model::map_of_range_byte_internal::ConstraintViolation),
|
4426 + | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
4427 + | #[doc(hidden)]
|
4428 + | PatternString(crate::model::pattern_string_internal::ConstraintViolation),
|
4429 + | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
4430 + | #[doc(hidden)]
|
4431 + | MapOfPatternString(crate::model::map_of_pattern_string_internal::ConstraintViolation),
|
4432 + | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
4433 + | #[doc(hidden)]
|
4434 + | ListOfPatternString(crate::model::list_of_pattern_string_internal::ConstraintViolation),
|
4435 + | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
4436 + | #[doc(hidden)]
|
4437 + | SetOfPatternString(crate::model::set_of_pattern_string_internal::ConstraintViolation),
|
4438 + | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
4439 + | #[doc(hidden)]
|
4440 + | LengthLengthPatternString(
|
4441 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
4729 4442 | ),
|
4730 - | };
|
4731 - | write!(f, "{message}")
|
4732 - | }
|
4733 - | }
|
4734 - |
|
4735 - | impl ::std::error::Error for ConstraintViolation {}
|
4736 - | impl ConstraintViolation {
|
4737 - | pub(crate) fn as_validation_exception_field(
|
4738 - | self,
|
4739 - | path: ::std::string::String,
|
4740 - | ) -> crate::model::ValidationExceptionField {
|
4741 - | match self {
|
4742 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4743 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4744 - | }
|
4745 - | }
|
4746 - | }
|
4747 - | }
|
4748 - | pub(crate) mod pattern_string_internal {
|
4749 - |
|
4750 - | #[derive(Debug, PartialEq)]
|
4751 - | pub enum ConstraintViolation {
|
4752 - | /// Error when a string doesn't satisfy its `@pattern`.
|
4753 - | /// Contains the String that failed the pattern.
|
4754 - | Pattern(String),
|
4755 - | }
|
4756 - |
|
4757 - | impl ::std::fmt::Display for ConstraintViolation {
|
4758 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4759 - | let message = match self {
|
4760 - | Self::Pattern(_) => {
|
4761 - | format!(
|
4762 - | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
4763 - | r#"[a-d]{5}"#
|
4764 - | )
|
4765 - | }
|
4766 - | };
|
4767 - | write!(f, "{message}")
|
4768 - | }
|
4769 - | }
|
4770 - |
|
4771 - | impl ::std::error::Error for ConstraintViolation {}
|
4772 - | impl ConstraintViolation {
|
4773 - | pub(crate) fn as_validation_exception_field(
|
4774 - | self,
|
4775 - | path: ::std::string::String,
|
4776 - | ) -> crate::model::ValidationExceptionField {
|
4777 - | match self {
|
4778 - | #[allow(unused_variables)]
|
4779 - | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
4780 - | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
4781 - | path
|
4782 - | },
|
4783 - | }
|
4784 - | }
|
4785 - | }
|
4786 - | }
|
4787 - | pub(crate) mod map_of_pattern_string_internal {
|
4788 - |
|
4789 - | #[allow(clippy::enum_variant_names)]
|
4790 - | #[derive(Debug, PartialEq)]
|
4791 - | pub(crate) enum ConstraintViolation {
|
4443 + | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
4792 4444 | #[doc(hidden)]
|
4793 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4445 + | MapOfLengthPatternString(
|
4446 + | crate::model::map_of_length_pattern_string_internal::ConstraintViolation,
|
4447 + | ),
|
4448 + | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
4794 4449 | #[doc(hidden)]
|
4795 - | Value(
|
4796 - | crate::model::PatternString,
|
4797 - | crate::model::pattern_string_internal::ConstraintViolation,
|
4450 + | ListOfLengthPatternString(
|
4451 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
4452 + | ),
|
4453 + | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
4454 + | #[doc(hidden)]
|
4455 + | SetOfLengthPatternString(
|
4456 + | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
4457 + | ),
|
4458 + | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
4459 + | #[doc(hidden)]
|
4460 + | LengthListOfPatternString(
|
4461 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
4462 + | ),
|
4463 + | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
4464 + | #[doc(hidden)]
|
4465 + | LengthSetOfPatternString(
|
4466 + | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
4798 4467 | ),
|
4799 4468 | }
|
4800 - |
|
4801 4469 | impl ::std::fmt::Display for ConstraintViolation {
|
4802 4470 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4803 4471 | match self {
|
4804 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4805 - | Self::Value(_, value_constraint_violation) => {
|
4806 - | write!(f, "{}", value_constraint_violation)
|
4807 - | }
|
4808 - | }
|
4809 - | }
|
4472 + | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
4473 + | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
4474 + | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
4475 + | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
4476 + | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
4477 + | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
4478 + | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
4479 + | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
4480 + | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
4481 + | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
4482 + | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
4483 + | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
4484 + | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
4485 + | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
4486 + | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
4487 + | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
4488 + | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
4489 + | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
4490 + | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
4491 + | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
4492 + | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
4493 + | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
4494 + | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
4495 + | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
4496 + | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
4497 + | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
4498 + | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
4499 + | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
4500 + | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
4501 + | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
4502 + | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
4503 + | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
4504 + | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
4505 + | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
4506 + | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
4507 + | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
4508 + | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
4509 + | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
4510 + | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
4511 + | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
4512 + | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
4513 + | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
4514 + | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
4515 + | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
4516 + | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
4517 + | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
4518 + | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
4519 + | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
4520 + | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
4521 + | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
4522 + | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
4523 + | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
4524 + | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
4525 + | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
4526 + | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
4527 + | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
4528 + | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
4529 + | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
4530 + | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
4531 + | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
4532 + | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
4533 + | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
4534 + | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
4535 + | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
4536 + | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
4537 + | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
4538 + | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
4539 + | }
|
4540 + | }
|
4810 4541 | }
|
4811 - |
|
4812 4542 | impl ::std::error::Error for ConstraintViolation {}
|
4813 4543 | impl ConstraintViolation {
|
4814 4544 | pub(crate) fn as_validation_exception_field(
|
4815 4545 | self,
|
4816 4546 | path: ::std::string::String,
|
4817 4547 | ) -> crate::model::ValidationExceptionField {
|
4818 4548 | match self {
|
4819 - | Self::Key(key_constraint_violation) => {
|
4820 - | key_constraint_violation.as_validation_exception_field(path)
|
4549 + | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
4550 + | message: format!(
|
4551 + | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
4552 + | path
|
4553 + | ),
|
4554 + | path: path + "/conB",
|
4555 + | },
|
4556 + | ConstraintViolation::ConB(inner) => {
|
4557 + | inner.as_validation_exception_field(path + "/conB")
|
4821 4558 | }
|
4822 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4823 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4559 + | ConstraintViolation::OptConB(inner) => {
|
4560 + | inner.as_validation_exception_field(path + "/optConB")
|
4824 4561 | }
|
4562 + | ConstraintViolation::LengthString(inner) => {
|
4563 + | inner.as_validation_exception_field(path + "/lengthString")
|
4825 4564 | }
|
4565 + | ConstraintViolation::MinLengthString(inner) => {
|
4566 + | inner.as_validation_exception_field(path + "/minLengthString")
|
4826 4567 | }
|
4827 - | }
|
4828 - | pub(crate) mod map_of_list_of_enum_string_internal {
|
4829 - |
|
4830 - | #[allow(clippy::enum_variant_names)]
|
4831 - | #[derive(Debug, PartialEq)]
|
4832 - | pub(crate) enum ConstraintViolation {
|
4833 - | #[doc(hidden)]
|
4834 - | Key(crate::model::enum_string_internal::ConstraintViolation),
|
4835 - | #[doc(hidden)]
|
4836 - | Value(
|
4837 - | crate::model::EnumString,
|
4838 - | crate::model::list_of_enum_string_internal::ConstraintViolation,
|
4839 - | ),
|
4568 + | ConstraintViolation::MaxLengthString(inner) => {
|
4569 + | inner.as_validation_exception_field(path + "/maxLengthString")
|
4840 4570 | }
|
4841 - |
|
4842 - | impl ::std::fmt::Display for ConstraintViolation {
|
4843 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4844 - | match self {
|
4845 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4846 - | Self::Value(_, value_constraint_violation) => {
|
4847 - | write!(f, "{}", value_constraint_violation)
|
4571 + | ConstraintViolation::FixedLengthString(inner) => {
|
4572 + | inner.as_validation_exception_field(path + "/fixedLengthString")
|
4848 4573 | }
|
4574 + | ConstraintViolation::LengthBlob(inner) => {
|
4575 + | inner.as_validation_exception_field(path + "/lengthBlob")
|
4849 4576 | }
|
4577 + | ConstraintViolation::MinLengthBlob(inner) => {
|
4578 + | inner.as_validation_exception_field(path + "/minLengthBlob")
|
4850 4579 | }
|
4580 + | ConstraintViolation::MaxLengthBlob(inner) => {
|
4581 + | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
4851 4582 | }
|
4852 - |
|
4853 - | impl ::std::error::Error for ConstraintViolation {}
|
4854 - | impl ConstraintViolation {
|
4855 - | pub(crate) fn as_validation_exception_field(
|
4856 - | self,
|
4857 - | path: ::std::string::String,
|
4858 - | ) -> crate::model::ValidationExceptionField {
|
4859 - | match self {
|
4860 - | Self::Key(key_constraint_violation) => {
|
4861 - | key_constraint_violation.as_validation_exception_field(path)
|
4583 + | ConstraintViolation::FixedLengthBlob(inner) => {
|
4584 + | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
4862 4585 | }
|
4863 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4864 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4586 + | ConstraintViolation::RangeInteger(inner) => {
|
4587 + | inner.as_validation_exception_field(path + "/rangeInteger")
|
4865 4588 | }
|
4589 + | ConstraintViolation::MinRangeInteger(inner) => {
|
4590 + | inner.as_validation_exception_field(path + "/minRangeInteger")
|
4866 4591 | }
|
4592 + | ConstraintViolation::MaxRangeInteger(inner) => {
|
4593 + | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
4867 4594 | }
|
4868 - | }
|
4869 - | pub(crate) mod list_of_enum_string_internal {
|
4870 - |
|
4871 - | #[allow(clippy::enum_variant_names)]
|
4872 - | #[derive(Debug, PartialEq)]
|
4873 - | pub(crate) enum ConstraintViolation {
|
4874 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4875 - | /// The first component of the tuple is the index in the collection where the
|
4876 - | /// first constraint violation was found.
|
4877 - | #[doc(hidden)]
|
4878 - | Member(
|
4879 - | usize,
|
4880 - | crate::model::enum_string_internal::ConstraintViolation,
|
4881 - | ),
|
4595 + | ConstraintViolation::FixedValueInteger(inner) => {
|
4596 + | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
4882 4597 | }
|
4883 - |
|
4884 - | impl ::std::fmt::Display for ConstraintViolation {
|
4885 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4886 - | let message = match self {
|
4887 - | Self::Member(index, failing_member) => format!(
|
4888 - | "Value at index {index} failed to satisfy constraint. {}",
|
4889 - | failing_member
|
4890 - | ),
|
4891 - | };
|
4892 - | write!(f, "{message}")
|
4598 + | ConstraintViolation::RangeShort(inner) => {
|
4599 + | inner.as_validation_exception_field(path + "/rangeShort")
|
4893 4600 | }
|
4601 + | ConstraintViolation::MinRangeShort(inner) => {
|
4602 + | inner.as_validation_exception_field(path + "/minRangeShort")
|
4894 4603 | }
|
4895 - |
|
4896 - | impl ::std::error::Error for ConstraintViolation {}
|
4897 - | impl ConstraintViolation {
|
4898 - | pub(crate) fn as_validation_exception_field(
|
4899 - | self,
|
4900 - | path: ::std::string::String,
|
4901 - | ) -> crate::model::ValidationExceptionField {
|
4902 - | match self {
|
4903 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4904 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4604 + | ConstraintViolation::MaxRangeShort(inner) => {
|
4605 + | inner.as_validation_exception_field(path + "/maxRangeShort")
|
4905 4606 | }
|
4607 + | ConstraintViolation::FixedValueShort(inner) => {
|
4608 + | inner.as_validation_exception_field(path + "/fixedValueShort")
|
4906 4609 | }
|
4610 + | ConstraintViolation::RangeLong(inner) => {
|
4611 + | inner.as_validation_exception_field(path + "/rangeLong")
|
4907 4612 | }
|
4908 - | }
|
4909 - | pub(crate) mod map_of_length_list_of_pattern_string_internal {
|
4910 - |
|
4911 - | #[allow(clippy::enum_variant_names)]
|
4912 - | #[derive(Debug, PartialEq)]
|
4913 - | pub(crate) enum ConstraintViolation {
|
4914 - | #[doc(hidden)]
|
4915 - | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
4916 - | #[doc(hidden)]
|
4917 - | Value(
|
4918 - | crate::model::PatternString,
|
4919 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
4920 - | ),
|
4613 + | ConstraintViolation::MinRangeLong(inner) => {
|
4614 + | inner.as_validation_exception_field(path + "/minRangeLong")
|
4921 4615 | }
|
4922 - |
|
4923 - | impl ::std::fmt::Display for ConstraintViolation {
|
4924 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4925 - | match self {
|
4926 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
4927 - | Self::Value(_, value_constraint_violation) => {
|
4928 - | write!(f, "{}", value_constraint_violation)
|
4616 + | ConstraintViolation::MaxRangeLong(inner) => {
|
4617 + | inner.as_validation_exception_field(path + "/maxRangeLong")
|
4929 4618 | }
|
4619 + | ConstraintViolation::FixedValueLong(inner) => {
|
4620 + | inner.as_validation_exception_field(path + "/fixedValueLong")
|
4930 4621 | }
|
4622 + | ConstraintViolation::RangeByte(inner) => {
|
4623 + | inner.as_validation_exception_field(path + "/rangeByte")
|
4931 4624 | }
|
4625 + | ConstraintViolation::MinRangeByte(inner) => {
|
4626 + | inner.as_validation_exception_field(path + "/minRangeByte")
|
4932 4627 | }
|
4933 - |
|
4934 - | impl ::std::error::Error for ConstraintViolation {}
|
4935 - | impl ConstraintViolation {
|
4936 - | pub(crate) fn as_validation_exception_field(
|
4937 - | self,
|
4938 - | path: ::std::string::String,
|
4939 - | ) -> crate::model::ValidationExceptionField {
|
4940 - | match self {
|
4941 - | Self::Key(key_constraint_violation) => {
|
4942 - | key_constraint_violation.as_validation_exception_field(path)
|
4628 + | ConstraintViolation::MaxRangeByte(inner) => {
|
4629 + | inner.as_validation_exception_field(path + "/maxRangeByte")
|
4943 4630 | }
|
4944 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4945 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4631 + | ConstraintViolation::FixedValueByte(inner) => {
|
4632 + | inner.as_validation_exception_field(path + "/fixedValueByte")
|
4946 4633 | }
|
4634 + | ConstraintViolation::ConBList(inner) => {
|
4635 + | inner.as_validation_exception_field(path + "/conBList")
|
4947 4636 | }
|
4637 + | ConstraintViolation::LengthList(inner) => {
|
4638 + | inner.as_validation_exception_field(path + "/lengthList")
|
4948 4639 | }
|
4949 - | }
|
4950 - | pub(crate) mod length_list_of_pattern_string_internal {
|
4951 - |
|
4952 - | #[allow(clippy::enum_variant_names)]
|
4953 - | #[derive(Debug, PartialEq)]
|
4954 - | pub(crate) enum ConstraintViolation {
|
4955 - | /// Constraint violation error when the list doesn't have the required length
|
4956 - | Length(usize),
|
4957 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4958 - | /// The first component of the tuple is the index in the collection where the
|
4959 - | /// first constraint violation was found.
|
4960 - | #[doc(hidden)]
|
4961 - | Member(
|
4962 - | usize,
|
4963 - | crate::model::pattern_string_internal::ConstraintViolation,
|
4964 - | ),
|
4640 + | ConstraintViolation::SensitiveLengthList(inner) => {
|
4641 + | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
4965 4642 | }
|
4966 - |
|
4967 - | impl ::std::fmt::Display for ConstraintViolation {
|
4968 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4969 - | let message = match self {
|
4970 - | Self::Length(length) => {
|
4971 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
4643 + | ConstraintViolation::ConBSet(inner) => {
|
4644 + | inner.as_validation_exception_field(path + "/conBSet")
|
4972 4645 | }
|
4973 - | Self::Member(index, failing_member) => format!(
|
4974 - | "Value at index {index} failed to satisfy constraint. {}",
|
4975 - | failing_member
|
4976 - | ),
|
4977 - | };
|
4978 - | write!(f, "{message}")
|
4646 + | ConstraintViolation::ConBMap(inner) => {
|
4647 + | inner.as_validation_exception_field(path + "/conBMap")
|
4979 4648 | }
|
4649 + | ConstraintViolation::LengthMap(inner) => {
|
4650 + | inner.as_validation_exception_field(path + "/lengthMap")
|
4980 4651 | }
|
4981 - |
|
4982 - | impl ::std::error::Error for ConstraintViolation {}
|
4983 - | impl ConstraintViolation {
|
4984 - | pub(crate) fn as_validation_exception_field(
|
4985 - | self,
|
4986 - | path: ::std::string::String,
|
4987 - | ) -> crate::model::ValidationExceptionField {
|
4988 - | match self {
|
4989 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
4990 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
4991 - | path,
|
4992 - | },
|
4993 - | Self::Member(index, member_constraint_violation) =>
|
4994 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4652 + | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
4653 + | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
4995 4654 | }
|
4655 + | ConstraintViolation::SparseMap(inner) => {
|
4656 + | inner.as_validation_exception_field(path + "/sparseMap")
|
4996 4657 | }
|
4658 + | ConstraintViolation::SparseList(inner) => {
|
4659 + | inner.as_validation_exception_field(path + "/sparseList")
|
4997 4660 | }
|
4998 - | }
|
4999 - | pub(crate) mod map_of_set_of_length_string_internal {
|
5000 - |
|
5001 - | #[allow(clippy::enum_variant_names)]
|
5002 - | #[derive(Debug, PartialEq)]
|
5003 - | pub(crate) enum ConstraintViolation {
|
5004 - | #[doc(hidden)]
|
5005 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
5006 - | #[doc(hidden)]
|
5007 - | Value(
|
5008 - | crate::model::LengthString,
|
5009 - | crate::model::set_of_length_string_internal::ConstraintViolation,
|
5010 - | ),
|
4661 + | ConstraintViolation::SparseLengthMap(inner) => {
|
4662 + | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
5011 4663 | }
|
5012 - |
|
5013 - | impl ::std::fmt::Display for ConstraintViolation {
|
5014 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5015 - | match self {
|
5016 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5017 - | Self::Value(_, value_constraint_violation) => {
|
5018 - | write!(f, "{}", value_constraint_violation)
|
4664 + | ConstraintViolation::SparseLengthList(inner) => {
|
4665 + | inner.as_validation_exception_field(path + "/sparseLengthList")
|
5019 4666 | }
|
4667 + | ConstraintViolation::ConstrainedUnion(inner) => {
|
4668 + | inner.as_validation_exception_field(path + "/constrainedUnion")
|
5020 4669 | }
|
4670 + | ConstraintViolation::EnumString(inner) => {
|
4671 + | inner.as_validation_exception_field(path + "/enumString")
|
5021 4672 | }
|
4673 + | ConstraintViolation::ListOfLengthString(inner) => {
|
4674 + | inner.as_validation_exception_field(path + "/listOfLengthString")
|
5022 4675 | }
|
5023 - |
|
5024 - | impl ::std::error::Error for ConstraintViolation {}
|
5025 - | impl ConstraintViolation {
|
5026 - | pub(crate) fn as_validation_exception_field(
|
5027 - | self,
|
5028 - | path: ::std::string::String,
|
5029 - | ) -> crate::model::ValidationExceptionField {
|
5030 - | match self {
|
5031 - | Self::Key(key_constraint_violation) => {
|
5032 - | key_constraint_violation.as_validation_exception_field(path)
|
4676 + | ConstraintViolation::SetOfLengthString(inner) => {
|
4677 + | inner.as_validation_exception_field(path + "/setOfLengthString")
|
5033 4678 | }
|
5034 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5035 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4679 + | ConstraintViolation::MapOfLengthString(inner) => {
|
4680 + | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
5036 4681 | }
|
4682 + | ConstraintViolation::ListOfLengthBlob(inner) => {
|
4683 + | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
5037 4684 | }
|
4685 + | ConstraintViolation::MapOfLengthBlob(inner) => {
|
4686 + | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
5038 4687 | }
|
5039 - | }
|
5040 - | pub(crate) mod set_of_length_string_internal {
|
5041 - |
|
5042 - | #[allow(clippy::enum_variant_names)]
|
5043 - | #[derive(Debug, PartialEq)]
|
5044 - | pub(crate) enum ConstraintViolation {
|
5045 - | /// Constraint violation error when the list does not contain unique items
|
5046 - | UniqueItems {
|
5047 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
5048 - | /// at least two elements.
|
5049 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
5050 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
5051 - | /// Nothing is guaranteed about the order of the indices.
|
5052 - | duplicate_indices: ::std::vec::Vec<usize>,
|
5053 - | /// The original vector, that contains duplicate items.
|
5054 - | original: ::std::vec::Vec<crate::model::LengthString>,
|
5055 - | },
|
5056 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5057 - | /// The first component of the tuple is the index in the collection where the
|
5058 - | /// first constraint violation was found.
|
5059 - | #[doc(hidden)]
|
5060 - | Member(
|
5061 - | usize,
|
5062 - | crate::model::length_string_internal::ConstraintViolation,
|
5063 - | ),
|
4688 + | ConstraintViolation::ListOfRangeInteger(inner) => {
|
4689 + | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
5064 4690 | }
|
5065 - |
|
5066 - | impl ::std::fmt::Display for ConstraintViolation {
|
5067 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5068 - | let message = match self {
|
5069 - | Self::UniqueItems { duplicate_indices, .. } =>
|
5070 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
5071 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
5072 - | failing_member)
|
5073 - | };
|
5074 - | write!(f, "{message}")
|
4691 + | ConstraintViolation::SetOfRangeInteger(inner) => {
|
4692 + | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
5075 4693 | }
|
4694 + | ConstraintViolation::MapOfRangeInteger(inner) => {
|
4695 + | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
5076 4696 | }
|
5077 - |
|
5078 - | impl ::std::error::Error for ConstraintViolation {}
|
5079 - | impl ConstraintViolation {
|
5080 - | pub(crate) fn as_validation_exception_field(
|
5081 - | self,
|
5082 - | path: ::std::string::String,
|
5083 - | ) -> crate::model::ValidationExceptionField {
|
5084 - | match self {
|
5085 - | Self::UniqueItems { duplicate_indices, .. } =>
|
5086 - | crate::model::ValidationExceptionField {
|
5087 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
5088 - | path,
|
5089 - | },
|
5090 - | Self::Member(index, member_constraint_violation) =>
|
5091 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4697 + | ConstraintViolation::ListOfRangeShort(inner) => {
|
4698 + | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
5092 4699 | }
|
4700 + | ConstraintViolation::SetOfRangeShort(inner) => {
|
4701 + | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
5093 4702 | }
|
4703 + | ConstraintViolation::MapOfRangeShort(inner) => {
|
4704 + | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
5094 4705 | }
|
5095 - | }
|
5096 - | pub(crate) mod map_of_list_of_length_string_internal {
|
5097 - |
|
5098 - | #[allow(clippy::enum_variant_names)]
|
5099 - | #[derive(Debug, PartialEq)]
|
5100 - | pub(crate) enum ConstraintViolation {
|
5101 - | #[doc(hidden)]
|
5102 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
5103 - | #[doc(hidden)]
|
5104 - | Value(
|
5105 - | crate::model::LengthString,
|
5106 - | crate::model::list_of_length_string_internal::ConstraintViolation,
|
5107 - | ),
|
4706 + | ConstraintViolation::ListOfRangeLong(inner) => {
|
4707 + | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
5108 4708 | }
|
5109 - |
|
5110 - | impl ::std::fmt::Display for ConstraintViolation {
|
5111 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5112 - | match self {
|
5113 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5114 - | Self::Value(_, value_constraint_violation) => {
|
5115 - | write!(f, "{}", value_constraint_violation)
|
4709 + | ConstraintViolation::SetOfRangeLong(inner) => {
|
4710 + | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
5116 4711 | }
|
4712 + | ConstraintViolation::MapOfRangeLong(inner) => {
|
4713 + | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
5117 4714 | }
|
4715 + | ConstraintViolation::ListOfRangeByte(inner) => {
|
4716 + | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
5118 4717 | }
|
4718 + | ConstraintViolation::SetOfRangeByte(inner) => {
|
4719 + | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
5119 4720 | }
|
5120 - |
|
5121 - | impl ::std::error::Error for ConstraintViolation {}
|
5122 - | impl ConstraintViolation {
|
5123 - | pub(crate) fn as_validation_exception_field(
|
5124 - | self,
|
5125 - | path: ::std::string::String,
|
5126 - | ) -> crate::model::ValidationExceptionField {
|
5127 - | match self {
|
5128 - | Self::Key(key_constraint_violation) => {
|
5129 - | key_constraint_violation.as_validation_exception_field(path)
|
4721 + | ConstraintViolation::MapOfRangeByte(inner) => {
|
4722 + | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
5130 4723 | }
|
5131 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5132 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
4724 + | ConstraintViolation::PatternString(inner) => {
|
4725 + | inner.as_validation_exception_field(path + "/patternString")
|
5133 4726 | }
|
4727 + | ConstraintViolation::MapOfPatternString(inner) => {
|
4728 + | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
5134 4729 | }
|
4730 + | ConstraintViolation::ListOfPatternString(inner) => {
|
4731 + | inner.as_validation_exception_field(path + "/listOfPatternString")
|
5135 4732 | }
|
5136 - | }
|
5137 - | pub(crate) mod list_of_length_string_internal {
|
5138 - |
|
5139 - | #[allow(clippy::enum_variant_names)]
|
5140 - | #[derive(Debug, PartialEq)]
|
5141 - | pub(crate) enum ConstraintViolation {
|
5142 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5143 - | /// The first component of the tuple is the index in the collection where the
|
5144 - | /// first constraint violation was found.
|
5145 - | #[doc(hidden)]
|
5146 - | Member(
|
5147 - | usize,
|
5148 - | crate::model::length_string_internal::ConstraintViolation,
|
5149 - | ),
|
4733 + | ConstraintViolation::SetOfPatternString(inner) => {
|
4734 + | inner.as_validation_exception_field(path + "/setOfPatternString")
|
5150 4735 | }
|
5151 - |
|
5152 - | impl ::std::fmt::Display for ConstraintViolation {
|
5153 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5154 - | let message = match self {
|
5155 - | Self::Member(index, failing_member) => format!(
|
5156 - | "Value at index {index} failed to satisfy constraint. {}",
|
5157 - | failing_member
|
5158 - | ),
|
5159 - | };
|
5160 - | write!(f, "{message}")
|
4736 + | ConstraintViolation::LengthLengthPatternString(inner) => {
|
4737 + | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
5161 4738 | }
|
4739 + | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
4740 + | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
5162 4741 | }
|
5163 - |
|
5164 - | impl ::std::error::Error for ConstraintViolation {}
|
5165 - | impl ConstraintViolation {
|
5166 - | pub(crate) fn as_validation_exception_field(
|
5167 - | self,
|
5168 - | path: ::std::string::String,
|
5169 - | ) -> crate::model::ValidationExceptionField {
|
5170 - | match self {
|
5171 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5172 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
4742 + | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
4743 + | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
5173 4744 | }
|
4745 + | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
4746 + | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
5174 4747 | }
|
4748 + | ConstraintViolation::LengthListOfPatternString(inner) => {
|
4749 + | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
5175 4750 | }
|
5176 - | }
|
5177 - | pub(crate) mod map_of_length_string_internal {
|
5178 - |
|
5179 - | #[allow(clippy::enum_variant_names)]
|
5180 - | #[derive(Debug, PartialEq)]
|
5181 - | pub(crate) enum ConstraintViolation {
|
5182 - | #[doc(hidden)]
|
5183 - | Key(crate::model::length_string_internal::ConstraintViolation),
|
5184 - | #[doc(hidden)]
|
5185 - | Value(
|
5186 - | crate::model::LengthString,
|
5187 - | crate::model::length_string_internal::ConstraintViolation,
|
5188 - | ),
|
5189 - | }
|
5190 - |
|
5191 - | impl ::std::fmt::Display for ConstraintViolation {
|
5192 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5193 - | match self {
|
5194 - | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
5195 - | Self::Value(_, value_constraint_violation) => {
|
5196 - | write!(f, "{}", value_constraint_violation)
|
5197 - | }
|
5198 - | }
|
5199 - | }
|
5200 - | }
|
5201 - |
|
5202 - | impl ::std::error::Error for ConstraintViolation {}
|
5203 - | impl ConstraintViolation {
|
5204 - | pub(crate) fn as_validation_exception_field(
|
5205 - | self,
|
5206 - | path: ::std::string::String,
|
5207 - | ) -> crate::model::ValidationExceptionField {
|
5208 - | match self {
|
5209 - | Self::Key(key_constraint_violation) => {
|
5210 - | key_constraint_violation.as_validation_exception_field(path)
|
5211 - | }
|
5212 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
5213 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
5214 - | }
|
5215 - | }
|
5216 - | }
|
5217 - | }
|
5218 - | pub(crate) mod recursive_list_internal {
|
5219 - |
|
5220 - | #[allow(clippy::enum_variant_names)]
|
5221 - | #[derive(Debug, PartialEq)]
|
5222 - | pub(crate) enum ConstraintViolation {
|
5223 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
5224 - | /// The first component of the tuple is the index in the collection where the
|
5225 - | /// first constraint violation was found.
|
5226 - | #[doc(hidden)]
|
5227 - | Member(
|
5228 - | usize,
|
5229 - | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
5230 - | ),
|
5231 - | }
|
5232 - |
|
5233 - | impl ::std::fmt::Display for ConstraintViolation {
|
5234 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5235 - | let message = match self {
|
5236 - | Self::Member(index, failing_member) => format!(
|
5237 - | "Value at index {index} failed to satisfy constraint. {}",
|
5238 - | failing_member
|
5239 - | ),
|
5240 - | };
|
5241 - | write!(f, "{message}")
|
5242 - | }
|
5243 - | }
|
5244 - |
|
5245 - | impl ::std::error::Error for ConstraintViolation {}
|
5246 - | impl ConstraintViolation {
|
5247 - | pub(crate) fn as_validation_exception_field(
|
5248 - | self,
|
5249 - | path: ::std::string::String,
|
5250 - | ) -> crate::model::ValidationExceptionField {
|
5251 - | match self {
|
5252 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
5253 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
5254 - | }
|
5255 - | }
|
5256 - | }
|
5257 - | }
|
5258 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5259 - | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
5260 - |
|
5261 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5262 - | /// Holds one variant for each of the ways the builder can fail.
|
5263 - | #[non_exhaustive]
|
5264 - | #[allow(clippy::enum_variant_names)]
|
5265 - | pub(crate) enum ConstraintViolation {
|
5266 - | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
5267 - | MissingRecursiveMember,
|
5268 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
5269 - | #[doc(hidden)]
|
5270 - | RecursiveMember(
|
5271 - | ::std::boxed::Box<
|
5272 - | crate::model::recursive_shapes_input_output_nested2_internal::ConstraintViolation,
|
5273 - | >,
|
5274 - | ),
|
5275 - | }
|
5276 - | impl ::std::fmt::Display for ConstraintViolation {
|
5277 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5278 - | match self {
|
5279 - | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5280 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
5281 - | }
|
5282 - | }
|
4751 + | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
4752 + | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
5283 4753 | }
|
5284 - | impl ::std::error::Error for ConstraintViolation {}
|
5285 - | impl ConstraintViolation {
|
5286 - | pub(crate) fn as_validation_exception_field(
|
5287 - | self,
|
5288 - | path: ::std::string::String,
|
5289 - | ) -> crate::model::ValidationExceptionField {
|
5290 - | match self {
|
5291 - | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
5292 - | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
5293 - | path: path + "/recursiveMember",
|
5294 - | },
|
5295 - | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
5296 4754 | }
|
5297 4755 | }
|
5298 4756 | }
|
5299 - | impl ::std::convert::From<Builder>
|
5300 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
5301 - | {
|
4757 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
5302 4758 | fn from(builder: Builder) -> Self {
|
5303 4759 | Self::Unconstrained(builder)
|
5304 4760 | }
|
5305 4761 | }
|
5306 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
4762 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
5307 4763 | type Error = ConstraintViolation;
|
5308 4764 |
|
5309 4765 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5310 4766 | builder.build()
|
5311 4767 | }
|
5312 4768 | }
|
5313 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4769 + | /// A builder for [`ConA`](crate::model::ConA).
|
5314 4770 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5315 4771 | pub(crate) struct Builder {
|
5316 - | pub(crate) recursive_member: ::std::option::Option<
|
5317 - | ::std::boxed::Box<
|
5318 - | crate::constrained::MaybeConstrained<
|
5319 - | crate::model::RecursiveShapesInputOutputNested2,
|
4772 + | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
4773 + | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
4774 + | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
4775 + | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
4776 + | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
4777 + | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
4778 + | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
4779 + | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
4780 + | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
4781 + | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
4782 + | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
4783 + | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
4784 + | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
4785 + | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
4786 + | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
4787 + | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
4788 + | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
4789 + | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
4790 + | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
4791 + | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
4792 + | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
4793 + | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
4794 + | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
4795 + | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
4796 + | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
4797 + | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
4798 + | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
4799 + | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
4800 + | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
4801 + | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
4802 + | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
4803 + | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
4804 + | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>,
|
4805 + | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
4806 + | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
4807 + | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
4808 + | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
4809 + | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
4810 + | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
4811 + | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
4812 + | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
4813 + | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
4814 + | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
4815 + | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
4816 + | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
4817 + | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
4818 + | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
4819 + | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
4820 + | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
4821 + | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
4822 + | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
4823 + | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
4824 + | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
4825 + | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
4826 + | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
4827 + | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
4828 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
4829 + | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
4830 + | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
4831 + | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
4832 + | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
4833 + | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
4834 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
4835 + | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
4836 + | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
4837 + | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
4838 + | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
4839 + | }
|
4840 + | impl Builder {
|
4841 + | #[allow(missing_docs)] // documentation missing in model
|
4842 + | pub(crate) fn set_con_b(
|
4843 + | mut self,
|
4844 + | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
4845 + | ) -> Self {
|
4846 + | self.con_b = Some(input.into());
|
4847 + | self
|
4848 + | }
|
4849 + | #[allow(missing_docs)] // documentation missing in model
|
4850 + | pub(crate) fn set_opt_con_b(
|
4851 + | mut self,
|
4852 + | input: Option<
|
4853 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5320 4854 | >,
|
4855 + | ) -> Self {
|
4856 + | self.opt_con_b = input.map(|v| v.into());
|
4857 + | self
|
4858 + | }
|
4859 + | #[allow(missing_docs)] // documentation missing in model
|
4860 + | pub(crate) fn set_length_string(
|
4861 + | mut self,
|
4862 + | input: Option<
|
4863 + | impl ::std::convert::Into<
|
4864 + | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
5321 4865 | >,
|
5322 4866 | >,
|
4867 + | ) -> Self {
|
4868 + | self.length_string = input.map(|v| v.into());
|
4869 + | self
|
5323 4870 | }
|
5324 - | impl Builder {
|
5325 4871 | #[allow(missing_docs)] // documentation missing in model
|
5326 - | pub(crate) fn set_recursive_member(
|
4872 + | pub(crate) fn set_min_length_string(
|
5327 4873 | mut self,
|
5328 - | input: impl ::std::convert::Into<
|
5329 - | ::std::boxed::Box<
|
5330 - | crate::constrained::MaybeConstrained<
|
5331 - | crate::model::RecursiveShapesInputOutputNested2,
|
5332 - | >,
|
4874 + | input: Option<
|
4875 + | impl ::std::convert::Into<
|
4876 + | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
5333 4877 | >,
|
5334 4878 | >,
|
5335 4879 | ) -> Self {
|
5336 - | self.recursive_member = Some(input.into());
|
4880 + | self.min_length_string = input.map(|v| v.into());
|
5337 4881 | self
|
5338 4882 | }
|
5339 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5340 - | ///
|
5341 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
5342 - | ///
|
5343 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
5344 - | pub fn build(
|
5345 - | self,
|
5346 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5347 - | self.build_enforcing_all_constraints()
|
4883 + | #[allow(missing_docs)] // documentation missing in model
|
4884 + | pub(crate) fn set_max_length_string(
|
4885 + | mut self,
|
4886 + | input: Option<
|
4887 + | impl ::std::convert::Into<
|
4888 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
4889 + | >,
|
4890 + | >,
|
4891 + | ) -> Self {
|
4892 + | self.max_length_string = input.map(|v| v.into());
|
4893 + | self
|
5348 4894 | }
|
5349 - | fn build_enforcing_all_constraints(
|
5350 - | self,
|
5351 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5352 - | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
5353 - | recursive_member: self
|
5354 - | .recursive_member
|
5355 - | .map(|v| match *v {
|
5356 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
5357 - | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
5358 - | Ok(Box::new(x.try_into()?))
|
5359 - | }
|
5360 - | })
|
5361 - | .map(|res| {
|
5362 - | res.map_err(Box::new)
|
5363 - | .map_err(ConstraintViolation::RecursiveMember)
|
5364 - | })
|
5365 - | .transpose()?
|
5366 - | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
5367 - | })
|
5368 - | }
|
5369 - | }
|
5370 - | }
|
5371 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5372 - | pub mod recursive_shapes_input_output_nested1 {
|
5373 - |
|
5374 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5375 - | /// Holds one variant for each of the ways the builder can fail.
|
5376 - | #[allow(clippy::enum_variant_names)]
|
5377 - | pub enum ConstraintViolation {
|
5378 - | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
5379 - | MissingRecursiveMember,
|
5380 - | }
|
5381 - | impl ::std::fmt::Display for ConstraintViolation {
|
5382 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5383 - | match self {
|
5384 - | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
5385 - | }
|
5386 - | }
|
5387 - | }
|
5388 - | impl ::std::error::Error for ConstraintViolation {}
|
5389 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
5390 - | type Error = ConstraintViolation;
|
5391 - |
|
5392 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5393 - | builder.build()
|
5394 - | }
|
5395 - | }
|
5396 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5397 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5398 - | pub struct Builder {
|
5399 - | pub(crate) recursive_member: ::std::option::Option<
|
5400 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4895 + | #[allow(missing_docs)] // documentation missing in model
|
4896 + | pub(crate) fn set_fixed_length_string(
|
4897 + | mut self,
|
4898 + | input: Option<
|
4899 + | impl ::std::convert::Into<
|
4900 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
5401 4901 | >,
|
4902 + | >,
|
4903 + | ) -> Self {
|
4904 + | self.fixed_length_string = input.map(|v| v.into());
|
4905 + | self
|
5402 4906 | }
|
5403 - | impl Builder {
|
5404 4907 | #[allow(missing_docs)] // documentation missing in model
|
5405 - | pub fn recursive_member(
|
4908 + | pub(crate) fn set_length_blob(
|
5406 4909 | mut self,
|
5407 - | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4910 + | input: Option<
|
4911 + | impl ::std::convert::Into<
|
4912 + | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
4913 + | >,
|
4914 + | >,
|
5408 4915 | ) -> Self {
|
5409 - | self.recursive_member = Some(input);
|
4916 + | self.length_blob = input.map(|v| v.into());
|
5410 4917 | self
|
5411 4918 | }
|
5412 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
5413 - | ///
|
5414 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if you do not provide a value for all non-`Option`al members.
|
5415 - | ///
|
5416 - | pub fn build(
|
5417 - | self,
|
5418 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5419 - | self.build_enforcing_required_and_enum_traits()
|
5420 - | }
|
5421 - | fn build_enforcing_required_and_enum_traits(
|
5422 - | self,
|
5423 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
5424 - | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
5425 - | recursive_member: self
|
5426 - | .recursive_member
|
5427 - | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
5428 - | })
|
5429 - | }
|
5430 - | }
|
5431 - | }
|
5432 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5433 - | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
5434 - |
|
5435 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5436 - | /// Holds one variant for each of the ways the builder can fail.
|
5437 - | #[non_exhaustive]
|
5438 - | #[allow(clippy::enum_variant_names)]
|
5439 - | pub(crate) enum ConstraintViolation {
|
5440 - | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
5441 - | #[doc(hidden)]
|
5442 - | RecursiveMember(
|
5443 - | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
5444 - | ),
|
5445 - | }
|
5446 - | impl ::std::fmt::Display for ConstraintViolation {
|
5447 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5448 - | match self {
|
5449 - | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
5450 - | }
|
5451 - | }
|
5452 - | }
|
5453 - | impl ::std::error::Error for ConstraintViolation {}
|
5454 - | impl ConstraintViolation {
|
5455 - | pub(crate) fn as_validation_exception_field(
|
5456 - | self,
|
5457 - | path: ::std::string::String,
|
5458 - | ) -> crate::model::ValidationExceptionField {
|
5459 - | match self {
|
5460 - | ConstraintViolation::RecursiveMember(inner) => {
|
5461 - | inner.as_validation_exception_field(path + "/recursiveMember")
|
5462 - | }
|
5463 - | }
|
5464 - | }
|
5465 - | }
|
5466 - | impl ::std::convert::From<Builder>
|
5467 - | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
5468 - | {
|
5469 - | fn from(builder: Builder) -> Self {
|
5470 - | Self::Unconstrained(builder)
|
5471 - | }
|
5472 - | }
|
5473 - | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5474 - | type Error = ConstraintViolation;
|
5475 - |
|
5476 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5477 - | builder.build()
|
5478 - | }
|
5479 - | }
|
5480 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5481 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5482 - | pub(crate) struct Builder {
|
5483 - | pub(crate) recursive_member: ::std::option::Option<
|
5484 - | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
4919 + | #[allow(missing_docs)] // documentation missing in model
|
4920 + | pub(crate) fn set_min_length_blob(
|
4921 + | mut self,
|
4922 + | input: Option<
|
4923 + | impl ::std::convert::Into<
|
4924 + | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
5485 4925 | >,
|
4926 + | >,
|
4927 + | ) -> Self {
|
4928 + | self.min_length_blob = input.map(|v| v.into());
|
4929 + | self
|
5486 4930 | }
|
5487 - | impl Builder {
|
5488 4931 | #[allow(missing_docs)] // documentation missing in model
|
5489 - | pub(crate) fn set_recursive_member(
|
4932 + | pub(crate) fn set_max_length_blob(
|
5490 4933 | mut self,
|
5491 4934 | input: Option<
|
5492 4935 | impl ::std::convert::Into<
|
5493 - | crate::constrained::MaybeConstrained<
|
5494 - | crate::model::RecursiveShapesInputOutputNested1,
|
5495 - | >,
|
4936 + | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
5496 4937 | >,
|
5497 4938 | >,
|
5498 4939 | ) -> Self {
|
5499 - | self.recursive_member = input.map(|v| v.into());
|
4940 + | self.max_length_blob = input.map(|v| v.into());
|
5500 4941 | self
|
5501 4942 | }
|
5502 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5503 - | ///
|
5504 - | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
5505 - | ///
|
5506 - | pub fn build(
|
5507 - | self,
|
5508 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5509 - | self.build_enforcing_all_constraints()
|
4943 + | #[allow(missing_docs)] // documentation missing in model
|
4944 + | pub(crate) fn set_fixed_length_blob(
|
4945 + | mut self,
|
4946 + | input: Option<
|
4947 + | impl ::std::convert::Into<
|
4948 + | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
4949 + | >,
|
4950 + | >,
|
4951 + | ) -> Self {
|
4952 + | self.fixed_length_blob = input.map(|v| v.into());
|
4953 + | self
|
5510 4954 | }
|
5511 - | fn build_enforcing_all_constraints(
|
5512 - | self,
|
5513 - | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
5514 - | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
5515 - | recursive_member: self
|
5516 - | .recursive_member
|
5517 - | .map(|v| match v {
|
5518 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
5519 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
5520 - | })
|
5521 - | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
5522 - | .transpose()?,
|
5523 - | })
|
4955 + | #[allow(missing_docs)] // documentation missing in model
|
4956 + | pub(crate) fn set_range_integer(
|
4957 + | mut self,
|
4958 + | input: impl ::std::convert::Into<
|
4959 + | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
4960 + | >,
|
4961 + | ) -> Self {
|
4962 + | self.range_integer = Some(input.into());
|
4963 + | self
|
5524 4964 | }
|
4965 + | #[allow(missing_docs)] // documentation missing in model
|
4966 + | pub(crate) fn set_min_range_integer(
|
4967 + | mut self,
|
4968 + | input: impl ::std::convert::Into<
|
4969 + | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
4970 + | >,
|
4971 + | ) -> Self {
|
4972 + | self.min_range_integer = Some(input.into());
|
4973 + | self
|
5525 4974 | }
|
5526 - | }
|
5527 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5528 - | pub mod recursive_shapes_input_output_nested2 {
|
5529 - |
|
5530 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5531 - | fn from(builder: Builder) -> Self {
|
5532 - | builder.build()
|
4975 + | #[allow(missing_docs)] // documentation missing in model
|
4976 + | pub(crate) fn set_max_range_integer(
|
4977 + | mut self,
|
4978 + | input: impl ::std::convert::Into<
|
4979 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
4980 + | >,
|
4981 + | ) -> Self {
|
4982 + | self.max_range_integer = Some(input.into());
|
4983 + | self
|
5533 4984 | }
|
4985 + | #[allow(missing_docs)] // documentation missing in model
|
4986 + | pub(crate) fn set_fixed_value_integer(
|
4987 + | mut self,
|
4988 + | input: impl ::std::convert::Into<
|
4989 + | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
4990 + | >,
|
4991 + | ) -> Self {
|
4992 + | self.fixed_value_integer = Some(input.into());
|
4993 + | self
|
5534 4994 | }
|
5535 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5536 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5537 - | pub struct Builder {
|
5538 - | pub(crate) recursive_member:
|
5539 - | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4995 + | #[allow(missing_docs)] // documentation missing in model
|
4996 + | pub(crate) fn set_range_short(
|
4997 + | mut self,
|
4998 + | input: impl ::std::convert::Into<
|
4999 + | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
5000 + | >,
|
5001 + | ) -> Self {
|
5002 + | self.range_short = Some(input.into());
|
5003 + | self
|
5540 5004 | }
|
5541 - | impl Builder {
|
5542 5005 | #[allow(missing_docs)] // documentation missing in model
|
5543 - | pub fn recursive_member(
|
5006 + | pub(crate) fn set_min_range_short(
|
5544 5007 | mut self,
|
5545 - | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5008 + | input: impl ::std::convert::Into<
|
5009 + | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
5010 + | >,
|
5546 5011 | ) -> Self {
|
5547 - | self.recursive_member = input;
|
5012 + | self.min_range_short = Some(input.into());
|
5548 5013 | self
|
5549 5014 | }
|
5550 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5551 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5552 - | self.build_enforcing_required_and_enum_traits()
|
5015 + | #[allow(missing_docs)] // documentation missing in model
|
5016 + | pub(crate) fn set_max_range_short(
|
5017 + | mut self,
|
5018 + | input: impl ::std::convert::Into<
|
5019 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
5020 + | >,
|
5021 + | ) -> Self {
|
5022 + | self.max_range_short = Some(input.into());
|
5023 + | self
|
5553 5024 | }
|
5554 - | fn build_enforcing_required_and_enum_traits(
|
5555 - | self,
|
5556 - | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5557 - | crate::model::RecursiveShapesInputOutputNested2 {
|
5558 - | recursive_member: self.recursive_member,
|
5025 + | #[allow(missing_docs)] // documentation missing in model
|
5026 + | pub(crate) fn set_fixed_value_short(
|
5027 + | mut self,
|
5028 + | input: impl ::std::convert::Into<
|
5029 + | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
5030 + | >,
|
5031 + | ) -> Self {
|
5032 + | self.fixed_value_short = Some(input.into());
|
5033 + | self
|
5559 5034 | }
|
5035 + | #[allow(missing_docs)] // documentation missing in model
|
5036 + | pub(crate) fn set_range_long(
|
5037 + | mut self,
|
5038 + | input: impl ::std::convert::Into<
|
5039 + | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
5040 + | >,
|
5041 + | ) -> Self {
|
5042 + | self.range_long = Some(input.into());
|
5043 + | self
|
5560 5044 | }
|
5045 + | #[allow(missing_docs)] // documentation missing in model
|
5046 + | pub(crate) fn set_min_range_long(
|
5047 + | mut self,
|
5048 + | input: impl ::std::convert::Into<
|
5049 + | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
5050 + | >,
|
5051 + | ) -> Self {
|
5052 + | self.min_range_long = Some(input.into());
|
5053 + | self
|
5561 5054 | }
|
5562 - | }
|
5563 - | /// See [`ConA`](crate::model::ConA).
|
5564 - | pub(crate) mod con_a_internal {
|
5565 - |
|
5566 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5567 - | /// Holds one variant for each of the ways the builder can fail.
|
5568 - | #[non_exhaustive]
|
5569 - | #[allow(clippy::enum_variant_names)]
|
5570 - | pub(crate) enum ConstraintViolation {
|
5571 - | /// `con_b` was not provided but it is required when building `ConA`.
|
5572 - | MissingConB,
|
5573 - | /// Constraint violation occurred building member `con_b` when building `ConA`.
|
5574 - | #[doc(hidden)]
|
5575 - | ConB(crate::model::con_b_internal::ConstraintViolation),
|
5576 - | /// Constraint violation occurred building member `opt_con_b` when building `ConA`.
|
5577 - | #[doc(hidden)]
|
5578 - | OptConB(crate::model::con_b_internal::ConstraintViolation),
|
5579 - | /// Constraint violation occurred building member `length_string` when building `ConA`.
|
5580 - | #[doc(hidden)]
|
5581 - | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
5582 - | /// Constraint violation occurred building member `min_length_string` when building `ConA`.
|
5583 - | #[doc(hidden)]
|
5584 - | MinLengthString(crate::model::min_length_string_internal::ConstraintViolation),
|
5585 - | /// Constraint violation occurred building member `max_length_string` when building `ConA`.
|
5586 - | #[doc(hidden)]
|
5587 - | MaxLengthString(crate::model::max_length_string_internal::ConstraintViolation),
|
5588 - | /// Constraint violation occurred building member `fixed_length_string` when building `ConA`.
|
5589 - | #[doc(hidden)]
|
5590 - | FixedLengthString(crate::model::fixed_length_string_internal::ConstraintViolation),
|
5591 - | /// Constraint violation occurred building member `length_blob` when building `ConA`.
|
5592 - | #[doc(hidden)]
|
5593 - | LengthBlob(crate::model::length_blob_internal::ConstraintViolation),
|
5594 - | /// Constraint violation occurred building member `min_length_blob` when building `ConA`.
|
5595 - | #[doc(hidden)]
|
5596 - | MinLengthBlob(crate::model::min_length_blob_internal::ConstraintViolation),
|
5597 - | /// Constraint violation occurred building member `max_length_blob` when building `ConA`.
|
5598 - | #[doc(hidden)]
|
5599 - | MaxLengthBlob(crate::model::max_length_blob_internal::ConstraintViolation),
|
5600 - | /// Constraint violation occurred building member `fixed_length_blob` when building `ConA`.
|
5601 - | #[doc(hidden)]
|
5602 - | FixedLengthBlob(crate::model::fixed_length_blob_internal::ConstraintViolation),
|
5603 - | /// Constraint violation occurred building member `range_integer` when building `ConA`.
|
5604 - | #[doc(hidden)]
|
5605 - | RangeInteger(crate::model::range_integer_internal::ConstraintViolation),
|
5606 - | /// Constraint violation occurred building member `min_range_integer` when building `ConA`.
|
5607 - | #[doc(hidden)]
|
5608 - | MinRangeInteger(crate::model::min_range_integer_internal::ConstraintViolation),
|
5609 - | /// Constraint violation occurred building member `max_range_integer` when building `ConA`.
|
5610 - | #[doc(hidden)]
|
5611 - | MaxRangeInteger(crate::model::max_range_integer_internal::ConstraintViolation),
|
5612 - | /// Constraint violation occurred building member `fixed_value_integer` when building `ConA`.
|
5613 - | #[doc(hidden)]
|
5614 - | FixedValueInteger(crate::model::fixed_value_integer_internal::ConstraintViolation),
|
5615 - | /// Constraint violation occurred building member `range_short` when building `ConA`.
|
5616 - | #[doc(hidden)]
|
5617 - | RangeShort(crate::model::range_short_internal::ConstraintViolation),
|
5618 - | /// Constraint violation occurred building member `min_range_short` when building `ConA`.
|
5619 - | #[doc(hidden)]
|
5620 - | MinRangeShort(crate::model::min_range_short_internal::ConstraintViolation),
|
5621 - | /// Constraint violation occurred building member `max_range_short` when building `ConA`.
|
5622 - | #[doc(hidden)]
|
5623 - | MaxRangeShort(crate::model::max_range_short_internal::ConstraintViolation),
|
5624 - | /// Constraint violation occurred building member `fixed_value_short` when building `ConA`.
|
5625 - | #[doc(hidden)]
|
5626 - | FixedValueShort(crate::model::fixed_value_short_internal::ConstraintViolation),
|
5627 - | /// Constraint violation occurred building member `range_long` when building `ConA`.
|
5628 - | #[doc(hidden)]
|
5629 - | RangeLong(crate::model::range_long_internal::ConstraintViolation),
|
5630 - | /// Constraint violation occurred building member `min_range_long` when building `ConA`.
|
5631 - | #[doc(hidden)]
|
5632 - | MinRangeLong(crate::model::min_range_long_internal::ConstraintViolation),
|
5633 - | /// Constraint violation occurred building member `max_range_long` when building `ConA`.
|
5634 - | #[doc(hidden)]
|
5635 - | MaxRangeLong(crate::model::max_range_long_internal::ConstraintViolation),
|
5636 - | /// Constraint violation occurred building member `fixed_value_long` when building `ConA`.
|
5637 - | #[doc(hidden)]
|
5638 - | FixedValueLong(crate::model::fixed_value_long_internal::ConstraintViolation),
|
5639 - | /// Constraint violation occurred building member `range_byte` when building `ConA`.
|
5640 - | #[doc(hidden)]
|
5641 - | RangeByte(crate::model::range_byte_internal::ConstraintViolation),
|
5642 - | /// Constraint violation occurred building member `min_range_byte` when building `ConA`.
|
5643 - | #[doc(hidden)]
|
5644 - | MinRangeByte(crate::model::min_range_byte_internal::ConstraintViolation),
|
5645 - | /// Constraint violation occurred building member `max_range_byte` when building `ConA`.
|
5646 - | #[doc(hidden)]
|
5647 - | MaxRangeByte(crate::model::max_range_byte_internal::ConstraintViolation),
|
5648 - | /// Constraint violation occurred building member `fixed_value_byte` when building `ConA`.
|
5649 - | #[doc(hidden)]
|
5650 - | FixedValueByte(crate::model::fixed_value_byte_internal::ConstraintViolation),
|
5651 - | /// Constraint violation occurred building member `con_b_list` when building `ConA`.
|
5652 - | #[doc(hidden)]
|
5653 - | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
5654 - | /// Constraint violation occurred building member `length_list` when building `ConA`.
|
5655 - | #[doc(hidden)]
|
5656 - | LengthList(crate::model::length_list_internal::ConstraintViolation),
|
5657 - | /// Constraint violation occurred building member `sensitive_length_list` when building `ConA`.
|
5658 - | #[doc(hidden)]
|
5659 - | SensitiveLengthList(crate::model::sensitive_length_list_internal::ConstraintViolation),
|
5660 - | /// Constraint violation occurred building member `con_b_set` when building `ConA`.
|
5661 - | #[doc(hidden)]
|
5662 - | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
5663 - | /// Constraint violation occurred building member `con_b_map` when building `ConA`.
|
5664 - | #[doc(hidden)]
|
5665 - | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
5666 - | /// Constraint violation occurred building member `length_map` when building `ConA`.
|
5667 - | #[doc(hidden)]
|
5668 - | LengthMap(crate::model::length_map_internal::ConstraintViolation),
|
5669 - | /// Constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`.
|
5670 - | #[doc(hidden)]
|
5671 - | MapOfMapOfListOfListOfConB(
|
5672 - | crate::model::map_of_map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
5673 - | ),
|
5674 - | /// Constraint violation occurred building member `sparse_map` when building `ConA`.
|
5675 - | #[doc(hidden)]
|
5676 - | SparseMap(crate::model::sparse_map_internal::ConstraintViolation),
|
5677 - | /// Constraint violation occurred building member `sparse_list` when building `ConA`.
|
5678 - | #[doc(hidden)]
|
5679 - | SparseList(crate::model::sparse_list_internal::ConstraintViolation),
|
5680 - | /// Constraint violation occurred building member `sparse_length_map` when building `ConA`.
|
5681 - | #[doc(hidden)]
|
5682 - | SparseLengthMap(crate::model::sparse_length_map_internal::ConstraintViolation),
|
5683 - | /// Constraint violation occurred building member `sparse_length_list` when building `ConA`.
|
5684 - | #[doc(hidden)]
|
5685 - | SparseLengthList(crate::model::sparse_length_list_internal::ConstraintViolation),
|
5686 - | /// Constraint violation occurred building member `constrained_union` when building `ConA`.
|
5687 - | #[doc(hidden)]
|
5688 - | ConstrainedUnion(crate::model::constrained_union_internal::ConstraintViolation),
|
5689 - | /// Constraint violation occurred building member `enum_string` when building `ConA`.
|
5690 - | #[doc(hidden)]
|
5691 - | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
5692 - | /// Constraint violation occurred building member `list_of_length_string` when building `ConA`.
|
5693 - | #[doc(hidden)]
|
5694 - | ListOfLengthString(crate::model::list_of_length_string_internal::ConstraintViolation),
|
5695 - | /// Constraint violation occurred building member `set_of_length_string` when building `ConA`.
|
5696 - | #[doc(hidden)]
|
5697 - | SetOfLengthString(crate::model::set_of_length_string_internal::ConstraintViolation),
|
5698 - | /// Constraint violation occurred building member `map_of_length_string` when building `ConA`.
|
5699 - | #[doc(hidden)]
|
5700 - | MapOfLengthString(crate::model::map_of_length_string_internal::ConstraintViolation),
|
5701 - | /// Constraint violation occurred building member `list_of_length_blob` when building `ConA`.
|
5702 - | #[doc(hidden)]
|
5703 - | ListOfLengthBlob(crate::model::list_of_length_blob_internal::ConstraintViolation),
|
5704 - | /// Constraint violation occurred building member `map_of_length_blob` when building `ConA`.
|
5705 - | #[doc(hidden)]
|
5706 - | MapOfLengthBlob(crate::model::map_of_length_blob_internal::ConstraintViolation),
|
5707 - | /// Constraint violation occurred building member `list_of_range_integer` when building `ConA`.
|
5708 - | #[doc(hidden)]
|
5709 - | ListOfRangeInteger(crate::model::list_of_range_integer_internal::ConstraintViolation),
|
5710 - | /// Constraint violation occurred building member `set_of_range_integer` when building `ConA`.
|
5711 - | #[doc(hidden)]
|
5712 - | SetOfRangeInteger(crate::model::set_of_range_integer_internal::ConstraintViolation),
|
5713 - | /// Constraint violation occurred building member `map_of_range_integer` when building `ConA`.
|
5714 - | #[doc(hidden)]
|
5715 - | MapOfRangeInteger(crate::model::map_of_range_integer_internal::ConstraintViolation),
|
5716 - | /// Constraint violation occurred building member `list_of_range_short` when building `ConA`.
|
5717 - | #[doc(hidden)]
|
5718 - | ListOfRangeShort(crate::model::list_of_range_short_internal::ConstraintViolation),
|
5719 - | /// Constraint violation occurred building member `set_of_range_short` when building `ConA`.
|
5720 - | #[doc(hidden)]
|
5721 - | SetOfRangeShort(crate::model::set_of_range_short_internal::ConstraintViolation),
|
5722 - | /// Constraint violation occurred building member `map_of_range_short` when building `ConA`.
|
5723 - | #[doc(hidden)]
|
5724 - | MapOfRangeShort(crate::model::map_of_range_short_internal::ConstraintViolation),
|
5725 - | /// Constraint violation occurred building member `list_of_range_long` when building `ConA`.
|
5726 - | #[doc(hidden)]
|
5727 - | ListOfRangeLong(crate::model::list_of_range_long_internal::ConstraintViolation),
|
5728 - | /// Constraint violation occurred building member `set_of_range_long` when building `ConA`.
|
5729 - | #[doc(hidden)]
|
5730 - | SetOfRangeLong(crate::model::set_of_range_long_internal::ConstraintViolation),
|
5731 - | /// Constraint violation occurred building member `map_of_range_long` when building `ConA`.
|
5732 - | #[doc(hidden)]
|
5733 - | MapOfRangeLong(crate::model::map_of_range_long_internal::ConstraintViolation),
|
5734 - | /// Constraint violation occurred building member `list_of_range_byte` when building `ConA`.
|
5735 - | #[doc(hidden)]
|
5736 - | ListOfRangeByte(crate::model::list_of_range_byte_internal::ConstraintViolation),
|
5737 - | /// Constraint violation occurred building member `set_of_range_byte` when building `ConA`.
|
5738 - | #[doc(hidden)]
|
5739 - | SetOfRangeByte(crate::model::set_of_range_byte_internal::ConstraintViolation),
|
5740 - | /// Constraint violation occurred building member `map_of_range_byte` when building `ConA`.
|
5741 - | #[doc(hidden)]
|
5742 - | MapOfRangeByte(crate::model::map_of_range_byte_internal::ConstraintViolation),
|
5743 - | /// Constraint violation occurred building member `pattern_string` when building `ConA`.
|
5744 - | #[doc(hidden)]
|
5745 - | PatternString(crate::model::pattern_string_internal::ConstraintViolation),
|
5746 - | /// Constraint violation occurred building member `map_of_pattern_string` when building `ConA`.
|
5747 - | #[doc(hidden)]
|
5748 - | MapOfPatternString(crate::model::map_of_pattern_string_internal::ConstraintViolation),
|
5749 - | /// Constraint violation occurred building member `list_of_pattern_string` when building `ConA`.
|
5750 - | #[doc(hidden)]
|
5751 - | ListOfPatternString(crate::model::list_of_pattern_string_internal::ConstraintViolation),
|
5752 - | /// Constraint violation occurred building member `set_of_pattern_string` when building `ConA`.
|
5753 - | #[doc(hidden)]
|
5754 - | SetOfPatternString(crate::model::set_of_pattern_string_internal::ConstraintViolation),
|
5755 - | /// Constraint violation occurred building member `length_length_pattern_string` when building `ConA`.
|
5756 - | #[doc(hidden)]
|
5757 - | LengthLengthPatternString(
|
5758 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
5759 - | ),
|
5760 - | /// Constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`.
|
5761 - | #[doc(hidden)]
|
5762 - | MapOfLengthPatternString(
|
5763 - | crate::model::map_of_length_pattern_string_internal::ConstraintViolation,
|
5764 - | ),
|
5765 - | /// Constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`.
|
5766 - | #[doc(hidden)]
|
5767 - | ListOfLengthPatternString(
|
5768 - | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
5769 - | ),
|
5770 - | /// Constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`.
|
5771 - | #[doc(hidden)]
|
5772 - | SetOfLengthPatternString(
|
5773 - | crate::model::set_of_length_pattern_string_internal::ConstraintViolation,
|
5774 - | ),
|
5775 - | /// Constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`.
|
5776 - | #[doc(hidden)]
|
5777 - | LengthListOfPatternString(
|
5778 - | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
5779 - | ),
|
5780 - | /// Constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`.
|
5781 - | #[doc(hidden)]
|
5782 - | LengthSetOfPatternString(
|
5783 - | crate::model::length_set_of_pattern_string_internal::ConstraintViolation,
|
5784 - | ),
|
5785 - | }
|
5786 - | impl ::std::fmt::Display for ConstraintViolation {
|
5787 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5788 - | match self {
|
5789 - | ConstraintViolation::MissingConB => write!(f, "`con_b` was not provided but it is required when building `ConA`"),
|
5790 - | ConstraintViolation::ConB(_) => write!(f, "constraint violation occurred building member `con_b` when building `ConA`"),
|
5791 - | ConstraintViolation::OptConB(_) => write!(f, "constraint violation occurred building member `opt_con_b` when building `ConA`"),
|
5792 - | ConstraintViolation::LengthString(_) => write!(f, "constraint violation occurred building member `length_string` when building `ConA`"),
|
5793 - | ConstraintViolation::MinLengthString(_) => write!(f, "constraint violation occurred building member `min_length_string` when building `ConA`"),
|
5794 - | ConstraintViolation::MaxLengthString(_) => write!(f, "constraint violation occurred building member `max_length_string` when building `ConA`"),
|
5795 - | ConstraintViolation::FixedLengthString(_) => write!(f, "constraint violation occurred building member `fixed_length_string` when building `ConA`"),
|
5796 - | ConstraintViolation::LengthBlob(_) => write!(f, "constraint violation occurred building member `length_blob` when building `ConA`"),
|
5797 - | ConstraintViolation::MinLengthBlob(_) => write!(f, "constraint violation occurred building member `min_length_blob` when building `ConA`"),
|
5798 - | ConstraintViolation::MaxLengthBlob(_) => write!(f, "constraint violation occurred building member `max_length_blob` when building `ConA`"),
|
5799 - | ConstraintViolation::FixedLengthBlob(_) => write!(f, "constraint violation occurred building member `fixed_length_blob` when building `ConA`"),
|
5800 - | ConstraintViolation::RangeInteger(_) => write!(f, "constraint violation occurred building member `range_integer` when building `ConA`"),
|
5801 - | ConstraintViolation::MinRangeInteger(_) => write!(f, "constraint violation occurred building member `min_range_integer` when building `ConA`"),
|
5802 - | ConstraintViolation::MaxRangeInteger(_) => write!(f, "constraint violation occurred building member `max_range_integer` when building `ConA`"),
|
5803 - | ConstraintViolation::FixedValueInteger(_) => write!(f, "constraint violation occurred building member `fixed_value_integer` when building `ConA`"),
|
5804 - | ConstraintViolation::RangeShort(_) => write!(f, "constraint violation occurred building member `range_short` when building `ConA`"),
|
5805 - | ConstraintViolation::MinRangeShort(_) => write!(f, "constraint violation occurred building member `min_range_short` when building `ConA`"),
|
5806 - | ConstraintViolation::MaxRangeShort(_) => write!(f, "constraint violation occurred building member `max_range_short` when building `ConA`"),
|
5807 - | ConstraintViolation::FixedValueShort(_) => write!(f, "constraint violation occurred building member `fixed_value_short` when building `ConA`"),
|
5808 - | ConstraintViolation::RangeLong(_) => write!(f, "constraint violation occurred building member `range_long` when building `ConA`"),
|
5809 - | ConstraintViolation::MinRangeLong(_) => write!(f, "constraint violation occurred building member `min_range_long` when building `ConA`"),
|
5810 - | ConstraintViolation::MaxRangeLong(_) => write!(f, "constraint violation occurred building member `max_range_long` when building `ConA`"),
|
5811 - | ConstraintViolation::FixedValueLong(_) => write!(f, "constraint violation occurred building member `fixed_value_long` when building `ConA`"),
|
5812 - | ConstraintViolation::RangeByte(_) => write!(f, "constraint violation occurred building member `range_byte` when building `ConA`"),
|
5813 - | ConstraintViolation::MinRangeByte(_) => write!(f, "constraint violation occurred building member `min_range_byte` when building `ConA`"),
|
5814 - | ConstraintViolation::MaxRangeByte(_) => write!(f, "constraint violation occurred building member `max_range_byte` when building `ConA`"),
|
5815 - | ConstraintViolation::FixedValueByte(_) => write!(f, "constraint violation occurred building member `fixed_value_byte` when building `ConA`"),
|
5816 - | ConstraintViolation::ConBList(_) => write!(f, "constraint violation occurred building member `con_b_list` when building `ConA`"),
|
5817 - | ConstraintViolation::LengthList(_) => write!(f, "constraint violation occurred building member `length_list` when building `ConA`"),
|
5818 - | ConstraintViolation::SensitiveLengthList(_) => write!(f, "constraint violation occurred building member `sensitive_length_list` when building `ConA`"),
|
5819 - | ConstraintViolation::ConBSet(_) => write!(f, "constraint violation occurred building member `con_b_set` when building `ConA`"),
|
5820 - | ConstraintViolation::ConBMap(_) => write!(f, "constraint violation occurred building member `con_b_map` when building `ConA`"),
|
5821 - | ConstraintViolation::LengthMap(_) => write!(f, "constraint violation occurred building member `length_map` when building `ConA`"),
|
5822 - | ConstraintViolation::MapOfMapOfListOfListOfConB(_) => write!(f, "constraint violation occurred building member `map_of_map_of_list_of_list_of_con_b` when building `ConA`"),
|
5823 - | ConstraintViolation::SparseMap(_) => write!(f, "constraint violation occurred building member `sparse_map` when building `ConA`"),
|
5824 - | ConstraintViolation::SparseList(_) => write!(f, "constraint violation occurred building member `sparse_list` when building `ConA`"),
|
5825 - | ConstraintViolation::SparseLengthMap(_) => write!(f, "constraint violation occurred building member `sparse_length_map` when building `ConA`"),
|
5826 - | ConstraintViolation::SparseLengthList(_) => write!(f, "constraint violation occurred building member `sparse_length_list` when building `ConA`"),
|
5827 - | ConstraintViolation::ConstrainedUnion(_) => write!(f, "constraint violation occurred building member `constrained_union` when building `ConA`"),
|
5828 - | ConstraintViolation::EnumString(_) => write!(f, "constraint violation occurred building member `enum_string` when building `ConA`"),
|
5829 - | ConstraintViolation::ListOfLengthString(_) => write!(f, "constraint violation occurred building member `list_of_length_string` when building `ConA`"),
|
5830 - | ConstraintViolation::SetOfLengthString(_) => write!(f, "constraint violation occurred building member `set_of_length_string` when building `ConA`"),
|
5831 - | ConstraintViolation::MapOfLengthString(_) => write!(f, "constraint violation occurred building member `map_of_length_string` when building `ConA`"),
|
5832 - | ConstraintViolation::ListOfLengthBlob(_) => write!(f, "constraint violation occurred building member `list_of_length_blob` when building `ConA`"),
|
5833 - | ConstraintViolation::MapOfLengthBlob(_) => write!(f, "constraint violation occurred building member `map_of_length_blob` when building `ConA`"),
|
5834 - | ConstraintViolation::ListOfRangeInteger(_) => write!(f, "constraint violation occurred building member `list_of_range_integer` when building `ConA`"),
|
5835 - | ConstraintViolation::SetOfRangeInteger(_) => write!(f, "constraint violation occurred building member `set_of_range_integer` when building `ConA`"),
|
5836 - | ConstraintViolation::MapOfRangeInteger(_) => write!(f, "constraint violation occurred building member `map_of_range_integer` when building `ConA`"),
|
5837 - | ConstraintViolation::ListOfRangeShort(_) => write!(f, "constraint violation occurred building member `list_of_range_short` when building `ConA`"),
|
5838 - | ConstraintViolation::SetOfRangeShort(_) => write!(f, "constraint violation occurred building member `set_of_range_short` when building `ConA`"),
|
5839 - | ConstraintViolation::MapOfRangeShort(_) => write!(f, "constraint violation occurred building member `map_of_range_short` when building `ConA`"),
|
5840 - | ConstraintViolation::ListOfRangeLong(_) => write!(f, "constraint violation occurred building member `list_of_range_long` when building `ConA`"),
|
5841 - | ConstraintViolation::SetOfRangeLong(_) => write!(f, "constraint violation occurred building member `set_of_range_long` when building `ConA`"),
|
5842 - | ConstraintViolation::MapOfRangeLong(_) => write!(f, "constraint violation occurred building member `map_of_range_long` when building `ConA`"),
|
5843 - | ConstraintViolation::ListOfRangeByte(_) => write!(f, "constraint violation occurred building member `list_of_range_byte` when building `ConA`"),
|
5844 - | ConstraintViolation::SetOfRangeByte(_) => write!(f, "constraint violation occurred building member `set_of_range_byte` when building `ConA`"),
|
5845 - | ConstraintViolation::MapOfRangeByte(_) => write!(f, "constraint violation occurred building member `map_of_range_byte` when building `ConA`"),
|
5846 - | ConstraintViolation::PatternString(_) => write!(f, "constraint violation occurred building member `pattern_string` when building `ConA`"),
|
5847 - | ConstraintViolation::MapOfPatternString(_) => write!(f, "constraint violation occurred building member `map_of_pattern_string` when building `ConA`"),
|
5848 - | ConstraintViolation::ListOfPatternString(_) => write!(f, "constraint violation occurred building member `list_of_pattern_string` when building `ConA`"),
|
5849 - | ConstraintViolation::SetOfPatternString(_) => write!(f, "constraint violation occurred building member `set_of_pattern_string` when building `ConA`"),
|
5850 - | ConstraintViolation::LengthLengthPatternString(_) => write!(f, "constraint violation occurred building member `length_length_pattern_string` when building `ConA`"),
|
5851 - | ConstraintViolation::MapOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `map_of_length_pattern_string` when building `ConA`"),
|
5852 - | ConstraintViolation::ListOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `list_of_length_pattern_string` when building `ConA`"),
|
5853 - | ConstraintViolation::SetOfLengthPatternString(_) => write!(f, "constraint violation occurred building member `set_of_length_pattern_string` when building `ConA`"),
|
5854 - | ConstraintViolation::LengthListOfPatternString(_) => write!(f, "constraint violation occurred building member `length_list_of_pattern_string` when building `ConA`"),
|
5855 - | ConstraintViolation::LengthSetOfPatternString(_) => write!(f, "constraint violation occurred building member `length_set_of_pattern_string` when building `ConA`"),
|
5856 - | }
|
5055 + | #[allow(missing_docs)] // documentation missing in model
|
5056 + | pub(crate) fn set_max_range_long(
|
5057 + | mut self,
|
5058 + | input: impl ::std::convert::Into<
|
5059 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
5060 + | >,
|
5061 + | ) -> Self {
|
5062 + | self.max_range_long = Some(input.into());
|
5063 + | self
|
5857 5064 | }
|
5065 + | #[allow(missing_docs)] // documentation missing in model
|
5066 + | pub(crate) fn set_fixed_value_long(
|
5067 + | mut self,
|
5068 + | input: impl ::std::convert::Into<
|
5069 + | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
5070 + | >,
|
5071 + | ) -> Self {
|
5072 + | self.fixed_value_long = Some(input.into());
|
5073 + | self
|
5858 5074 | }
|
5859 - | impl ::std::error::Error for ConstraintViolation {}
|
5860 - | impl ConstraintViolation {
|
5861 - | pub(crate) fn as_validation_exception_field(
|
5862 - | self,
|
5863 - | path: ::std::string::String,
|
5864 - | ) -> crate::model::ValidationExceptionField {
|
5865 - | match self {
|
5866 - | ConstraintViolation::MissingConB => crate::model::ValidationExceptionField {
|
5867 - | message: format!(
|
5868 - | "Value at '{}/conB' failed to satisfy constraint: Member must not be null",
|
5869 - | path
|
5870 - | ),
|
5871 - | path: path + "/conB",
|
5872 - | },
|
5873 - | ConstraintViolation::ConB(inner) => {
|
5874 - | inner.as_validation_exception_field(path + "/conB")
|
5075 + | #[allow(missing_docs)] // documentation missing in model
|
5076 + | pub(crate) fn set_range_byte(
|
5077 + | mut self,
|
5078 + | input: impl ::std::convert::Into<
|
5079 + | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
5080 + | >,
|
5081 + | ) -> Self {
|
5082 + | self.range_byte = Some(input.into());
|
5083 + | self
|
5875 5084 | }
|
5876 - | ConstraintViolation::OptConB(inner) => {
|
5877 - | inner.as_validation_exception_field(path + "/optConB")
|
5085 + | #[allow(missing_docs)] // documentation missing in model
|
5086 + | pub(crate) fn set_min_range_byte(
|
5087 + | mut self,
|
5088 + | input: impl ::std::convert::Into<
|
5089 + | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
5090 + | >,
|
5091 + | ) -> Self {
|
5092 + | self.min_range_byte = Some(input.into());
|
5093 + | self
|
5878 5094 | }
|
5879 - | ConstraintViolation::LengthString(inner) => {
|
5880 - | inner.as_validation_exception_field(path + "/lengthString")
|
5095 + | #[allow(missing_docs)] // documentation missing in model
|
5096 + | pub(crate) fn set_max_range_byte(
|
5097 + | mut self,
|
5098 + | input: impl ::std::convert::Into<
|
5099 + | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
5100 + | >,
|
5101 + | ) -> Self {
|
5102 + | self.max_range_byte = Some(input.into());
|
5103 + | self
|
5881 5104 | }
|
5882 - | ConstraintViolation::MinLengthString(inner) => {
|
5883 - | inner.as_validation_exception_field(path + "/minLengthString")
|
5105 + | #[allow(missing_docs)] // documentation missing in model
|
5106 + | pub(crate) fn set_fixed_value_byte(
|
5107 + | mut self,
|
5108 + | input: impl ::std::convert::Into<
|
5109 + | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
5110 + | >,
|
5111 + | ) -> Self {
|
5112 + | self.fixed_value_byte = Some(input.into());
|
5113 + | self
|
5884 5114 | }
|
5885 - | ConstraintViolation::MaxLengthString(inner) => {
|
5886 - | inner.as_validation_exception_field(path + "/maxLengthString")
|
5115 + | #[allow(missing_docs)] // documentation missing in model
|
5116 + | pub(crate) fn set_con_b_list(
|
5117 + | mut self,
|
5118 + | input: Option<
|
5119 + | impl ::std::convert::Into<
|
5120 + | crate::constrained::MaybeConstrained<
|
5121 + | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
5122 + | >,
|
5123 + | >,
|
5124 + | >,
|
5125 + | ) -> Self {
|
5126 + | self.con_b_list = input.map(|v| v.into());
|
5127 + | self
|
5887 5128 | }
|
5888 - | ConstraintViolation::FixedLengthString(inner) => {
|
5889 - | inner.as_validation_exception_field(path + "/fixedLengthString")
|
5129 + | #[allow(missing_docs)] // documentation missing in model
|
5130 + | pub(crate) fn set_length_list(
|
5131 + | mut self,
|
5132 + | input: Option<
|
5133 + | impl ::std::convert::Into<
|
5134 + | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
5135 + | >,
|
5136 + | >,
|
5137 + | ) -> Self {
|
5138 + | self.length_list = input.map(|v| v.into());
|
5139 + | self
|
5890 5140 | }
|
5891 - | ConstraintViolation::LengthBlob(inner) => {
|
5892 - | inner.as_validation_exception_field(path + "/lengthBlob")
|
5141 + | #[allow(missing_docs)] // documentation missing in model
|
5142 + | pub(crate) fn set_sensitive_length_list(
|
5143 + | mut self,
|
5144 + | input: Option<
|
5145 + | impl ::std::convert::Into<
|
5146 + | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
5147 + | >,
|
5148 + | >,
|
5149 + | ) -> Self {
|
5150 + | self.sensitive_length_list = input.map(|v| v.into());
|
5151 + | self
|
5893 5152 | }
|
5894 - | ConstraintViolation::MinLengthBlob(inner) => {
|
5895 - | inner.as_validation_exception_field(path + "/minLengthBlob")
|
5153 + | #[allow(missing_docs)] // documentation missing in model
|
5154 + | pub(crate) fn set_con_b_set(
|
5155 + | mut self,
|
5156 + | input: Option<
|
5157 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
5158 + | >,
|
5159 + | ) -> Self {
|
5160 + | self.con_b_set = input.map(|v| v.into());
|
5161 + | self
|
5896 5162 | }
|
5897 - | ConstraintViolation::MaxLengthBlob(inner) => {
|
5898 - | inner.as_validation_exception_field(path + "/maxLengthBlob")
|
5163 + | #[allow(missing_docs)] // documentation missing in model
|
5164 + | pub(crate) fn set_con_b_map(
|
5165 + | mut self,
|
5166 + | input: Option<
|
5167 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
5168 + | >,
|
5169 + | ) -> Self {
|
5170 + | self.con_b_map = input.map(|v| v.into());
|
5171 + | self
|
5899 5172 | }
|
5900 - | ConstraintViolation::FixedLengthBlob(inner) => {
|
5901 - | inner.as_validation_exception_field(path + "/fixedLengthBlob")
|
5173 + | #[allow(missing_docs)] // documentation missing in model
|
5174 + | pub(crate) fn set_length_map(
|
5175 + | mut self,
|
5176 + | input: Option<
|
5177 + | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
5178 + | >,
|
5179 + | ) -> Self {
|
5180 + | self.length_map = input.map(|v| v.into());
|
5181 + | self
|
5902 5182 | }
|
5903 - | ConstraintViolation::RangeInteger(inner) => {
|
5904 - | inner.as_validation_exception_field(path + "/rangeInteger")
|
5183 + | #[allow(missing_docs)] // documentation missing in model
|
5184 + | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
5185 + | mut self,
|
5186 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
5187 + | ) -> Self {
|
5188 + | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
5189 + | self
|
5905 5190 | }
|
5906 - | ConstraintViolation::MinRangeInteger(inner) => {
|
5907 - | inner.as_validation_exception_field(path + "/minRangeInteger")
|
5191 + | #[allow(missing_docs)] // documentation missing in model
|
5192 + | pub(crate) fn set_sparse_map(
|
5193 + | mut self,
|
5194 + | input: Option<
|
5195 + | impl ::std::convert::Into<
|
5196 + | crate::constrained::MaybeConstrained<
|
5197 + | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
5198 + | >,
|
5199 + | >,
|
5200 + | >,
|
5201 + | ) -> Self {
|
5202 + | self.sparse_map = input.map(|v| v.into());
|
5203 + | self
|
5908 5204 | }
|
5909 - | ConstraintViolation::MaxRangeInteger(inner) => {
|
5910 - | inner.as_validation_exception_field(path + "/maxRangeInteger")
|
5911 - | }
|
5912 - | ConstraintViolation::FixedValueInteger(inner) => {
|
5913 - | inner.as_validation_exception_field(path + "/fixedValueInteger")
|
5914 - | }
|
5915 - | ConstraintViolation::RangeShort(inner) => {
|
5916 - | inner.as_validation_exception_field(path + "/rangeShort")
|
5205 + | #[allow(missing_docs)] // documentation missing in model
|
5206 + | pub(crate) fn set_sparse_list(
|
5207 + | mut self,
|
5208 + | input: Option<
|
5209 + | impl ::std::convert::Into<
|
5210 + | crate::constrained::MaybeConstrained<
|
5211 + | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
5212 + | >,
|
5213 + | >,
|
5214 + | >,
|
5215 + | ) -> Self {
|
5216 + | self.sparse_list = input.map(|v| v.into());
|
5217 + | self
|
5917 5218 | }
|
5918 - | ConstraintViolation::MinRangeShort(inner) => {
|
5919 - | inner.as_validation_exception_field(path + "/minRangeShort")
|
5219 + | #[allow(missing_docs)] // documentation missing in model
|
5220 + | pub(crate) fn set_sparse_length_map(
|
5221 + | mut self,
|
5222 + | input: Option<
|
5223 + | impl ::std::convert::Into<
|
5224 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
5225 + | >,
|
5226 + | >,
|
5227 + | ) -> Self {
|
5228 + | self.sparse_length_map = input.map(|v| v.into());
|
5229 + | self
|
5920 5230 | }
|
5921 - | ConstraintViolation::MaxRangeShort(inner) => {
|
5922 - | inner.as_validation_exception_field(path + "/maxRangeShort")
|
5231 + | #[allow(missing_docs)] // documentation missing in model
|
5232 + | pub(crate) fn set_sparse_length_list(
|
5233 + | mut self,
|
5234 + | input: Option<
|
5235 + | impl ::std::convert::Into<
|
5236 + | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
5237 + | >,
|
5238 + | >,
|
5239 + | ) -> Self {
|
5240 + | self.sparse_length_list = input.map(|v| v.into());
|
5241 + | self
|
5923 5242 | }
|
5924 - | ConstraintViolation::FixedValueShort(inner) => {
|
5925 - | inner.as_validation_exception_field(path + "/fixedValueShort")
|
5243 + | /// A union with constrained members.
|
5244 + | pub(crate) fn set_constrained_union(
|
5245 + | mut self,
|
5246 + | input: Option<
|
5247 + | impl ::std::convert::Into<
|
5248 + | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
5249 + | >,
|
5250 + | >,
|
5251 + | ) -> Self {
|
5252 + | self.constrained_union = input.map(|v| v.into());
|
5253 + | self
|
5926 5254 | }
|
5927 - | ConstraintViolation::RangeLong(inner) => {
|
5928 - | inner.as_validation_exception_field(path + "/rangeLong")
|
5255 + | #[allow(missing_docs)] // documentation missing in model
|
5256 + | pub(crate) fn set_enum_string(
|
5257 + | mut self,
|
5258 + | input: Option<
|
5259 + | impl ::std::convert::Into<
|
5260 + | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
5261 + | >,
|
5262 + | >,
|
5263 + | ) -> Self {
|
5264 + | self.enum_string = input.map(|v| v.into());
|
5265 + | self
|
5929 5266 | }
|
5930 - | ConstraintViolation::MinRangeLong(inner) => {
|
5931 - | inner.as_validation_exception_field(path + "/minRangeLong")
|
5267 + | #[allow(missing_docs)] // documentation missing in model
|
5268 + | pub(crate) fn set_list_of_length_string(
|
5269 + | mut self,
|
5270 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
5271 + | ) -> Self {
|
5272 + | self.list_of_length_string = input.map(|v| v.into());
|
5273 + | self
|
5932 5274 | }
|
5933 - | ConstraintViolation::MaxRangeLong(inner) => {
|
5934 - | inner.as_validation_exception_field(path + "/maxRangeLong")
|
5275 + | #[allow(missing_docs)] // documentation missing in model
|
5276 + | pub(crate) fn set_set_of_length_string(
|
5277 + | mut self,
|
5278 + | input: Option<
|
5279 + | impl ::std::convert::Into<
|
5280 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
5281 + | >,
|
5282 + | >,
|
5283 + | ) -> Self {
|
5284 + | self.set_of_length_string = input.map(|v| v.into());
|
5285 + | self
|
5935 5286 | }
|
5936 - | ConstraintViolation::FixedValueLong(inner) => {
|
5937 - | inner.as_validation_exception_field(path + "/fixedValueLong")
|
5287 + | #[allow(missing_docs)] // documentation missing in model
|
5288 + | pub(crate) fn set_map_of_length_string(
|
5289 + | mut self,
|
5290 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
5291 + | ) -> Self {
|
5292 + | self.map_of_length_string = input.map(|v| v.into());
|
5293 + | self
|
5938 5294 | }
|
5939 - | ConstraintViolation::RangeByte(inner) => {
|
5940 - | inner.as_validation_exception_field(path + "/rangeByte")
|
5295 + | #[allow(missing_docs)] // documentation missing in model
|
5296 + | pub(crate) fn set_list_of_length_blob(
|
5297 + | mut self,
|
5298 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
5299 + | ) -> Self {
|
5300 + | self.list_of_length_blob = input.map(|v| v.into());
|
5301 + | self
|
5941 5302 | }
|
5942 - | ConstraintViolation::MinRangeByte(inner) => {
|
5943 - | inner.as_validation_exception_field(path + "/minRangeByte")
|
5303 + | #[allow(missing_docs)] // documentation missing in model
|
5304 + | pub(crate) fn set_map_of_length_blob(
|
5305 + | mut self,
|
5306 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
5307 + | ) -> Self {
|
5308 + | self.map_of_length_blob = input.map(|v| v.into());
|
5309 + | self
|
5944 5310 | }
|
5945 - | ConstraintViolation::MaxRangeByte(inner) => {
|
5946 - | inner.as_validation_exception_field(path + "/maxRangeByte")
|
5311 + | #[allow(missing_docs)] // documentation missing in model
|
5312 + | pub(crate) fn set_list_of_range_integer(
|
5313 + | mut self,
|
5314 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
5315 + | ) -> Self {
|
5316 + | self.list_of_range_integer = input.map(|v| v.into());
|
5317 + | self
|
5947 5318 | }
|
5948 - | ConstraintViolation::FixedValueByte(inner) => {
|
5949 - | inner.as_validation_exception_field(path + "/fixedValueByte")
|
5319 + | #[allow(missing_docs)] // documentation missing in model
|
5320 + | pub(crate) fn set_set_of_range_integer(
|
5321 + | mut self,
|
5322 + | input: Option<
|
5323 + | impl ::std::convert::Into<
|
5324 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
5325 + | >,
|
5326 + | >,
|
5327 + | ) -> Self {
|
5328 + | self.set_of_range_integer = input.map(|v| v.into());
|
5329 + | self
|
5950 5330 | }
|
5951 - | ConstraintViolation::ConBList(inner) => {
|
5952 - | inner.as_validation_exception_field(path + "/conBList")
|
5331 + | #[allow(missing_docs)] // documentation missing in model
|
5332 + | pub(crate) fn set_map_of_range_integer(
|
5333 + | mut self,
|
5334 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
5335 + | ) -> Self {
|
5336 + | self.map_of_range_integer = input.map(|v| v.into());
|
5337 + | self
|
5953 5338 | }
|
5954 - | ConstraintViolation::LengthList(inner) => {
|
5955 - | inner.as_validation_exception_field(path + "/lengthList")
|
5339 + | #[allow(missing_docs)] // documentation missing in model
|
5340 + | pub(crate) fn set_list_of_range_short(
|
5341 + | mut self,
|
5342 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
5343 + | ) -> Self {
|
5344 + | self.list_of_range_short = input.map(|v| v.into());
|
5345 + | self
|
5956 5346 | }
|
5957 - | ConstraintViolation::SensitiveLengthList(inner) => {
|
5958 - | inner.as_validation_exception_field(path + "/sensitiveLengthList")
|
5347 + | #[allow(missing_docs)] // documentation missing in model
|
5348 + | pub(crate) fn set_set_of_range_short(
|
5349 + | mut self,
|
5350 + | input: Option<
|
5351 + | impl ::std::convert::Into<
|
5352 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
5353 + | >,
|
5354 + | >,
|
5355 + | ) -> Self {
|
5356 + | self.set_of_range_short = input.map(|v| v.into());
|
5357 + | self
|
5959 5358 | }
|
5960 - | ConstraintViolation::ConBSet(inner) => {
|
5961 - | inner.as_validation_exception_field(path + "/conBSet")
|
5359 + | #[allow(missing_docs)] // documentation missing in model
|
5360 + | pub(crate) fn set_map_of_range_short(
|
5361 + | mut self,
|
5362 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
5363 + | ) -> Self {
|
5364 + | self.map_of_range_short = input.map(|v| v.into());
|
5365 + | self
|
5962 5366 | }
|
5963 - | ConstraintViolation::ConBMap(inner) => {
|
5964 - | inner.as_validation_exception_field(path + "/conBMap")
|
5367 + | #[allow(missing_docs)] // documentation missing in model
|
5368 + | pub(crate) fn set_list_of_range_long(
|
5369 + | mut self,
|
5370 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
5371 + | ) -> Self {
|
5372 + | self.list_of_range_long = input.map(|v| v.into());
|
5373 + | self
|
5965 5374 | }
|
5966 - | ConstraintViolation::LengthMap(inner) => {
|
5967 - | inner.as_validation_exception_field(path + "/lengthMap")
|
5375 + | #[allow(missing_docs)] // documentation missing in model
|
5376 + | pub(crate) fn set_set_of_range_long(
|
5377 + | mut self,
|
5378 + | input: Option<
|
5379 + | impl ::std::convert::Into<
|
5380 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
5381 + | >,
|
5382 + | >,
|
5383 + | ) -> Self {
|
5384 + | self.set_of_range_long = input.map(|v| v.into());
|
5385 + | self
|
5968 5386 | }
|
5969 - | ConstraintViolation::MapOfMapOfListOfListOfConB(inner) => {
|
5970 - | inner.as_validation_exception_field(path + "/mapOfMapOfListOfListOfConB")
|
5387 + | #[allow(missing_docs)] // documentation missing in model
|
5388 + | pub(crate) fn set_map_of_range_long(
|
5389 + | mut self,
|
5390 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
5391 + | ) -> Self {
|
5392 + | self.map_of_range_long = input.map(|v| v.into());
|
5393 + | self
|
5971 5394 | }
|
5972 - | ConstraintViolation::SparseMap(inner) => {
|
5973 - | inner.as_validation_exception_field(path + "/sparseMap")
|
5395 + | #[allow(missing_docs)] // documentation missing in model
|
5396 + | pub(crate) fn set_list_of_range_byte(
|
5397 + | mut self,
|
5398 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
5399 + | ) -> Self {
|
5400 + | self.list_of_range_byte = input.map(|v| v.into());
|
5401 + | self
|
5974 5402 | }
|
5975 - | ConstraintViolation::SparseList(inner) => {
|
5976 - | inner.as_validation_exception_field(path + "/sparseList")
|
5403 + | #[allow(missing_docs)] // documentation missing in model
|
5404 + | pub(crate) fn set_set_of_range_byte(
|
5405 + | mut self,
|
5406 + | input: Option<
|
5407 + | impl ::std::convert::Into<
|
5408 + | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
5409 + | >,
|
5410 + | >,
|
5411 + | ) -> Self {
|
5412 + | self.set_of_range_byte = input.map(|v| v.into());
|
5413 + | self
|
5977 5414 | }
|
5978 - | ConstraintViolation::SparseLengthMap(inner) => {
|
5979 - | inner.as_validation_exception_field(path + "/sparseLengthMap")
|
5415 + | #[allow(missing_docs)] // documentation missing in model
|
5416 + | pub(crate) fn set_map_of_range_byte(
|
5417 + | mut self,
|
5418 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
5419 + | ) -> Self {
|
5420 + | self.map_of_range_byte = input.map(|v| v.into());
|
5421 + | self
|
5980 5422 | }
|
5981 - | ConstraintViolation::SparseLengthList(inner) => {
|
5982 - | inner.as_validation_exception_field(path + "/sparseLengthList")
|
5423 + | #[allow(missing_docs)] // documentation missing in model
|
5424 + | pub(crate) fn set_non_streaming_blob(
|
5425 + | mut self,
|
5426 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
5427 + | ) -> Self {
|
5428 + | self.non_streaming_blob = input.map(|v| v.into());
|
5429 + | self
|
5983 5430 | }
|
5984 - | ConstraintViolation::ConstrainedUnion(inner) => {
|
5985 - | inner.as_validation_exception_field(path + "/constrainedUnion")
|
5986 - | }
|
5987 - | ConstraintViolation::EnumString(inner) => {
|
5988 - | inner.as_validation_exception_field(path + "/enumString")
|
5989 - | }
|
5990 - | ConstraintViolation::ListOfLengthString(inner) => {
|
5991 - | inner.as_validation_exception_field(path + "/listOfLengthString")
|
5992 - | }
|
5993 - | ConstraintViolation::SetOfLengthString(inner) => {
|
5994 - | inner.as_validation_exception_field(path + "/setOfLengthString")
|
5995 - | }
|
5996 - | ConstraintViolation::MapOfLengthString(inner) => {
|
5997 - | inner.as_validation_exception_field(path + "/mapOfLengthString")
|
5998 - | }
|
5999 - | ConstraintViolation::ListOfLengthBlob(inner) => {
|
6000 - | inner.as_validation_exception_field(path + "/listOfLengthBlob")
|
6001 - | }
|
6002 - | ConstraintViolation::MapOfLengthBlob(inner) => {
|
6003 - | inner.as_validation_exception_field(path + "/mapOfLengthBlob")
|
6004 - | }
|
6005 - | ConstraintViolation::ListOfRangeInteger(inner) => {
|
6006 - | inner.as_validation_exception_field(path + "/listOfRangeInteger")
|
6007 - | }
|
6008 - | ConstraintViolation::SetOfRangeInteger(inner) => {
|
6009 - | inner.as_validation_exception_field(path + "/setOfRangeInteger")
|
6010 - | }
|
6011 - | ConstraintViolation::MapOfRangeInteger(inner) => {
|
6012 - | inner.as_validation_exception_field(path + "/mapOfRangeInteger")
|
6013 - | }
|
6014 - | ConstraintViolation::ListOfRangeShort(inner) => {
|
6015 - | inner.as_validation_exception_field(path + "/listOfRangeShort")
|
6016 - | }
|
6017 - | ConstraintViolation::SetOfRangeShort(inner) => {
|
6018 - | inner.as_validation_exception_field(path + "/setOfRangeShort")
|
6019 - | }
|
6020 - | ConstraintViolation::MapOfRangeShort(inner) => {
|
6021 - | inner.as_validation_exception_field(path + "/mapOfRangeShort")
|
6022 - | }
|
6023 - | ConstraintViolation::ListOfRangeLong(inner) => {
|
6024 - | inner.as_validation_exception_field(path + "/listOfRangeLong")
|
6025 - | }
|
6026 - | ConstraintViolation::SetOfRangeLong(inner) => {
|
6027 - | inner.as_validation_exception_field(path + "/setOfRangeLong")
|
6028 - | }
|
6029 - | ConstraintViolation::MapOfRangeLong(inner) => {
|
6030 - | inner.as_validation_exception_field(path + "/mapOfRangeLong")
|
6031 - | }
|
6032 - | ConstraintViolation::ListOfRangeByte(inner) => {
|
6033 - | inner.as_validation_exception_field(path + "/listOfRangeByte")
|
6034 - | }
|
6035 - | ConstraintViolation::SetOfRangeByte(inner) => {
|
6036 - | inner.as_validation_exception_field(path + "/setOfRangeByte")
|
6037 - | }
|
6038 - | ConstraintViolation::MapOfRangeByte(inner) => {
|
6039 - | inner.as_validation_exception_field(path + "/mapOfRangeByte")
|
6040 - | }
|
6041 - | ConstraintViolation::PatternString(inner) => {
|
6042 - | inner.as_validation_exception_field(path + "/patternString")
|
6043 - | }
|
6044 - | ConstraintViolation::MapOfPatternString(inner) => {
|
6045 - | inner.as_validation_exception_field(path + "/mapOfPatternString")
|
6046 - | }
|
6047 - | ConstraintViolation::ListOfPatternString(inner) => {
|
6048 - | inner.as_validation_exception_field(path + "/listOfPatternString")
|
6049 - | }
|
6050 - | ConstraintViolation::SetOfPatternString(inner) => {
|
6051 - | inner.as_validation_exception_field(path + "/setOfPatternString")
|
6052 - | }
|
6053 - | ConstraintViolation::LengthLengthPatternString(inner) => {
|
6054 - | inner.as_validation_exception_field(path + "/lengthLengthPatternString")
|
6055 - | }
|
6056 - | ConstraintViolation::MapOfLengthPatternString(inner) => {
|
6057 - | inner.as_validation_exception_field(path + "/mapOfLengthPatternString")
|
6058 - | }
|
6059 - | ConstraintViolation::ListOfLengthPatternString(inner) => {
|
6060 - | inner.as_validation_exception_field(path + "/listOfLengthPatternString")
|
6061 - | }
|
6062 - | ConstraintViolation::SetOfLengthPatternString(inner) => {
|
6063 - | inner.as_validation_exception_field(path + "/setOfLengthPatternString")
|
6064 - | }
|
6065 - | ConstraintViolation::LengthListOfPatternString(inner) => {
|
6066 - | inner.as_validation_exception_field(path + "/lengthListOfPatternString")
|
6067 - | }
|
6068 - | ConstraintViolation::LengthSetOfPatternString(inner) => {
|
6069 - | inner.as_validation_exception_field(path + "/lengthSetOfPatternString")
|
6070 - | }
|
6071 - | }
|
6072 - | }
|
6073 - | }
|
6074 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConA> {
|
6075 - | fn from(builder: Builder) -> Self {
|
6076 - | Self::Unconstrained(builder)
|
6077 - | }
|
6078 - | }
|
6079 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
6080 - | type Error = ConstraintViolation;
|
6081 - |
|
6082 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6083 - | builder.build()
|
6084 - | }
|
6085 - | }
|
6086 - | /// A builder for [`ConA`](crate::model::ConA).
|
6087 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6088 - | pub(crate) struct Builder {
|
6089 - | pub(crate) con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6090 - | pub(crate) opt_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6091 - | pub(crate) length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthString>>,
|
6092 - | pub(crate) min_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthString>>,
|
6093 - | pub(crate) max_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthString>>,
|
6094 - | pub(crate) fixed_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthString>>,
|
6095 - | pub(crate) length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthBlob>>,
|
6096 - | pub(crate) min_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>>,
|
6097 - | pub(crate) max_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>>,
|
6098 - | pub(crate) fixed_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>>,
|
6099 - | pub(crate) range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeInteger>>,
|
6100 - | pub(crate) min_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>>,
|
6101 - | pub(crate) max_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>>,
|
6102 - | pub(crate) fixed_value_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>>,
|
6103 - | pub(crate) range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeShort>>,
|
6104 - | pub(crate) min_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeShort>>,
|
6105 - | pub(crate) max_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>>,
|
6106 - | pub(crate) fixed_value_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueShort>>,
|
6107 - | pub(crate) range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeLong>>,
|
6108 - | pub(crate) min_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeLong>>,
|
6109 - | pub(crate) max_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>>,
|
6110 - | pub(crate) fixed_value_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueLong>>,
|
6111 - | pub(crate) range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::RangeByte>>,
|
6112 - | pub(crate) min_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MinRangeByte>>,
|
6113 - | pub(crate) max_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>>,
|
6114 - | pub(crate) fixed_value_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::FixedValueByte>>,
|
6115 - | pub(crate) con_b_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::con_b_list_constrained::ConBListConstrained>>,
|
6116 - | pub(crate) length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthList>>,
|
6117 - | pub(crate) sensitive_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>>,
|
6118 - | pub(crate) con_b_set: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6119 - | pub(crate) con_b_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6120 - | pub(crate) length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6121 - | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>,
|
6122 - | pub(crate) sparse_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_map_constrained::SparseMapConstrained>>,
|
6123 - | pub(crate) sparse_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::sparse_list_constrained::SparseListConstrained>>,
|
6124 - | pub(crate) sparse_length_map: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>>,
|
6125 - | pub(crate) sparse_length_list: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SparseLengthList>>,
|
6126 - | pub(crate) constrained_union: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>>,
|
6127 - | pub(crate) enum_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::EnumString>>,
|
6128 - | pub(crate) list_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>,
|
6129 - | pub(crate) set_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>>,
|
6130 - | pub(crate) map_of_length_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>,
|
6131 - | pub(crate) list_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>,
|
6132 - | pub(crate) map_of_length_blob: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>,
|
6133 - | pub(crate) list_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>,
|
6134 - | pub(crate) set_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>>,
|
6135 - | pub(crate) map_of_range_integer: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>,
|
6136 - | pub(crate) list_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>,
|
6137 - | pub(crate) set_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>>,
|
6138 - | pub(crate) map_of_range_short: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>,
|
6139 - | pub(crate) list_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>,
|
6140 - | pub(crate) set_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>>,
|
6141 - | pub(crate) map_of_range_long: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>,
|
6142 - | pub(crate) list_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>,
|
6143 - | pub(crate) set_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>>,
|
6144 - | pub(crate) map_of_range_byte: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>,
|
6145 - | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6146 - | pub(crate) pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::PatternString>>,
|
6147 - | pub(crate) map_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>,
|
6148 - | pub(crate) list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>,
|
6149 - | pub(crate) set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>>,
|
6150 - | pub(crate) length_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthPatternString>>,
|
6151 - | pub(crate) map_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>,
|
6152 - | pub(crate) list_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>,
|
6153 - | pub(crate) set_of_length_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>>,
|
6154 - | pub(crate) length_list_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>>,
|
6155 - | pub(crate) length_set_of_pattern_string: ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>>,
|
6156 - | }
|
6157 - | impl Builder {
|
6158 5431 | #[allow(missing_docs)] // documentation missing in model
|
6159 - | pub(crate) fn set_con_b(
|
5432 + | pub(crate) fn set_pattern_string(
|
6160 5433 | mut self,
|
6161 - | input: impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
5434 + | input: Option<
|
5435 + | impl ::std::convert::Into<
|
5436 + | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
5437 + | >,
|
5438 + | >,
|
6162 5439 | ) -> Self {
|
6163 - | self.con_b = Some(input.into());
|
5440 + | self.pattern_string = input.map(|v| v.into());
|
6164 5441 | self
|
6165 5442 | }
|
6166 5443 | #[allow(missing_docs)] // documentation missing in model
|
6167 - | pub(crate) fn set_opt_con_b(
|
5444 + | pub(crate) fn set_map_of_pattern_string(
|
6168 5445 | mut self,
|
6169 - | input: Option<
|
6170 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConB>>,
|
6171 - | >,
|
5446 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
6172 5447 | ) -> Self {
|
6173 - | self.opt_con_b = input.map(|v| v.into());
|
5448 + | self.map_of_pattern_string = input.map(|v| v.into());
|
6174 5449 | self
|
6175 5450 | }
|
6176 5451 | #[allow(missing_docs)] // documentation missing in model
|
6177 - | pub(crate) fn set_length_string(
|
5452 + | pub(crate) fn set_list_of_pattern_string(
|
6178 5453 | mut self,
|
6179 - | input: Option<
|
6180 - | impl ::std::convert::Into<
|
6181 - | crate::constrained::MaybeConstrained<crate::model::LengthString>,
|
6182 - | >,
|
6183 - | >,
|
5454 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
6184 5455 | ) -> Self {
|
6185 - | self.length_string = input.map(|v| v.into());
|
5456 + | self.list_of_pattern_string = input.map(|v| v.into());
|
6186 5457 | self
|
6187 5458 | }
|
6188 5459 | #[allow(missing_docs)] // documentation missing in model
|
6189 - | pub(crate) fn set_min_length_string(
|
5460 + | pub(crate) fn set_set_of_pattern_string(
|
6190 5461 | mut self,
|
6191 5462 | input: Option<
|
6192 5463 | impl ::std::convert::Into<
|
6193 - | crate::constrained::MaybeConstrained<crate::model::MinLengthString>,
|
5464 + | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
6194 5465 | >,
|
6195 5466 | >,
|
6196 5467 | ) -> Self {
|
6197 - | self.min_length_string = input.map(|v| v.into());
|
5468 + | self.set_of_pattern_string = input.map(|v| v.into());
|
6198 5469 | self
|
6199 5470 | }
|
6200 5471 | #[allow(missing_docs)] // documentation missing in model
|
6201 - | pub(crate) fn set_max_length_string(
|
5472 + | pub(crate) fn set_length_length_pattern_string(
|
6202 5473 | mut self,
|
6203 5474 | input: Option<
|
6204 5475 | impl ::std::convert::Into<
|
6205 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthString>,
|
5476 + | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
6206 5477 | >,
|
6207 5478 | >,
|
6208 5479 | ) -> Self {
|
6209 - | self.max_length_string = input.map(|v| v.into());
|
5480 + | self.length_length_pattern_string = input.map(|v| v.into());
|
6210 5481 | self
|
6211 5482 | }
|
6212 5483 | #[allow(missing_docs)] // documentation missing in model
|
6213 - | pub(crate) fn set_fixed_length_string(
|
5484 + | pub(crate) fn set_map_of_length_pattern_string(
|
6214 5485 | mut self,
|
6215 - | input: Option<
|
6216 - | impl ::std::convert::Into<
|
6217 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthString>,
|
6218 - | >,
|
6219 - | >,
|
5486 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
6220 5487 | ) -> Self {
|
6221 - | self.fixed_length_string = input.map(|v| v.into());
|
5488 + | self.map_of_length_pattern_string = input.map(|v| v.into());
|
6222 5489 | self
|
6223 5490 | }
|
6224 5491 | #[allow(missing_docs)] // documentation missing in model
|
6225 - | pub(crate) fn set_length_blob(
|
5492 + | pub(crate) fn set_list_of_length_pattern_string(
|
6226 5493 | mut self,
|
6227 - | input: Option<
|
6228 - | impl ::std::convert::Into<
|
6229 - | crate::constrained::MaybeConstrained<crate::model::LengthBlob>,
|
6230 - | >,
|
6231 - | >,
|
5494 + | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
6232 5495 | ) -> Self {
|
6233 - | self.length_blob = input.map(|v| v.into());
|
5496 + | self.list_of_length_pattern_string = input.map(|v| v.into());
|
6234 5497 | self
|
6235 5498 | }
|
6236 5499 | #[allow(missing_docs)] // documentation missing in model
|
6237 - | pub(crate) fn set_min_length_blob(
|
5500 + | pub(crate) fn set_set_of_length_pattern_string(
|
6238 5501 | mut self,
|
6239 5502 | input: Option<
|
6240 5503 | impl ::std::convert::Into<
|
6241 - | crate::constrained::MaybeConstrained<crate::model::MinLengthBlob>,
|
5504 + | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
6242 5505 | >,
|
6243 5506 | >,
|
6244 5507 | ) -> Self {
|
6245 - | self.min_length_blob = input.map(|v| v.into());
|
5508 + | self.set_of_length_pattern_string = input.map(|v| v.into());
|
6246 5509 | self
|
6247 5510 | }
|
6248 5511 | #[allow(missing_docs)] // documentation missing in model
|
6249 - | pub(crate) fn set_max_length_blob(
|
5512 + | pub(crate) fn set_length_list_of_pattern_string(
|
6250 5513 | mut self,
|
6251 5514 | input: Option<
|
6252 5515 | impl ::std::convert::Into<
|
6253 - | crate::constrained::MaybeConstrained<crate::model::MaxLengthBlob>,
|
5516 + | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
6254 5517 | >,
|
6255 5518 | >,
|
6256 5519 | ) -> Self {
|
6257 - | self.max_length_blob = input.map(|v| v.into());
|
5520 + | self.length_list_of_pattern_string = input.map(|v| v.into());
|
6258 5521 | self
|
6259 5522 | }
|
6260 5523 | #[allow(missing_docs)] // documentation missing in model
|
6261 - | pub(crate) fn set_fixed_length_blob(
|
5524 + | pub(crate) fn set_length_set_of_pattern_string(
|
6262 5525 | mut self,
|
6263 5526 | input: Option<
|
6264 5527 | impl ::std::convert::Into<
|
6265 - | crate::constrained::MaybeConstrained<crate::model::FixedLengthBlob>,
|
5528 + | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
6266 5529 | >,
|
6267 5530 | >,
|
6268 5531 | ) -> Self {
|
6269 - | self.fixed_length_blob = input.map(|v| v.into());
|
5532 + | self.length_set_of_pattern_string = input.map(|v| v.into());
|
6270 5533 | self
|
6271 5534 | }
|
6272 - | #[allow(missing_docs)] // documentation missing in model
|
6273 - | pub(crate) fn set_range_integer(
|
6274 - | mut self,
|
6275 - | input: impl ::std::convert::Into<
|
6276 - | crate::constrained::MaybeConstrained<crate::model::RangeInteger>,
|
6277 - | >,
|
6278 - | ) -> Self {
|
6279 - | self.range_integer = Some(input.into());
|
6280 - | self
|
6281 - | }
|
6282 - | #[allow(missing_docs)] // documentation missing in model
|
6283 - | pub(crate) fn set_min_range_integer(
|
6284 - | mut self,
|
6285 - | input: impl ::std::convert::Into<
|
6286 - | crate::constrained::MaybeConstrained<crate::model::MinRangeInteger>,
|
6287 - | >,
|
6288 - | ) -> Self {
|
6289 - | self.min_range_integer = Some(input.into());
|
6290 - | self
|
6291 - | }
|
6292 - | #[allow(missing_docs)] // documentation missing in model
|
6293 - | pub(crate) fn set_max_range_integer(
|
6294 - | mut self,
|
6295 - | input: impl ::std::convert::Into<
|
6296 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeInteger>,
|
6297 - | >,
|
6298 - | ) -> Self {
|
6299 - | self.max_range_integer = Some(input.into());
|
6300 - | self
|
6301 - | }
|
6302 - | #[allow(missing_docs)] // documentation missing in model
|
6303 - | pub(crate) fn set_fixed_value_integer(
|
6304 - | mut self,
|
6305 - | input: impl ::std::convert::Into<
|
6306 - | crate::constrained::MaybeConstrained<crate::model::FixedValueInteger>,
|
6307 - | >,
|
6308 - | ) -> Self {
|
6309 - | self.fixed_value_integer = Some(input.into());
|
6310 - | self
|
6311 - | }
|
6312 - | #[allow(missing_docs)] // documentation missing in model
|
6313 - | pub(crate) fn set_range_short(
|
6314 - | mut self,
|
6315 - | input: impl ::std::convert::Into<
|
6316 - | crate::constrained::MaybeConstrained<crate::model::RangeShort>,
|
6317 - | >,
|
6318 - | ) -> Self {
|
6319 - | self.range_short = Some(input.into());
|
6320 - | self
|
6321 - | }
|
6322 - | #[allow(missing_docs)] // documentation missing in model
|
6323 - | pub(crate) fn set_min_range_short(
|
6324 - | mut self,
|
6325 - | input: impl ::std::convert::Into<
|
6326 - | crate::constrained::MaybeConstrained<crate::model::MinRangeShort>,
|
6327 - | >,
|
6328 - | ) -> Self {
|
6329 - | self.min_range_short = Some(input.into());
|
6330 - | self
|
6331 - | }
|
6332 - | #[allow(missing_docs)] // documentation missing in model
|
6333 - | pub(crate) fn set_max_range_short(
|
6334 - | mut self,
|
6335 - | input: impl ::std::convert::Into<
|
6336 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeShort>,
|
6337 - | >,
|
6338 - | ) -> Self {
|
6339 - | self.max_range_short = Some(input.into());
|
6340 - | self
|
6341 - | }
|
6342 - | #[allow(missing_docs)] // documentation missing in model
|
6343 - | pub(crate) fn set_fixed_value_short(
|
6344 - | mut self,
|
6345 - | input: impl ::std::convert::Into<
|
6346 - | crate::constrained::MaybeConstrained<crate::model::FixedValueShort>,
|
6347 - | >,
|
6348 - | ) -> Self {
|
6349 - | self.fixed_value_short = Some(input.into());
|
6350 - | self
|
6351 - | }
|
6352 - | #[allow(missing_docs)] // documentation missing in model
|
6353 - | pub(crate) fn set_range_long(
|
6354 - | mut self,
|
6355 - | input: impl ::std::convert::Into<
|
6356 - | crate::constrained::MaybeConstrained<crate::model::RangeLong>,
|
6357 - | >,
|
6358 - | ) -> Self {
|
6359 - | self.range_long = Some(input.into());
|
6360 - | self
|
6361 - | }
|
6362 - | #[allow(missing_docs)] // documentation missing in model
|
6363 - | pub(crate) fn set_min_range_long(
|
6364 - | mut self,
|
6365 - | input: impl ::std::convert::Into<
|
6366 - | crate::constrained::MaybeConstrained<crate::model::MinRangeLong>,
|
6367 - | >,
|
6368 - | ) -> Self {
|
6369 - | self.min_range_long = Some(input.into());
|
6370 - | self
|
6371 - | }
|
6372 - | #[allow(missing_docs)] // documentation missing in model
|
6373 - | pub(crate) fn set_max_range_long(
|
6374 - | mut self,
|
6375 - | input: impl ::std::convert::Into<
|
6376 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeLong>,
|
6377 - | >,
|
6378 - | ) -> Self {
|
6379 - | self.max_range_long = Some(input.into());
|
6380 - | self
|
6381 - | }
|
6382 - | #[allow(missing_docs)] // documentation missing in model
|
6383 - | pub(crate) fn set_fixed_value_long(
|
6384 - | mut self,
|
6385 - | input: impl ::std::convert::Into<
|
6386 - | crate::constrained::MaybeConstrained<crate::model::FixedValueLong>,
|
6387 - | >,
|
6388 - | ) -> Self {
|
6389 - | self.fixed_value_long = Some(input.into());
|
6390 - | self
|
6391 - | }
|
6392 - | #[allow(missing_docs)] // documentation missing in model
|
6393 - | pub(crate) fn set_range_byte(
|
6394 - | mut self,
|
6395 - | input: impl ::std::convert::Into<
|
6396 - | crate::constrained::MaybeConstrained<crate::model::RangeByte>,
|
6397 - | >,
|
6398 - | ) -> Self {
|
6399 - | self.range_byte = Some(input.into());
|
6400 - | self
|
6401 - | }
|
6402 - | #[allow(missing_docs)] // documentation missing in model
|
6403 - | pub(crate) fn set_min_range_byte(
|
6404 - | mut self,
|
6405 - | input: impl ::std::convert::Into<
|
6406 - | crate::constrained::MaybeConstrained<crate::model::MinRangeByte>,
|
6407 - | >,
|
6408 - | ) -> Self {
|
6409 - | self.min_range_byte = Some(input.into());
|
6410 - | self
|
6411 - | }
|
6412 - | #[allow(missing_docs)] // documentation missing in model
|
6413 - | pub(crate) fn set_max_range_byte(
|
6414 - | mut self,
|
6415 - | input: impl ::std::convert::Into<
|
6416 - | crate::constrained::MaybeConstrained<crate::model::MaxRangeByte>,
|
6417 - | >,
|
6418 - | ) -> Self {
|
6419 - | self.max_range_byte = Some(input.into());
|
6420 - | self
|
6421 - | }
|
6422 - | #[allow(missing_docs)] // documentation missing in model
|
6423 - | pub(crate) fn set_fixed_value_byte(
|
6424 - | mut self,
|
6425 - | input: impl ::std::convert::Into<
|
6426 - | crate::constrained::MaybeConstrained<crate::model::FixedValueByte>,
|
6427 - | >,
|
6428 - | ) -> Self {
|
6429 - | self.fixed_value_byte = Some(input.into());
|
6430 - | self
|
6431 - | }
|
6432 - | #[allow(missing_docs)] // documentation missing in model
|
6433 - | pub(crate) fn set_con_b_list(
|
6434 - | mut self,
|
6435 - | input: Option<
|
6436 - | impl ::std::convert::Into<
|
6437 - | crate::constrained::MaybeConstrained<
|
6438 - | crate::constrained::con_b_list_constrained::ConBListConstrained,
|
6439 - | >,
|
6440 - | >,
|
6441 - | >,
|
6442 - | ) -> Self {
|
6443 - | self.con_b_list = input.map(|v| v.into());
|
6444 - | self
|
6445 - | }
|
6446 - | #[allow(missing_docs)] // documentation missing in model
|
6447 - | pub(crate) fn set_length_list(
|
6448 - | mut self,
|
6449 - | input: Option<
|
6450 - | impl ::std::convert::Into<
|
6451 - | crate::constrained::MaybeConstrained<crate::model::LengthList>,
|
6452 - | >,
|
6453 - | >,
|
6454 - | ) -> Self {
|
6455 - | self.length_list = input.map(|v| v.into());
|
6456 - | self
|
6457 - | }
|
6458 - | #[allow(missing_docs)] // documentation missing in model
|
6459 - | pub(crate) fn set_sensitive_length_list(
|
6460 - | mut self,
|
6461 - | input: Option<
|
6462 - | impl ::std::convert::Into<
|
6463 - | crate::constrained::MaybeConstrained<crate::model::SensitiveLengthList>,
|
6464 - | >,
|
6465 - | >,
|
6466 - | ) -> Self {
|
6467 - | self.sensitive_length_list = input.map(|v| v.into());
|
6468 - | self
|
6469 - | }
|
6470 - | #[allow(missing_docs)] // documentation missing in model
|
6471 - | pub(crate) fn set_con_b_set(
|
6472 - | mut self,
|
6473 - | input: Option<
|
6474 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBSet>>,
|
6475 - | >,
|
6476 - | ) -> Self {
|
6477 - | self.con_b_set = input.map(|v| v.into());
|
6478 - | self
|
6479 - | }
|
6480 - | #[allow(missing_docs)] // documentation missing in model
|
6481 - | pub(crate) fn set_con_b_map(
|
6482 - | mut self,
|
6483 - | input: Option<
|
6484 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::ConBMap>>,
|
6485 - | >,
|
6486 - | ) -> Self {
|
6487 - | self.con_b_map = input.map(|v| v.into());
|
6488 - | self
|
6489 - | }
|
6490 - | #[allow(missing_docs)] // documentation missing in model
|
6491 - | pub(crate) fn set_length_map(
|
6492 - | mut self,
|
6493 - | input: Option<
|
6494 - | impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::model::LengthMap>>,
|
6495 - | >,
|
6496 - | ) -> Self {
|
6497 - | self.length_map = input.map(|v| v.into());
|
6498 - | self
|
6499 - | }
|
6500 - | #[allow(missing_docs)] // documentation missing in model
|
6501 - | pub(crate) fn set_map_of_map_of_list_of_list_of_con_b(
|
6502 - | mut self,
|
6503 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_map_of_list_of_list_of_con_b_constrained::MapOfMapOfListOfListOfConBConstrained>>>,
|
6504 - | ) -> Self {
|
6505 - | self.map_of_map_of_list_of_list_of_con_b = input.map(|v| v.into());
|
6506 - | self
|
6507 - | }
|
6508 - | #[allow(missing_docs)] // documentation missing in model
|
6509 - | pub(crate) fn set_sparse_map(
|
6510 - | mut self,
|
6511 - | input: Option<
|
6512 - | impl ::std::convert::Into<
|
6513 - | crate::constrained::MaybeConstrained<
|
6514 - | crate::constrained::sparse_map_constrained::SparseMapConstrained,
|
6515 - | >,
|
6516 - | >,
|
6517 - | >,
|
6518 - | ) -> Self {
|
6519 - | self.sparse_map = input.map(|v| v.into());
|
6520 - | self
|
6521 - | }
|
6522 - | #[allow(missing_docs)] // documentation missing in model
|
6523 - | pub(crate) fn set_sparse_list(
|
6524 - | mut self,
|
6525 - | input: Option<
|
6526 - | impl ::std::convert::Into<
|
6527 - | crate::constrained::MaybeConstrained<
|
6528 - | crate::constrained::sparse_list_constrained::SparseListConstrained,
|
6529 - | >,
|
6530 - | >,
|
6531 - | >,
|
6532 - | ) -> Self {
|
6533 - | self.sparse_list = input.map(|v| v.into());
|
6534 - | self
|
6535 - | }
|
6536 - | #[allow(missing_docs)] // documentation missing in model
|
6537 - | pub(crate) fn set_sparse_length_map(
|
6538 - | mut self,
|
6539 - | input: Option<
|
6540 - | impl ::std::convert::Into<
|
6541 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthMap>,
|
6542 - | >,
|
6543 - | >,
|
6544 - | ) -> Self {
|
6545 - | self.sparse_length_map = input.map(|v| v.into());
|
6546 - | self
|
6547 - | }
|
6548 - | #[allow(missing_docs)] // documentation missing in model
|
6549 - | pub(crate) fn set_sparse_length_list(
|
6550 - | mut self,
|
6551 - | input: Option<
|
6552 - | impl ::std::convert::Into<
|
6553 - | crate::constrained::MaybeConstrained<crate::model::SparseLengthList>,
|
6554 - | >,
|
6555 - | >,
|
6556 - | ) -> Self {
|
6557 - | self.sparse_length_list = input.map(|v| v.into());
|
6558 - | self
|
6559 - | }
|
6560 - | /// A union with constrained members.
|
6561 - | pub(crate) fn set_constrained_union(
|
6562 - | mut self,
|
6563 - | input: Option<
|
6564 - | impl ::std::convert::Into<
|
6565 - | crate::constrained::MaybeConstrained<crate::model::ConstrainedUnion>,
|
6566 - | >,
|
6567 - | >,
|
6568 - | ) -> Self {
|
6569 - | self.constrained_union = input.map(|v| v.into());
|
6570 - | self
|
6571 - | }
|
6572 - | #[allow(missing_docs)] // documentation missing in model
|
6573 - | pub(crate) fn set_enum_string(
|
6574 - | mut self,
|
6575 - | input: Option<
|
6576 - | impl ::std::convert::Into<
|
6577 - | crate::constrained::MaybeConstrained<crate::model::EnumString>,
|
6578 - | >,
|
6579 - | >,
|
6580 - | ) -> Self {
|
6581 - | self.enum_string = input.map(|v| v.into());
|
6582 - | self
|
6583 - | }
|
6584 - | #[allow(missing_docs)] // documentation missing in model
|
6585 - | pub(crate) fn set_list_of_length_string(
|
6586 - | mut self,
|
6587 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_string_constrained::ListOfLengthStringConstrained>>>,
|
6588 - | ) -> Self {
|
6589 - | self.list_of_length_string = input.map(|v| v.into());
|
6590 - | self
|
6591 - | }
|
6592 - | #[allow(missing_docs)] // documentation missing in model
|
6593 - | pub(crate) fn set_set_of_length_string(
|
6594 - | mut self,
|
6595 - | input: Option<
|
6596 - | impl ::std::convert::Into<
|
6597 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthString>,
|
6598 - | >,
|
6599 - | >,
|
6600 - | ) -> Self {
|
6601 - | self.set_of_length_string = input.map(|v| v.into());
|
6602 - | self
|
6603 - | }
|
6604 - | #[allow(missing_docs)] // documentation missing in model
|
6605 - | pub(crate) fn set_map_of_length_string(
|
6606 - | mut self,
|
6607 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_string_constrained::MapOfLengthStringConstrained>>>,
|
6608 - | ) -> Self {
|
6609 - | self.map_of_length_string = input.map(|v| v.into());
|
6610 - | self
|
6611 - | }
|
6612 - | #[allow(missing_docs)] // documentation missing in model
|
6613 - | pub(crate) fn set_list_of_length_blob(
|
6614 - | mut self,
|
6615 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_blob_constrained::ListOfLengthBlobConstrained>>>,
|
6616 - | ) -> Self {
|
6617 - | self.list_of_length_blob = input.map(|v| v.into());
|
6618 - | self
|
6619 - | }
|
6620 - | #[allow(missing_docs)] // documentation missing in model
|
6621 - | pub(crate) fn set_map_of_length_blob(
|
6622 - | mut self,
|
6623 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_blob_constrained::MapOfLengthBlobConstrained>>>,
|
6624 - | ) -> Self {
|
6625 - | self.map_of_length_blob = input.map(|v| v.into());
|
6626 - | self
|
6627 - | }
|
6628 - | #[allow(missing_docs)] // documentation missing in model
|
6629 - | pub(crate) fn set_list_of_range_integer(
|
6630 - | mut self,
|
6631 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_integer_constrained::ListOfRangeIntegerConstrained>>>,
|
6632 - | ) -> Self {
|
6633 - | self.list_of_range_integer = input.map(|v| v.into());
|
6634 - | self
|
6635 - | }
|
6636 - | #[allow(missing_docs)] // documentation missing in model
|
6637 - | pub(crate) fn set_set_of_range_integer(
|
6638 - | mut self,
|
6639 - | input: Option<
|
6640 - | impl ::std::convert::Into<
|
6641 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeInteger>,
|
6642 - | >,
|
6643 - | >,
|
6644 - | ) -> Self {
|
6645 - | self.set_of_range_integer = input.map(|v| v.into());
|
6646 - | self
|
6647 - | }
|
6648 - | #[allow(missing_docs)] // documentation missing in model
|
6649 - | pub(crate) fn set_map_of_range_integer(
|
6650 - | mut self,
|
6651 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_integer_constrained::MapOfRangeIntegerConstrained>>>,
|
6652 - | ) -> Self {
|
6653 - | self.map_of_range_integer = input.map(|v| v.into());
|
6654 - | self
|
6655 - | }
|
6656 - | #[allow(missing_docs)] // documentation missing in model
|
6657 - | pub(crate) fn set_list_of_range_short(
|
6658 - | mut self,
|
6659 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_short_constrained::ListOfRangeShortConstrained>>>,
|
6660 - | ) -> Self {
|
6661 - | self.list_of_range_short = input.map(|v| v.into());
|
6662 - | self
|
6663 - | }
|
6664 - | #[allow(missing_docs)] // documentation missing in model
|
6665 - | pub(crate) fn set_set_of_range_short(
|
6666 - | mut self,
|
6667 - | input: Option<
|
6668 - | impl ::std::convert::Into<
|
6669 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeShort>,
|
6670 - | >,
|
6671 - | >,
|
6672 - | ) -> Self {
|
6673 - | self.set_of_range_short = input.map(|v| v.into());
|
6674 - | self
|
6675 - | }
|
6676 - | #[allow(missing_docs)] // documentation missing in model
|
6677 - | pub(crate) fn set_map_of_range_short(
|
6678 - | mut self,
|
6679 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_short_constrained::MapOfRangeShortConstrained>>>,
|
6680 - | ) -> Self {
|
6681 - | self.map_of_range_short = input.map(|v| v.into());
|
6682 - | self
|
6683 - | }
|
6684 - | #[allow(missing_docs)] // documentation missing in model
|
6685 - | pub(crate) fn set_list_of_range_long(
|
6686 - | mut self,
|
6687 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_long_constrained::ListOfRangeLongConstrained>>>,
|
6688 - | ) -> Self {
|
6689 - | self.list_of_range_long = input.map(|v| v.into());
|
6690 - | self
|
6691 - | }
|
6692 - | #[allow(missing_docs)] // documentation missing in model
|
6693 - | pub(crate) fn set_set_of_range_long(
|
6694 - | mut self,
|
6695 - | input: Option<
|
6696 - | impl ::std::convert::Into<
|
6697 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeLong>,
|
6698 - | >,
|
6699 - | >,
|
6700 - | ) -> Self {
|
6701 - | self.set_of_range_long = input.map(|v| v.into());
|
6702 - | self
|
6703 - | }
|
6704 - | #[allow(missing_docs)] // documentation missing in model
|
6705 - | pub(crate) fn set_map_of_range_long(
|
6706 - | mut self,
|
6707 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_long_constrained::MapOfRangeLongConstrained>>>,
|
6708 - | ) -> Self {
|
6709 - | self.map_of_range_long = input.map(|v| v.into());
|
6710 - | self
|
6711 - | }
|
6712 - | #[allow(missing_docs)] // documentation missing in model
|
6713 - | pub(crate) fn set_list_of_range_byte(
|
6714 - | mut self,
|
6715 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_range_byte_constrained::ListOfRangeByteConstrained>>>,
|
6716 - | ) -> Self {
|
6717 - | self.list_of_range_byte = input.map(|v| v.into());
|
6718 - | self
|
6719 - | }
|
6720 - | #[allow(missing_docs)] // documentation missing in model
|
6721 - | pub(crate) fn set_set_of_range_byte(
|
6722 - | mut self,
|
6723 - | input: Option<
|
6724 - | impl ::std::convert::Into<
|
6725 - | crate::constrained::MaybeConstrained<crate::model::SetOfRangeByte>,
|
6726 - | >,
|
6727 - | >,
|
6728 - | ) -> Self {
|
6729 - | self.set_of_range_byte = input.map(|v| v.into());
|
6730 - | self
|
6731 - | }
|
6732 - | #[allow(missing_docs)] // documentation missing in model
|
6733 - | pub(crate) fn set_map_of_range_byte(
|
6734 - | mut self,
|
6735 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_range_byte_constrained::MapOfRangeByteConstrained>>>,
|
6736 - | ) -> Self {
|
6737 - | self.map_of_range_byte = input.map(|v| v.into());
|
6738 - | self
|
6739 - | }
|
6740 - | #[allow(missing_docs)] // documentation missing in model
|
6741 - | pub(crate) fn set_non_streaming_blob(
|
6742 - | mut self,
|
6743 - | input: Option<impl ::std::convert::Into<::aws_smithy_types::Blob>>,
|
6744 - | ) -> Self {
|
6745 - | self.non_streaming_blob = input.map(|v| v.into());
|
6746 - | self
|
6747 - | }
|
6748 - | #[allow(missing_docs)] // documentation missing in model
|
6749 - | pub(crate) fn set_pattern_string(
|
6750 - | mut self,
|
6751 - | input: Option<
|
6752 - | impl ::std::convert::Into<
|
6753 - | crate::constrained::MaybeConstrained<crate::model::PatternString>,
|
6754 - | >,
|
6755 - | >,
|
6756 - | ) -> Self {
|
6757 - | self.pattern_string = input.map(|v| v.into());
|
6758 - | self
|
6759 - | }
|
6760 - | #[allow(missing_docs)] // documentation missing in model
|
6761 - | pub(crate) fn set_map_of_pattern_string(
|
6762 - | mut self,
|
6763 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_pattern_string_constrained::MapOfPatternStringConstrained>>>,
|
6764 - | ) -> Self {
|
6765 - | self.map_of_pattern_string = input.map(|v| v.into());
|
6766 - | self
|
6767 - | }
|
6768 - | #[allow(missing_docs)] // documentation missing in model
|
6769 - | pub(crate) fn set_list_of_pattern_string(
|
6770 - | mut self,
|
6771 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_pattern_string_constrained::ListOfPatternStringConstrained>>>,
|
6772 - | ) -> Self {
|
6773 - | self.list_of_pattern_string = input.map(|v| v.into());
|
6774 - | self
|
6775 - | }
|
6776 - | #[allow(missing_docs)] // documentation missing in model
|
6777 - | pub(crate) fn set_set_of_pattern_string(
|
6778 - | mut self,
|
6779 - | input: Option<
|
6780 - | impl ::std::convert::Into<
|
6781 - | crate::constrained::MaybeConstrained<crate::model::SetOfPatternString>,
|
6782 - | >,
|
6783 - | >,
|
6784 - | ) -> Self {
|
6785 - | self.set_of_pattern_string = input.map(|v| v.into());
|
6786 - | self
|
6787 - | }
|
6788 - | #[allow(missing_docs)] // documentation missing in model
|
6789 - | pub(crate) fn set_length_length_pattern_string(
|
6790 - | mut self,
|
6791 - | input: Option<
|
6792 - | impl ::std::convert::Into<
|
6793 - | crate::constrained::MaybeConstrained<crate::model::LengthPatternString>,
|
6794 - | >,
|
6795 - | >,
|
6796 - | ) -> Self {
|
6797 - | self.length_length_pattern_string = input.map(|v| v.into());
|
6798 - | self
|
6799 - | }
|
6800 - | #[allow(missing_docs)] // documentation missing in model
|
6801 - | pub(crate) fn set_map_of_length_pattern_string(
|
6802 - | mut self,
|
6803 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::map_of_length_pattern_string_constrained::MapOfLengthPatternStringConstrained>>>,
|
6804 - | ) -> Self {
|
6805 - | self.map_of_length_pattern_string = input.map(|v| v.into());
|
6806 - | self
|
6807 - | }
|
6808 - | #[allow(missing_docs)] // documentation missing in model
|
6809 - | pub(crate) fn set_list_of_length_pattern_string(
|
6810 - | mut self,
|
6811 - | input: Option<impl ::std::convert::Into<crate::constrained::MaybeConstrained<crate::constrained::list_of_length_pattern_string_constrained::ListOfLengthPatternStringConstrained>>>,
|
6812 - | ) -> Self {
|
6813 - | self.list_of_length_pattern_string = input.map(|v| v.into());
|
6814 - | self
|
6815 - | }
|
6816 - | #[allow(missing_docs)] // documentation missing in model
|
6817 - | pub(crate) fn set_set_of_length_pattern_string(
|
6818 - | mut self,
|
6819 - | input: Option<
|
6820 - | impl ::std::convert::Into<
|
6821 - | crate::constrained::MaybeConstrained<crate::model::SetOfLengthPatternString>,
|
6822 - | >,
|
6823 - | >,
|
6824 - | ) -> Self {
|
6825 - | self.set_of_length_pattern_string = input.map(|v| v.into());
|
6826 - | self
|
6827 - | }
|
6828 - | #[allow(missing_docs)] // documentation missing in model
|
6829 - | pub(crate) fn set_length_list_of_pattern_string(
|
6830 - | mut self,
|
6831 - | input: Option<
|
6832 - | impl ::std::convert::Into<
|
6833 - | crate::constrained::MaybeConstrained<crate::model::LengthListOfPatternString>,
|
6834 - | >,
|
6835 - | >,
|
6836 - | ) -> Self {
|
6837 - | self.length_list_of_pattern_string = input.map(|v| v.into());
|
6838 - | self
|
6839 - | }
|
6840 - | #[allow(missing_docs)] // documentation missing in model
|
6841 - | pub(crate) fn set_length_set_of_pattern_string(
|
6842 - | mut self,
|
6843 - | input: Option<
|
6844 - | impl ::std::convert::Into<
|
6845 - | crate::constrained::MaybeConstrained<crate::model::LengthSetOfPatternString>,
|
6846 - | >,
|
6847 - | >,
|
6848 - | ) -> Self {
|
6849 - | self.length_set_of_pattern_string = input.map(|v| v.into());
|
6850 - | self
|
6851 - | }
|
6852 - | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
6853 - | ///
|
6854 - | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
6855 - | ///
|
6856 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
6857 - | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
6858 - | self.build_enforcing_all_constraints()
|
5535 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
5536 + | ///
|
5537 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if a [`ConstraintViolation`] occurs.
|
5538 + | ///
|
5539 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
5540 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
5541 + | self.build_enforcing_all_constraints()
|
6859 5542 | }
|
6860 5543 | fn build_enforcing_all_constraints(
|
6861 5544 | self,
|
6862 5545 | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
6863 5546 | Ok(crate::model::ConA {
|
6864 5547 | con_b: self
|
6865 5548 | .con_b
|
6866 5549 | .map(|v| match v {
|
6867 5550 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6868 5551 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7355 6038 | res.map(|v| v.into())
|
7356 6039 | .map_err(ConstraintViolation::ListOfRangeLong)
|
7357 6040 | })
|
7358 6041 | .transpose()?,
|
7359 6042 | set_of_range_long: self
|
7360 6043 | .set_of_range_long
|
7361 6044 | .map(|v| match v {
|
7362 6045 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7363 6046 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7364 6047 | })
|
7365 - | .map(|res| res.map_err(ConstraintViolation::SetOfRangeLong))
|
6048 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeLong))
|
6049 + | .transpose()?
|
6050 + | .map(|v: crate::model::SetOfRangeLong| v.into()),
|
6051 + | map_of_range_long: self
|
6052 + | .map_of_range_long
|
6053 + | .map(|v| match v {
|
6054 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6055 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6056 + | })
|
6057 + | .map(|res| {
|
6058 + | res.map(|v| v.into())
|
6059 + | .map_err(ConstraintViolation::MapOfRangeLong)
|
6060 + | })
|
6061 + | .transpose()?,
|
6062 + | list_of_range_byte: self
|
6063 + | .list_of_range_byte
|
6064 + | .map(|v| match v {
|
6065 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6066 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6067 + | })
|
6068 + | .map(|res| {
|
6069 + | res.map(|v| v.into())
|
6070 + | .map_err(ConstraintViolation::ListOfRangeByte)
|
6071 + | })
|
6072 + | .transpose()?,
|
6073 + | set_of_range_byte: self
|
6074 + | .set_of_range_byte
|
6075 + | .map(|v| match v {
|
6076 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6077 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6078 + | })
|
6079 + | .map(|res| res.map_err(ConstraintViolation::SetOfRangeByte))
|
6080 + | .transpose()?
|
6081 + | .map(|v: crate::model::SetOfRangeByte| v.into()),
|
6082 + | map_of_range_byte: self
|
6083 + | .map_of_range_byte
|
6084 + | .map(|v| match v {
|
6085 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6086 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6087 + | })
|
6088 + | .map(|res| {
|
6089 + | res.map(|v| v.into())
|
6090 + | .map_err(ConstraintViolation::MapOfRangeByte)
|
6091 + | })
|
6092 + | .transpose()?,
|
6093 + | non_streaming_blob: self.non_streaming_blob,
|
6094 + | pattern_string: self
|
6095 + | .pattern_string
|
6096 + | .map(|v| match v {
|
6097 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6098 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6099 + | })
|
6100 + | .map(|res| res.map_err(ConstraintViolation::PatternString))
|
6101 + | .transpose()?
|
6102 + | .map(|v: crate::model::PatternString| v.into()),
|
6103 + | map_of_pattern_string: self
|
6104 + | .map_of_pattern_string
|
6105 + | .map(|v| match v {
|
6106 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6107 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6108 + | })
|
6109 + | .map(|res| {
|
6110 + | res.map(|v| v.into())
|
6111 + | .map_err(ConstraintViolation::MapOfPatternString)
|
6112 + | })
|
6113 + | .transpose()?,
|
6114 + | list_of_pattern_string: self
|
6115 + | .list_of_pattern_string
|
6116 + | .map(|v| match v {
|
6117 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6118 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6119 + | })
|
6120 + | .map(|res| {
|
6121 + | res.map(|v| v.into())
|
6122 + | .map_err(ConstraintViolation::ListOfPatternString)
|
6123 + | })
|
6124 + | .transpose()?,
|
6125 + | set_of_pattern_string: self
|
6126 + | .set_of_pattern_string
|
6127 + | .map(|v| match v {
|
6128 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6129 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6130 + | })
|
6131 + | .map(|res| res.map_err(ConstraintViolation::SetOfPatternString))
|
6132 + | .transpose()?
|
6133 + | .map(|v: crate::model::SetOfPatternString| v.into()),
|
6134 + | length_length_pattern_string: self
|
6135 + | .length_length_pattern_string
|
6136 + | .map(|v| match v {
|
6137 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6138 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6139 + | })
|
6140 + | .map(|res| res.map_err(ConstraintViolation::LengthLengthPatternString))
|
7366 6141 | .transpose()?
|
7367 - | .map(|v: crate::model::SetOfRangeLong| v.into()),
|
7368 - | map_of_range_long: self
|
7369 - | .map_of_range_long
|
6142 + | .map(|v: crate::model::LengthPatternString| v.into()),
|
6143 + | map_of_length_pattern_string: self
|
6144 + | .map_of_length_pattern_string
|
7370 6145 | .map(|v| match v {
|
7371 6146 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7372 6147 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7373 6148 | })
|
7374 6149 | .map(|res| {
|
7375 6150 | res.map(|v| v.into())
|
7376 - | .map_err(ConstraintViolation::MapOfRangeLong)
|
6151 + | .map_err(ConstraintViolation::MapOfLengthPatternString)
|
7377 6152 | })
|
7378 6153 | .transpose()?,
|
7379 - | list_of_range_byte: self
|
7380 - | .list_of_range_byte
|
6154 + | list_of_length_pattern_string: self
|
6155 + | .list_of_length_pattern_string
|
7381 6156 | .map(|v| match v {
|
7382 6157 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7383 6158 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7384 6159 | })
|
7385 6160 | .map(|res| {
|
7386 6161 | res.map(|v| v.into())
|
7387 - | .map_err(ConstraintViolation::ListOfRangeByte)
|
6162 + | .map_err(ConstraintViolation::ListOfLengthPatternString)
|
7388 6163 | })
|
7389 6164 | .transpose()?,
|
7390 - | set_of_range_byte: self
|
7391 - | .set_of_range_byte
|
6165 + | set_of_length_pattern_string: self
|
6166 + | .set_of_length_pattern_string
|
7392 6167 | .map(|v| match v {
|
7393 6168 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7394 6169 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7395 6170 | })
|
7396 - | .map(|res| res.map_err(ConstraintViolation::SetOfRangeByte))
|
6171 + | .map(|res| res.map_err(ConstraintViolation::SetOfLengthPatternString))
|
7397 6172 | .transpose()?
|
7398 - | .map(|v: crate::model::SetOfRangeByte| v.into()),
|
7399 - | map_of_range_byte: self
|
7400 - | .map_of_range_byte
|
6173 + | .map(|v: crate::model::SetOfLengthPatternString| v.into()),
|
6174 + | length_list_of_pattern_string: self
|
6175 + | .length_list_of_pattern_string
|
7401 6176 | .map(|v| match v {
|
7402 6177 | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7403 6178 | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7404 6179 | })
|
7405 - | .map(|res| {
|
7406 - | res.map(|v| v.into())
|
7407 - | .map_err(ConstraintViolation::MapOfRangeByte)
|
6180 + | .map(|res| res.map_err(ConstraintViolation::LengthListOfPatternString))
|
6181 + | .transpose()?
|
6182 + | .map(|v: crate::model::LengthListOfPatternString| v.into()),
|
6183 + | length_set_of_pattern_string: self
|
6184 + | .length_set_of_pattern_string
|
6185 + | .map(|v| match v {
|
6186 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
6187 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7408 6188 | })
|
7409 - | .transpose()?,
|
6189 + | .map(|res| res.map_err(ConstraintViolation::LengthSetOfPatternString))
|
6190 + | .transpose()?
|
6191 + | .map(|v: crate::model::LengthSetOfPatternString| v.into()),
|
6192 + | })
|
6193 + | }
|
6194 + | }
|
6195 + | }
|
6196 + | /// See [`ConA`](crate::model::ConA).
|
6197 + | pub mod con_a {
|
6198 + |
|
6199 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6200 + | /// Holds one variant for each of the ways the builder can fail.
|
6201 + | #[allow(clippy::enum_variant_names)]
|
6202 + | pub enum ConstraintViolation {
|
6203 + | /// `con_b` was not provided but it is required when building `ConA`.
|
6204 + | MissingConB,
|
6205 + | }
|
6206 + | impl ::std::fmt::Display for ConstraintViolation {
|
6207 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6208 + | match self {
|
6209 + | ConstraintViolation::MissingConB => write!(
|
6210 + | f,
|
6211 + | "`con_b` was not provided but it is required when building `ConA`"
|
6212 + | ),
|
6213 + | }
|
6214 + | }
|
6215 + | }
|
6216 + | impl ::std::error::Error for ConstraintViolation {}
|
6217 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
6218 + | type Error = ConstraintViolation;
|
6219 + |
|
6220 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
6221 + | builder.build()
|
6222 + | }
|
6223 + | }
|
6224 + | /// A builder for [`ConA`](crate::model::ConA).
|
6225 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6226 + | pub struct Builder {
|
6227 + | pub(crate) con_b: ::std::option::Option<crate::model::ConB>,
|
6228 + | pub(crate) opt_con_b: ::std::option::Option<crate::model::ConB>,
|
6229 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
6230 + | pub(crate) min_length_string: ::std::option::Option<::std::string::String>,
|
6231 + | pub(crate) max_length_string: ::std::option::Option<::std::string::String>,
|
6232 + | pub(crate) fixed_length_string: ::std::option::Option<::std::string::String>,
|
6233 + | pub(crate) length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6234 + | pub(crate) min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6235 + | pub(crate) max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6236 + | pub(crate) fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6237 + | pub(crate) range_integer: ::std::option::Option<i32>,
|
6238 + | pub(crate) min_range_integer: ::std::option::Option<i32>,
|
6239 + | pub(crate) max_range_integer: ::std::option::Option<i32>,
|
6240 + | pub(crate) fixed_value_integer: ::std::option::Option<i32>,
|
6241 + | pub(crate) range_short: ::std::option::Option<i16>,
|
6242 + | pub(crate) min_range_short: ::std::option::Option<i16>,
|
6243 + | pub(crate) max_range_short: ::std::option::Option<i16>,
|
6244 + | pub(crate) fixed_value_short: ::std::option::Option<i16>,
|
6245 + | pub(crate) range_long: ::std::option::Option<i64>,
|
6246 + | pub(crate) min_range_long: ::std::option::Option<i64>,
|
6247 + | pub(crate) max_range_long: ::std::option::Option<i64>,
|
6248 + | pub(crate) fixed_value_long: ::std::option::Option<i64>,
|
6249 + | pub(crate) range_byte: ::std::option::Option<i8>,
|
6250 + | pub(crate) min_range_byte: ::std::option::Option<i8>,
|
6251 + | pub(crate) max_range_byte: ::std::option::Option<i8>,
|
6252 + | pub(crate) fixed_value_byte: ::std::option::Option<i8>,
|
6253 + | pub(crate) con_b_list:
|
6254 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
6255 + | pub(crate) length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6256 + | pub(crate) sensitive_length_list:
|
6257 + | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
6258 + | pub(crate) con_b_set:
|
6259 + | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
6260 + | pub(crate) con_b_map: ::std::option::Option<
|
6261 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6262 + | >,
|
6263 + | pub(crate) length_map: ::std::option::Option<
|
6264 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6265 + | >,
|
6266 + | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
6267 + | ::std::collections::HashMap<
|
6268 + | ::std::string::String,
|
6269 + | ::std::collections::HashMap<
|
6270 + | ::std::string::String,
|
6271 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
6272 + | >,
|
6273 + | >,
|
6274 + | >,
|
6275 + | pub(crate) sparse_map: ::std::option::Option<
|
6276 + | ::std::collections::HashMap<
|
6277 + | ::std::string::String,
|
6278 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6279 + | >,
|
6280 + | >,
|
6281 + | pub(crate) sparse_list:
|
6282 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
6283 + | pub(crate) sparse_length_map: ::std::option::Option<
|
6284 + | ::std::collections::HashMap<
|
6285 + | ::std::string::String,
|
6286 + | ::std::option::Option<::std::string::String>,
|
6287 + | >,
|
6288 + | >,
|
6289 + | pub(crate) sparse_length_list:
|
6290 + | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
6291 + | pub(crate) constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
6292 + | pub(crate) enum_string: ::std::option::Option<crate::model::EnumString>,
|
6293 + | pub(crate) list_of_length_string:
|
6294 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6295 + | pub(crate) set_of_length_string:
|
6296 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6297 + | pub(crate) map_of_length_string: ::std::option::Option<
|
6298 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6299 + | >,
|
6300 + | pub(crate) list_of_length_blob:
|
6301 + | ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
6302 + | pub(crate) map_of_length_blob: ::std::option::Option<
|
6303 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
6304 + | >,
|
6305 + | pub(crate) list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
6306 + | pub(crate) set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
6307 + | pub(crate) map_of_range_integer:
|
6308 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
6309 + | pub(crate) list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
6310 + | pub(crate) set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
6311 + | pub(crate) map_of_range_short:
|
6312 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
6313 + | pub(crate) list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
6314 + | pub(crate) set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
6315 + | pub(crate) map_of_range_long:
|
6316 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
6317 + | pub(crate) list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
6318 + | pub(crate) set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
6319 + | pub(crate) map_of_range_byte:
|
6320 + | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
6321 + | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
6322 + | pub(crate) pattern_string: ::std::option::Option<::std::string::String>,
|
6323 + | pub(crate) map_of_pattern_string: ::std::option::Option<
|
6324 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6325 + | >,
|
6326 + | pub(crate) list_of_pattern_string:
|
6327 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6328 + | pub(crate) set_of_pattern_string:
|
6329 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6330 + | pub(crate) length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
6331 + | pub(crate) map_of_length_pattern_string: ::std::option::Option<
|
6332 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6333 + | >,
|
6334 + | pub(crate) list_of_length_pattern_string:
|
6335 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6336 + | pub(crate) set_of_length_pattern_string:
|
6337 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6338 + | pub(crate) length_list_of_pattern_string:
|
6339 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6340 + | pub(crate) length_set_of_pattern_string:
|
6341 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6342 + | }
|
6343 + | impl Builder {
|
6344 + | #[allow(missing_docs)] // documentation missing in model
|
6345 + | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
6346 + | self.con_b = Some(input);
|
6347 + | self
|
6348 + | }
|
6349 + | #[allow(missing_docs)] // documentation missing in model
|
6350 + | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
6351 + | self.opt_con_b = input;
|
6352 + | self
|
6353 + | }
|
6354 + | #[allow(missing_docs)] // documentation missing in model
|
6355 + | pub fn length_string(
|
6356 + | mut self,
|
6357 + | input: ::std::option::Option<::std::string::String>,
|
6358 + | ) -> Self {
|
6359 + | self.length_string = input;
|
6360 + | self
|
6361 + | }
|
6362 + | #[allow(missing_docs)] // documentation missing in model
|
6363 + | pub fn min_length_string(
|
6364 + | mut self,
|
6365 + | input: ::std::option::Option<::std::string::String>,
|
6366 + | ) -> Self {
|
6367 + | self.min_length_string = input;
|
6368 + | self
|
6369 + | }
|
6370 + | #[allow(missing_docs)] // documentation missing in model
|
6371 + | pub fn max_length_string(
|
6372 + | mut self,
|
6373 + | input: ::std::option::Option<::std::string::String>,
|
6374 + | ) -> Self {
|
6375 + | self.max_length_string = input;
|
6376 + | self
|
6377 + | }
|
6378 + | #[allow(missing_docs)] // documentation missing in model
|
6379 + | pub fn fixed_length_string(
|
6380 + | mut self,
|
6381 + | input: ::std::option::Option<::std::string::String>,
|
6382 + | ) -> Self {
|
6383 + | self.fixed_length_string = input;
|
6384 + | self
|
6385 + | }
|
6386 + | #[allow(missing_docs)] // documentation missing in model
|
6387 + | pub fn length_blob(
|
6388 + | mut self,
|
6389 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6390 + | ) -> Self {
|
6391 + | self.length_blob = input;
|
6392 + | self
|
6393 + | }
|
6394 + | #[allow(missing_docs)] // documentation missing in model
|
6395 + | pub fn min_length_blob(
|
6396 + | mut self,
|
6397 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6398 + | ) -> Self {
|
6399 + | self.min_length_blob = input;
|
6400 + | self
|
6401 + | }
|
6402 + | #[allow(missing_docs)] // documentation missing in model
|
6403 + | pub fn max_length_blob(
|
6404 + | mut self,
|
6405 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6406 + | ) -> Self {
|
6407 + | self.max_length_blob = input;
|
6408 + | self
|
6409 + | }
|
6410 + | #[allow(missing_docs)] // documentation missing in model
|
6411 + | pub fn fixed_length_blob(
|
6412 + | mut self,
|
6413 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6414 + | ) -> Self {
|
6415 + | self.fixed_length_blob = input;
|
6416 + | self
|
6417 + | }
|
6418 + | #[allow(missing_docs)] // documentation missing in model
|
6419 + | pub fn range_integer(mut self, input: i32) -> Self {
|
6420 + | self.range_integer = Some(input);
|
6421 + | self
|
6422 + | }
|
6423 + | #[allow(missing_docs)] // documentation missing in model
|
6424 + | pub fn min_range_integer(mut self, input: i32) -> Self {
|
6425 + | self.min_range_integer = Some(input);
|
6426 + | self
|
6427 + | }
|
6428 + | #[allow(missing_docs)] // documentation missing in model
|
6429 + | pub fn max_range_integer(mut self, input: i32) -> Self {
|
6430 + | self.max_range_integer = Some(input);
|
6431 + | self
|
6432 + | }
|
6433 + | #[allow(missing_docs)] // documentation missing in model
|
6434 + | pub fn fixed_value_integer(mut self, input: i32) -> Self {
|
6435 + | self.fixed_value_integer = Some(input);
|
6436 + | self
|
6437 + | }
|
6438 + | #[allow(missing_docs)] // documentation missing in model
|
6439 + | pub fn range_short(mut self, input: i16) -> Self {
|
6440 + | self.range_short = Some(input);
|
6441 + | self
|
6442 + | }
|
6443 + | #[allow(missing_docs)] // documentation missing in model
|
6444 + | pub fn min_range_short(mut self, input: i16) -> Self {
|
6445 + | self.min_range_short = Some(input);
|
6446 + | self
|
6447 + | }
|
6448 + | #[allow(missing_docs)] // documentation missing in model
|
6449 + | pub fn max_range_short(mut self, input: i16) -> Self {
|
6450 + | self.max_range_short = Some(input);
|
6451 + | self
|
6452 + | }
|
6453 + | #[allow(missing_docs)] // documentation missing in model
|
6454 + | pub fn fixed_value_short(mut self, input: i16) -> Self {
|
6455 + | self.fixed_value_short = Some(input);
|
6456 + | self
|
6457 + | }
|
6458 + | #[allow(missing_docs)] // documentation missing in model
|
6459 + | pub fn range_long(mut self, input: i64) -> Self {
|
6460 + | self.range_long = Some(input);
|
6461 + | self
|
6462 + | }
|
6463 + | #[allow(missing_docs)] // documentation missing in model
|
6464 + | pub fn min_range_long(mut self, input: i64) -> Self {
|
6465 + | self.min_range_long = Some(input);
|
6466 + | self
|
6467 + | }
|
6468 + | #[allow(missing_docs)] // documentation missing in model
|
6469 + | pub fn max_range_long(mut self, input: i64) -> Self {
|
6470 + | self.max_range_long = Some(input);
|
6471 + | self
|
6472 + | }
|
6473 + | #[allow(missing_docs)] // documentation missing in model
|
6474 + | pub fn fixed_value_long(mut self, input: i64) -> Self {
|
6475 + | self.fixed_value_long = Some(input);
|
6476 + | self
|
6477 + | }
|
6478 + | #[allow(missing_docs)] // documentation missing in model
|
6479 + | pub fn range_byte(mut self, input: i8) -> Self {
|
6480 + | self.range_byte = Some(input);
|
6481 + | self
|
6482 + | }
|
6483 + | #[allow(missing_docs)] // documentation missing in model
|
6484 + | pub fn min_range_byte(mut self, input: i8) -> Self {
|
6485 + | self.min_range_byte = Some(input);
|
6486 + | self
|
6487 + | }
|
6488 + | #[allow(missing_docs)] // documentation missing in model
|
6489 + | pub fn max_range_byte(mut self, input: i8) -> Self {
|
6490 + | self.max_range_byte = Some(input);
|
6491 + | self
|
6492 + | }
|
6493 + | #[allow(missing_docs)] // documentation missing in model
|
6494 + | pub fn fixed_value_byte(mut self, input: i8) -> Self {
|
6495 + | self.fixed_value_byte = Some(input);
|
6496 + | self
|
6497 + | }
|
6498 + | #[allow(missing_docs)] // documentation missing in model
|
6499 + | pub fn con_b_list(
|
6500 + | mut self,
|
6501 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
6502 + | ) -> Self {
|
6503 + | self.con_b_list = input;
|
6504 + | self
|
6505 + | }
|
6506 + | #[allow(missing_docs)] // documentation missing in model
|
6507 + | pub fn length_list(
|
6508 + | mut self,
|
6509 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6510 + | ) -> Self {
|
6511 + | self.length_list = input;
|
6512 + | self
|
6513 + | }
|
6514 + | #[allow(missing_docs)] // documentation missing in model
|
6515 + | pub fn sensitive_length_list(
|
6516 + | mut self,
|
6517 + | input: ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
6518 + | ) -> Self {
|
6519 + | self.sensitive_length_list = input;
|
6520 + | self
|
6521 + | }
|
6522 + | #[allow(missing_docs)] // documentation missing in model
|
6523 + | pub fn con_b_set(
|
6524 + | mut self,
|
6525 + | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
6526 + | ) -> Self {
|
6527 + | self.con_b_set = input;
|
6528 + | self
|
6529 + | }
|
6530 + | #[allow(missing_docs)] // documentation missing in model
|
6531 + | pub fn con_b_map(
|
6532 + | mut self,
|
6533 + | input: ::std::option::Option<
|
6534 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6535 + | >,
|
6536 + | ) -> Self {
|
6537 + | self.con_b_map = input;
|
6538 + | self
|
6539 + | }
|
6540 + | #[allow(missing_docs)] // documentation missing in model
|
6541 + | pub fn length_map(
|
6542 + | mut self,
|
6543 + | input: ::std::option::Option<
|
6544 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6545 + | >,
|
6546 + | ) -> Self {
|
6547 + | self.length_map = input;
|
6548 + | self
|
6549 + | }
|
6550 + | #[allow(missing_docs)] // documentation missing in model
|
6551 + | pub fn map_of_map_of_list_of_list_of_con_b(
|
6552 + | mut self,
|
6553 + | input: ::std::option::Option<
|
6554 + | ::std::collections::HashMap<
|
6555 + | ::std::string::String,
|
6556 + | ::std::collections::HashMap<
|
6557 + | ::std::string::String,
|
6558 + | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
6559 + | >,
|
6560 + | >,
|
6561 + | >,
|
6562 + | ) -> Self {
|
6563 + | self.map_of_map_of_list_of_list_of_con_b = input;
|
6564 + | self
|
6565 + | }
|
6566 + | #[allow(missing_docs)] // documentation missing in model
|
6567 + | pub fn sparse_map(
|
6568 + | mut self,
|
6569 + | input: ::std::option::Option<
|
6570 + | ::std::collections::HashMap<
|
6571 + | ::std::string::String,
|
6572 + | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6573 + | >,
|
6574 + | >,
|
6575 + | ) -> Self {
|
6576 + | self.sparse_map = input;
|
6577 + | self
|
6578 + | }
|
6579 + | #[allow(missing_docs)] // documentation missing in model
|
6580 + | pub fn sparse_list(
|
6581 + | mut self,
|
6582 + | input: ::std::option::Option<
|
6583 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
6584 + | >,
|
6585 + | ) -> Self {
|
6586 + | self.sparse_list = input;
|
6587 + | self
|
6588 + | }
|
6589 + | #[allow(missing_docs)] // documentation missing in model
|
6590 + | pub fn sparse_length_map(
|
6591 + | mut self,
|
6592 + | input: ::std::option::Option<
|
6593 + | ::std::collections::HashMap<
|
6594 + | ::std::string::String,
|
6595 + | ::std::option::Option<::std::string::String>,
|
6596 + | >,
|
6597 + | >,
|
6598 + | ) -> Self {
|
6599 + | self.sparse_length_map = input;
|
6600 + | self
|
6601 + | }
|
6602 + | #[allow(missing_docs)] // documentation missing in model
|
6603 + | pub fn sparse_length_list(
|
6604 + | mut self,
|
6605 + | input: ::std::option::Option<
|
6606 + | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
6607 + | >,
|
6608 + | ) -> Self {
|
6609 + | self.sparse_length_list = input;
|
6610 + | self
|
6611 + | }
|
6612 + | /// A union with constrained members.
|
6613 + | pub fn constrained_union(
|
6614 + | mut self,
|
6615 + | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
6616 + | ) -> Self {
|
6617 + | self.constrained_union = input;
|
6618 + | self
|
6619 + | }
|
6620 + | #[allow(missing_docs)] // documentation missing in model
|
6621 + | pub fn enum_string(
|
6622 + | mut self,
|
6623 + | input: ::std::option::Option<crate::model::EnumString>,
|
6624 + | ) -> Self {
|
6625 + | self.enum_string = input;
|
6626 + | self
|
6627 + | }
|
6628 + | #[allow(missing_docs)] // documentation missing in model
|
6629 + | pub fn list_of_length_string(
|
6630 + | mut self,
|
6631 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6632 + | ) -> Self {
|
6633 + | self.list_of_length_string = input;
|
6634 + | self
|
6635 + | }
|
6636 + | #[allow(missing_docs)] // documentation missing in model
|
6637 + | pub fn set_of_length_string(
|
6638 + | mut self,
|
6639 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6640 + | ) -> Self {
|
6641 + | self.set_of_length_string = input;
|
6642 + | self
|
6643 + | }
|
6644 + | #[allow(missing_docs)] // documentation missing in model
|
6645 + | pub fn map_of_length_string(
|
6646 + | mut self,
|
6647 + | input: ::std::option::Option<
|
6648 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6649 + | >,
|
6650 + | ) -> Self {
|
6651 + | self.map_of_length_string = input;
|
6652 + | self
|
6653 + | }
|
6654 + | #[allow(missing_docs)] // documentation missing in model
|
6655 + | pub fn list_of_length_blob(
|
6656 + | mut self,
|
6657 + | input: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
6658 + | ) -> Self {
|
6659 + | self.list_of_length_blob = input;
|
6660 + | self
|
6661 + | }
|
6662 + | #[allow(missing_docs)] // documentation missing in model
|
6663 + | pub fn map_of_length_blob(
|
6664 + | mut self,
|
6665 + | input: ::std::option::Option<
|
6666 + | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
6667 + | >,
|
6668 + | ) -> Self {
|
6669 + | self.map_of_length_blob = input;
|
6670 + | self
|
6671 + | }
|
6672 + | #[allow(missing_docs)] // documentation missing in model
|
6673 + | pub fn list_of_range_integer(
|
6674 + | mut self,
|
6675 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
6676 + | ) -> Self {
|
6677 + | self.list_of_range_integer = input;
|
6678 + | self
|
6679 + | }
|
6680 + | #[allow(missing_docs)] // documentation missing in model
|
6681 + | pub fn set_of_range_integer(
|
6682 + | mut self,
|
6683 + | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
6684 + | ) -> Self {
|
6685 + | self.set_of_range_integer = input;
|
6686 + | self
|
6687 + | }
|
6688 + | #[allow(missing_docs)] // documentation missing in model
|
6689 + | pub fn map_of_range_integer(
|
6690 + | mut self,
|
6691 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
6692 + | ) -> Self {
|
6693 + | self.map_of_range_integer = input;
|
6694 + | self
|
6695 + | }
|
6696 + | #[allow(missing_docs)] // documentation missing in model
|
6697 + | pub fn list_of_range_short(
|
6698 + | mut self,
|
6699 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
6700 + | ) -> Self {
|
6701 + | self.list_of_range_short = input;
|
6702 + | self
|
6703 + | }
|
6704 + | #[allow(missing_docs)] // documentation missing in model
|
6705 + | pub fn set_of_range_short(
|
6706 + | mut self,
|
6707 + | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
6708 + | ) -> Self {
|
6709 + | self.set_of_range_short = input;
|
6710 + | self
|
6711 + | }
|
6712 + | #[allow(missing_docs)] // documentation missing in model
|
6713 + | pub fn map_of_range_short(
|
6714 + | mut self,
|
6715 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
6716 + | ) -> Self {
|
6717 + | self.map_of_range_short = input;
|
6718 + | self
|
6719 + | }
|
6720 + | #[allow(missing_docs)] // documentation missing in model
|
6721 + | pub fn list_of_range_long(
|
6722 + | mut self,
|
6723 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
6724 + | ) -> Self {
|
6725 + | self.list_of_range_long = input;
|
6726 + | self
|
6727 + | }
|
6728 + | #[allow(missing_docs)] // documentation missing in model
|
6729 + | pub fn set_of_range_long(
|
6730 + | mut self,
|
6731 + | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
6732 + | ) -> Self {
|
6733 + | self.set_of_range_long = input;
|
6734 + | self
|
6735 + | }
|
6736 + | #[allow(missing_docs)] // documentation missing in model
|
6737 + | pub fn map_of_range_long(
|
6738 + | mut self,
|
6739 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
6740 + | ) -> Self {
|
6741 + | self.map_of_range_long = input;
|
6742 + | self
|
6743 + | }
|
6744 + | #[allow(missing_docs)] // documentation missing in model
|
6745 + | pub fn list_of_range_byte(
|
6746 + | mut self,
|
6747 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
6748 + | ) -> Self {
|
6749 + | self.list_of_range_byte = input;
|
6750 + | self
|
6751 + | }
|
6752 + | #[allow(missing_docs)] // documentation missing in model
|
6753 + | pub fn set_of_range_byte(
|
6754 + | mut self,
|
6755 + | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
6756 + | ) -> Self {
|
6757 + | self.set_of_range_byte = input;
|
6758 + | self
|
6759 + | }
|
6760 + | #[allow(missing_docs)] // documentation missing in model
|
6761 + | pub fn map_of_range_byte(
|
6762 + | mut self,
|
6763 + | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
6764 + | ) -> Self {
|
6765 + | self.map_of_range_byte = input;
|
6766 + | self
|
6767 + | }
|
6768 + | #[allow(missing_docs)] // documentation missing in model
|
6769 + | pub fn non_streaming_blob(
|
6770 + | mut self,
|
6771 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
6772 + | ) -> Self {
|
6773 + | self.non_streaming_blob = input;
|
6774 + | self
|
6775 + | }
|
6776 + | #[allow(missing_docs)] // documentation missing in model
|
6777 + | pub fn pattern_string(
|
6778 + | mut self,
|
6779 + | input: ::std::option::Option<::std::string::String>,
|
6780 + | ) -> Self {
|
6781 + | self.pattern_string = input;
|
6782 + | self
|
6783 + | }
|
6784 + | #[allow(missing_docs)] // documentation missing in model
|
6785 + | pub fn map_of_pattern_string(
|
6786 + | mut self,
|
6787 + | input: ::std::option::Option<
|
6788 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6789 + | >,
|
6790 + | ) -> Self {
|
6791 + | self.map_of_pattern_string = input;
|
6792 + | self
|
6793 + | }
|
6794 + | #[allow(missing_docs)] // documentation missing in model
|
6795 + | pub fn list_of_pattern_string(
|
6796 + | mut self,
|
6797 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6798 + | ) -> Self {
|
6799 + | self.list_of_pattern_string = input;
|
6800 + | self
|
6801 + | }
|
6802 + | #[allow(missing_docs)] // documentation missing in model
|
6803 + | pub fn set_of_pattern_string(
|
6804 + | mut self,
|
6805 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6806 + | ) -> Self {
|
6807 + | self.set_of_pattern_string = input;
|
6808 + | self
|
6809 + | }
|
6810 + | #[allow(missing_docs)] // documentation missing in model
|
6811 + | pub fn length_length_pattern_string(
|
6812 + | mut self,
|
6813 + | input: ::std::option::Option<::std::string::String>,
|
6814 + | ) -> Self {
|
6815 + | self.length_length_pattern_string = input;
|
6816 + | self
|
6817 + | }
|
6818 + | #[allow(missing_docs)] // documentation missing in model
|
6819 + | pub fn map_of_length_pattern_string(
|
6820 + | mut self,
|
6821 + | input: ::std::option::Option<
|
6822 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
6823 + | >,
|
6824 + | ) -> Self {
|
6825 + | self.map_of_length_pattern_string = input;
|
6826 + | self
|
6827 + | }
|
6828 + | #[allow(missing_docs)] // documentation missing in model
|
6829 + | pub fn list_of_length_pattern_string(
|
6830 + | mut self,
|
6831 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6832 + | ) -> Self {
|
6833 + | self.list_of_length_pattern_string = input;
|
6834 + | self
|
6835 + | }
|
6836 + | #[allow(missing_docs)] // documentation missing in model
|
6837 + | pub fn set_of_length_pattern_string(
|
6838 + | mut self,
|
6839 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6840 + | ) -> Self {
|
6841 + | self.set_of_length_pattern_string = input;
|
6842 + | self
|
6843 + | }
|
6844 + | #[allow(missing_docs)] // documentation missing in model
|
6845 + | pub fn length_list_of_pattern_string(
|
6846 + | mut self,
|
6847 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6848 + | ) -> Self {
|
6849 + | self.length_list_of_pattern_string = input;
|
6850 + | self
|
6851 + | }
|
6852 + | #[allow(missing_docs)] // documentation missing in model
|
6853 + | pub fn length_set_of_pattern_string(
|
6854 + | mut self,
|
6855 + | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
6856 + | ) -> Self {
|
6857 + | self.length_set_of_pattern_string = input;
|
6858 + | self
|
6859 + | }
|
6860 + | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
6861 + | ///
|
6862 + | /// The builder fails to construct a [`ConA`](crate::model::ConA) if you do not provide a value for all non-`Option`al members.
|
6863 + | ///
|
6864 + | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
6865 + | self.build_enforcing_required_and_enum_traits()
|
6866 + | }
|
6867 + | fn build_enforcing_required_and_enum_traits(
|
6868 + | self,
|
6869 + | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
6870 + | Ok(crate::model::ConA {
|
6871 + | con_b: self.con_b.ok_or(ConstraintViolation::MissingConB)?,
|
6872 + | opt_con_b: self.opt_con_b,
|
6873 + | length_string: self.length_string,
|
6874 + | min_length_string: self.min_length_string,
|
6875 + | max_length_string: self.max_length_string,
|
6876 + | fixed_length_string: self.fixed_length_string,
|
6877 + | length_blob: self.length_blob,
|
6878 + | min_length_blob: self.min_length_blob,
|
6879 + | max_length_blob: self.max_length_blob,
|
6880 + | fixed_length_blob: self.fixed_length_blob,
|
6881 + | range_integer: self.range_integer.unwrap_or(0i32),
|
6882 + | min_range_integer: self.min_range_integer.unwrap_or(0i32),
|
6883 + | max_range_integer: self.max_range_integer.unwrap_or(0i32),
|
6884 + | fixed_value_integer: self.fixed_value_integer.unwrap_or(0i32),
|
6885 + | range_short: self.range_short.unwrap_or(0i16),
|
6886 + | min_range_short: self.min_range_short.unwrap_or(0i16),
|
6887 + | max_range_short: self.max_range_short.unwrap_or(0i16),
|
6888 + | fixed_value_short: self.fixed_value_short.unwrap_or(0i16),
|
6889 + | range_long: self.range_long.unwrap_or(0i64),
|
6890 + | min_range_long: self.min_range_long.unwrap_or(0i64),
|
6891 + | max_range_long: self.max_range_long.unwrap_or(0i64),
|
6892 + | fixed_value_long: self.fixed_value_long.unwrap_or(0i64),
|
6893 + | range_byte: self.range_byte.unwrap_or(0i8),
|
6894 + | min_range_byte: self.min_range_byte.unwrap_or(0i8),
|
6895 + | max_range_byte: self.max_range_byte.unwrap_or(0i8),
|
6896 + | fixed_value_byte: self.fixed_value_byte.unwrap_or(0i8),
|
6897 + | con_b_list: self.con_b_list,
|
6898 + | length_list: self.length_list,
|
6899 + | sensitive_length_list: self.sensitive_length_list,
|
6900 + | con_b_set: self.con_b_set,
|
6901 + | con_b_map: self.con_b_map,
|
6902 + | length_map: self.length_map,
|
6903 + | map_of_map_of_list_of_list_of_con_b: self.map_of_map_of_list_of_list_of_con_b,
|
6904 + | sparse_map: self.sparse_map,
|
6905 + | sparse_list: self.sparse_list,
|
6906 + | sparse_length_map: self.sparse_length_map,
|
6907 + | sparse_length_list: self.sparse_length_list,
|
6908 + | constrained_union: self.constrained_union,
|
6909 + | enum_string: self.enum_string,
|
6910 + | list_of_length_string: self.list_of_length_string,
|
6911 + | set_of_length_string: self.set_of_length_string,
|
6912 + | map_of_length_string: self.map_of_length_string,
|
6913 + | list_of_length_blob: self.list_of_length_blob,
|
6914 + | map_of_length_blob: self.map_of_length_blob,
|
6915 + | list_of_range_integer: self.list_of_range_integer,
|
6916 + | set_of_range_integer: self.set_of_range_integer,
|
6917 + | map_of_range_integer: self.map_of_range_integer,
|
6918 + | list_of_range_short: self.list_of_range_short,
|
6919 + | set_of_range_short: self.set_of_range_short,
|
6920 + | map_of_range_short: self.map_of_range_short,
|
6921 + | list_of_range_long: self.list_of_range_long,
|
6922 + | set_of_range_long: self.set_of_range_long,
|
6923 + | map_of_range_long: self.map_of_range_long,
|
6924 + | list_of_range_byte: self.list_of_range_byte,
|
6925 + | set_of_range_byte: self.set_of_range_byte,
|
6926 + | map_of_range_byte: self.map_of_range_byte,
|
7410 6927 | non_streaming_blob: self.non_streaming_blob,
|
7411 - | pattern_string: self
|
7412 - | .pattern_string
|
7413 - | .map(|v| match v {
|
7414 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7415 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7416 - | })
|
7417 - | .map(|res| res.map_err(ConstraintViolation::PatternString))
|
7418 - | .transpose()?
|
7419 - | .map(|v: crate::model::PatternString| v.into()),
|
7420 - | map_of_pattern_string: self
|
7421 - | .map_of_pattern_string
|
7422 - | .map(|v| match v {
|
7423 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7424 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7425 - | })
|
7426 - | .map(|res| {
|
7427 - | res.map(|v| v.into())
|
7428 - | .map_err(ConstraintViolation::MapOfPatternString)
|
7429 - | })
|
7430 - | .transpose()?,
|
7431 - | list_of_pattern_string: self
|
7432 - | .list_of_pattern_string
|
7433 - | .map(|v| match v {
|
7434 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7435 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7436 - | })
|
7437 - | .map(|res| {
|
7438 - | res.map(|v| v.into())
|
7439 - | .map_err(ConstraintViolation::ListOfPatternString)
|
7440 - | })
|
7441 - | .transpose()?,
|
7442 - | set_of_pattern_string: self
|
7443 - | .set_of_pattern_string
|
7444 - | .map(|v| match v {
|
7445 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7446 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7447 - | })
|
7448 - | .map(|res| res.map_err(ConstraintViolation::SetOfPatternString))
|
7449 - | .transpose()?
|
7450 - | .map(|v: crate::model::SetOfPatternString| v.into()),
|
7451 - | length_length_pattern_string: self
|
7452 - | .length_length_pattern_string
|
7453 - | .map(|v| match v {
|
7454 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7455 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7456 - | })
|
7457 - | .map(|res| res.map_err(ConstraintViolation::LengthLengthPatternString))
|
7458 - | .transpose()?
|
7459 - | .map(|v: crate::model::LengthPatternString| v.into()),
|
7460 - | map_of_length_pattern_string: self
|
7461 - | .map_of_length_pattern_string
|
7462 - | .map(|v| match v {
|
7463 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7464 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7465 - | })
|
7466 - | .map(|res| {
|
7467 - | res.map(|v| v.into())
|
7468 - | .map_err(ConstraintViolation::MapOfLengthPatternString)
|
6928 + | pattern_string: self.pattern_string,
|
6929 + | map_of_pattern_string: self.map_of_pattern_string,
|
6930 + | list_of_pattern_string: self.list_of_pattern_string,
|
6931 + | set_of_pattern_string: self.set_of_pattern_string,
|
6932 + | length_length_pattern_string: self.length_length_pattern_string,
|
6933 + | map_of_length_pattern_string: self.map_of_length_pattern_string,
|
6934 + | list_of_length_pattern_string: self.list_of_length_pattern_string,
|
6935 + | set_of_length_pattern_string: self.set_of_length_pattern_string,
|
6936 + | length_list_of_pattern_string: self.length_list_of_pattern_string,
|
6937 + | length_set_of_pattern_string: self.length_set_of_pattern_string,
|
7469 6938 | })
|
7470 - | .transpose()?,
|
7471 - | list_of_length_pattern_string: self
|
7472 - | .list_of_length_pattern_string
|
7473 - | .map(|v| match v {
|
7474 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7475 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
6939 + | }
|
6940 + | }
|
6941 + | }
|
6942 + | pub(crate) mod constrained_list_in_output_internal {
|
6943 + |
|
6944 + | #[allow(clippy::enum_variant_names)]
|
6945 + | #[derive(Debug, PartialEq)]
|
6946 + | pub(crate) enum ConstraintViolation {
|
6947 + | /// Constraint violation error when the list doesn't have the required length
|
6948 + | Length(usize),
|
6949 + | }
|
6950 + |
|
6951 + | impl ::std::fmt::Display for ConstraintViolation {
|
6952 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6953 + | let message = match self {
|
6954 + | Self::Length(length) => {
|
6955 + | format!("Value with length {} provided for 'com.amazonaws.constraints#ConstrainedListInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
6956 + | }
|
6957 + | };
|
6958 + | write!(f, "{message}")
|
6959 + | }
|
6960 + | }
|
6961 + |
|
6962 + | impl ::std::error::Error for ConstraintViolation {}
|
6963 + | }
|
6964 + | pub(crate) mod constrained_map_in_output_internal {
|
6965 + |
|
6966 + | #[allow(clippy::enum_variant_names)]
|
6967 + | #[derive(Debug, PartialEq)]
|
6968 + | pub(crate) enum ConstraintViolation {
|
6969 + | Length(usize),
|
6970 + | }
|
6971 + |
|
6972 + | impl ::std::fmt::Display for ConstraintViolation {
|
6973 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6974 + | match self {
|
6975 + | Self::Length(length) => {
|
6976 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConstrainedMapInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
6977 + | }
|
6978 + | }
|
6979 + | }
|
6980 + | }
|
6981 + |
|
6982 + | impl ::std::error::Error for ConstraintViolation {}
|
6983 + | }
|
6984 + | pub(crate) mod length_string_internal {
|
6985 + |
|
6986 + | #[derive(Debug, PartialEq)]
|
6987 + | pub enum ConstraintViolation {
|
6988 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
6989 + | Length(usize),
|
6990 + | }
|
6991 + |
|
6992 + | impl ::std::fmt::Display for ConstraintViolation {
|
6993 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
6994 + | let message = match self {
|
6995 + | Self::Length(length) => {
|
6996 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthString' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length)
|
6997 + | }
|
6998 + | };
|
6999 + | write!(f, "{message}")
|
7000 + | }
|
7001 + | }
|
7002 + |
|
7003 + | impl ::std::error::Error for ConstraintViolation {}
|
7004 + | impl ConstraintViolation {
|
7005 + | pub(crate) fn as_validation_exception_field(
|
7006 + | self,
|
7007 + | path: ::std::string::String,
|
7008 + | ) -> crate::model::ValidationExceptionField {
|
7009 + | match self {
|
7010 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7011 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 69, inclusive", length, &path),
|
7012 + | path,
|
7013 + | },
|
7014 + | }
|
7015 + | }
|
7016 + | }
|
7017 + | }
|
7018 + | pub(crate) mod range_integer_internal {
|
7019 + |
|
7020 + | #[derive(Debug, PartialEq)]
|
7021 + | pub enum ConstraintViolation {
|
7022 + | Range(i32),
|
7023 + | }
|
7024 + |
|
7025 + | impl ::std::fmt::Display for ConstraintViolation {
|
7026 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7027 + | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
7028 + | }
|
7029 + | }
|
7030 + |
|
7031 + | impl ::std::error::Error for ConstraintViolation {}
|
7032 + | impl ConstraintViolation {
|
7033 + | pub(crate) fn as_validation_exception_field(
|
7034 + | self,
|
7035 + | path: ::std::string::String,
|
7036 + | ) -> crate::model::ValidationExceptionField {
|
7037 + | match self {
|
7038 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
7039 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
7040 + | path,
|
7041 + | },
|
7042 + | }
|
7043 + | }
|
7044 + | }
|
7045 + | }
|
7046 + | pub(crate) mod range_short_internal {
|
7047 + |
|
7048 + | #[derive(Debug, PartialEq)]
|
7049 + | pub enum ConstraintViolation {
|
7050 + | Range(i16),
|
7051 + | }
|
7052 + |
|
7053 + | impl ::std::fmt::Display for ConstraintViolation {
|
7054 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7055 + | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
7056 + | }
|
7057 + | }
|
7058 + |
|
7059 + | impl ::std::error::Error for ConstraintViolation {}
|
7060 + | impl ConstraintViolation {
|
7061 + | pub(crate) fn as_validation_exception_field(
|
7062 + | self,
|
7063 + | path: ::std::string::String,
|
7064 + | ) -> crate::model::ValidationExceptionField {
|
7065 + | match self {
|
7066 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
7067 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
7068 + | path,
|
7069 + | },
|
7070 + | }
|
7071 + | }
|
7072 + | }
|
7073 + | }
|
7074 + | pub(crate) mod range_long_internal {
|
7075 + |
|
7076 + | #[derive(Debug, PartialEq)]
|
7077 + | pub enum ConstraintViolation {
|
7078 + | Range(i64),
|
7079 + | }
|
7080 + |
|
7081 + | impl ::std::fmt::Display for ConstraintViolation {
|
7082 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7083 + | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
7084 + | }
|
7085 + | }
|
7086 + |
|
7087 + | impl ::std::error::Error for ConstraintViolation {}
|
7088 + | impl ConstraintViolation {
|
7089 + | pub(crate) fn as_validation_exception_field(
|
7090 + | self,
|
7091 + | path: ::std::string::String,
|
7092 + | ) -> crate::model::ValidationExceptionField {
|
7093 + | match self {
|
7094 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
7095 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
7096 + | path,
|
7097 + | },
|
7098 + | }
|
7099 + | }
|
7100 + | }
|
7101 + | }
|
7102 + | pub(crate) mod range_byte_internal {
|
7103 + |
|
7104 + | #[derive(Debug, PartialEq)]
|
7105 + | pub enum ConstraintViolation {
|
7106 + | Range(i8),
|
7107 + | }
|
7108 + |
|
7109 + | impl ::std::fmt::Display for ConstraintViolation {
|
7110 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7111 + | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
7112 + | }
|
7113 + | }
|
7114 + |
|
7115 + | impl ::std::error::Error for ConstraintViolation {}
|
7116 + | impl ConstraintViolation {
|
7117 + | pub(crate) fn as_validation_exception_field(
|
7118 + | self,
|
7119 + | path: ::std::string::String,
|
7120 + | ) -> crate::model::ValidationExceptionField {
|
7121 + | match self {
|
7122 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
7123 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
7124 + | path,
|
7125 + | },
|
7126 + | }
|
7127 + | }
|
7128 + | }
|
7129 + | }
|
7130 + | pub(crate) mod map_of_length_string_internal {
|
7131 + |
|
7132 + | #[allow(clippy::enum_variant_names)]
|
7133 + | #[derive(Debug, PartialEq)]
|
7134 + | pub(crate) enum ConstraintViolation {
|
7135 + | #[doc(hidden)]
|
7136 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
7137 + | #[doc(hidden)]
|
7138 + | Value(
|
7139 + | crate::model::LengthString,
|
7140 + | crate::model::length_string_internal::ConstraintViolation,
|
7141 + | ),
|
7142 + | }
|
7143 + |
|
7144 + | impl ::std::fmt::Display for ConstraintViolation {
|
7145 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7146 + | match self {
|
7147 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
7148 + | Self::Value(_, value_constraint_violation) => {
|
7149 + | write!(f, "{}", value_constraint_violation)
|
7150 + | }
|
7151 + | }
|
7152 + | }
|
7153 + | }
|
7154 + |
|
7155 + | impl ::std::error::Error for ConstraintViolation {}
|
7156 + | impl ConstraintViolation {
|
7157 + | pub(crate) fn as_validation_exception_field(
|
7158 + | self,
|
7159 + | path: ::std::string::String,
|
7160 + | ) -> crate::model::ValidationExceptionField {
|
7161 + | match self {
|
7162 + | Self::Key(key_constraint_violation) => {
|
7163 + | key_constraint_violation.as_validation_exception_field(path)
|
7164 + | }
|
7165 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
7166 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7167 + | }
|
7168 + | }
|
7169 + | }
|
7170 + | }
|
7171 + | pub(crate) mod set_of_length_string_internal {
|
7172 + |
|
7173 + | #[allow(clippy::enum_variant_names)]
|
7174 + | #[derive(Debug, PartialEq)]
|
7175 + | pub(crate) enum ConstraintViolation {
|
7176 + | /// Constraint violation error when the list does not contain unique items
|
7177 + | UniqueItems {
|
7178 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7179 + | /// at least two elements.
|
7180 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7181 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7182 + | /// Nothing is guaranteed about the order of the indices.
|
7183 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7184 + | /// The original vector, that contains duplicate items.
|
7185 + | original: ::std::vec::Vec<crate::model::LengthString>,
|
7186 + | },
|
7187 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7188 + | /// The first component of the tuple is the index in the collection where the
|
7189 + | /// first constraint violation was found.
|
7190 + | #[doc(hidden)]
|
7191 + | Member(
|
7192 + | usize,
|
7193 + | crate::model::length_string_internal::ConstraintViolation,
|
7194 + | ),
|
7195 + | }
|
7196 + |
|
7197 + | impl ::std::fmt::Display for ConstraintViolation {
|
7198 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7199 + | let message = match self {
|
7200 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7201 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7202 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7203 + | failing_member)
|
7204 + | };
|
7205 + | write!(f, "{message}")
|
7206 + | }
|
7207 + | }
|
7208 + |
|
7209 + | impl ::std::error::Error for ConstraintViolation {}
|
7210 + | impl ConstraintViolation {
|
7211 + | pub(crate) fn as_validation_exception_field(
|
7212 + | self,
|
7213 + | path: ::std::string::String,
|
7214 + | ) -> crate::model::ValidationExceptionField {
|
7215 + | match self {
|
7216 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7217 + | crate::model::ValidationExceptionField {
|
7218 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7219 + | path,
|
7220 + | },
|
7221 + | Self::Member(index, member_constraint_violation) =>
|
7222 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7223 + | }
|
7224 + | }
|
7225 + | }
|
7226 + | }
|
7227 + | pub(crate) mod list_of_length_string_internal {
|
7228 + |
|
7229 + | #[allow(clippy::enum_variant_names)]
|
7230 + | #[derive(Debug, PartialEq)]
|
7231 + | pub(crate) enum ConstraintViolation {
|
7232 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7233 + | /// The first component of the tuple is the index in the collection where the
|
7234 + | /// first constraint violation was found.
|
7235 + | #[doc(hidden)]
|
7236 + | Member(
|
7237 + | usize,
|
7238 + | crate::model::length_string_internal::ConstraintViolation,
|
7239 + | ),
|
7240 + | }
|
7241 + |
|
7242 + | impl ::std::fmt::Display for ConstraintViolation {
|
7243 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7244 + | let message = match self {
|
7245 + | Self::Member(index, failing_member) => format!(
|
7246 + | "Value at index {index} failed to satisfy constraint. {}",
|
7247 + | failing_member
|
7248 + | ),
|
7249 + | };
|
7250 + | write!(f, "{message}")
|
7251 + | }
|
7252 + | }
|
7253 + |
|
7254 + | impl ::std::error::Error for ConstraintViolation {}
|
7255 + | impl ConstraintViolation {
|
7256 + | pub(crate) fn as_validation_exception_field(
|
7257 + | self,
|
7258 + | path: ::std::string::String,
|
7259 + | ) -> crate::model::ValidationExceptionField {
|
7260 + | match self {
|
7261 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7262 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7263 + | }
|
7264 + | }
|
7265 + | }
|
7266 + | }
|
7267 + | pub(crate) mod length_list_of_pattern_string_internal {
|
7268 + |
|
7269 + | #[allow(clippy::enum_variant_names)]
|
7270 + | #[derive(Debug, PartialEq)]
|
7271 + | pub(crate) enum ConstraintViolation {
|
7272 + | /// Constraint violation error when the list doesn't have the required length
|
7273 + | Length(usize),
|
7274 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7275 + | /// The first component of the tuple is the index in the collection where the
|
7276 + | /// first constraint violation was found.
|
7277 + | #[doc(hidden)]
|
7278 + | Member(
|
7279 + | usize,
|
7280 + | crate::model::pattern_string_internal::ConstraintViolation,
|
7281 + | ),
|
7282 + | }
|
7283 + |
|
7284 + | impl ::std::fmt::Display for ConstraintViolation {
|
7285 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7286 + | let message = match self {
|
7287 + | Self::Length(length) => {
|
7288 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthListOfPatternString' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length)
|
7289 + | }
|
7290 + | Self::Member(index, failing_member) => format!(
|
7291 + | "Value at index {index} failed to satisfy constraint. {}",
|
7292 + | failing_member
|
7293 + | ),
|
7294 + | };
|
7295 + | write!(f, "{message}")
|
7296 + | }
|
7297 + | }
|
7298 + |
|
7299 + | impl ::std::error::Error for ConstraintViolation {}
|
7300 + | impl ConstraintViolation {
|
7301 + | pub(crate) fn as_validation_exception_field(
|
7302 + | self,
|
7303 + | path: ::std::string::String,
|
7304 + | ) -> crate::model::ValidationExceptionField {
|
7305 + | match self {
|
7306 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7307 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 12 and 39, inclusive", length, &path),
|
7308 + | path,
|
7309 + | },
|
7310 + | Self::Member(index, member_constraint_violation) =>
|
7311 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7312 + | }
|
7313 + | }
|
7314 + | }
|
7315 + | }
|
7316 + | pub(crate) mod length_set_of_pattern_string_internal {
|
7317 + |
|
7318 + | #[allow(clippy::enum_variant_names)]
|
7319 + | #[derive(Debug, PartialEq)]
|
7320 + | pub(crate) enum ConstraintViolation {
|
7321 + | /// Constraint violation error when the list doesn't have the required length
|
7322 + | Length(usize),
|
7323 + | /// Constraint violation error when the list does not contain unique items
|
7324 + | UniqueItems {
|
7325 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7326 + | /// at least two elements.
|
7327 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7328 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7329 + | /// Nothing is guaranteed about the order of the indices.
|
7330 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7331 + | /// The original vector, that contains duplicate items.
|
7332 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
7333 + | },
|
7334 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7335 + | /// The first component of the tuple is the index in the collection where the
|
7336 + | /// first constraint violation was found.
|
7337 + | #[doc(hidden)]
|
7338 + | Member(
|
7339 + | usize,
|
7340 + | crate::model::pattern_string_internal::ConstraintViolation,
|
7341 + | ),
|
7342 + | }
|
7343 + |
|
7344 + | impl ::std::fmt::Display for ConstraintViolation {
|
7345 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7346 + | let message = match self {
|
7347 + | Self::Length(length) => {
|
7348 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
7349 + | },
|
7350 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7351 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7352 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7353 + | failing_member)
|
7354 + | };
|
7355 + | write!(f, "{message}")
|
7356 + | }
|
7357 + | }
|
7358 + |
|
7359 + | impl ::std::error::Error for ConstraintViolation {}
|
7360 + | impl ConstraintViolation {
|
7361 + | pub(crate) fn as_validation_exception_field(
|
7362 + | self,
|
7363 + | path: ::std::string::String,
|
7364 + | ) -> crate::model::ValidationExceptionField {
|
7365 + | match self {
|
7366 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
7367 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
7368 + | path,
|
7369 + | },
|
7370 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7371 + | crate::model::ValidationExceptionField {
|
7372 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7373 + | path,
|
7374 + | },
|
7375 + | Self::Member(index, member_constraint_violation) =>
|
7376 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7377 + | }
|
7378 + | }
|
7379 + | }
|
7380 + | }
|
7381 + | pub(crate) mod set_of_range_byte_internal {
|
7382 + |
|
7383 + | #[allow(clippy::enum_variant_names)]
|
7384 + | #[derive(Debug, PartialEq)]
|
7385 + | pub(crate) enum ConstraintViolation {
|
7386 + | /// Constraint violation error when the list does not contain unique items
|
7387 + | UniqueItems {
|
7388 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7389 + | /// at least two elements.
|
7390 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7391 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7392 + | /// Nothing is guaranteed about the order of the indices.
|
7393 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7394 + | /// The original vector, that contains duplicate items.
|
7395 + | original: ::std::vec::Vec<crate::model::RangeByte>,
|
7396 + | },
|
7397 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7398 + | /// The first component of the tuple is the index in the collection where the
|
7399 + | /// first constraint violation was found.
|
7400 + | #[doc(hidden)]
|
7401 + | Member(
|
7402 + | usize,
|
7403 + | crate::model::range_byte_internal::ConstraintViolation,
|
7404 + | ),
|
7405 + | }
|
7406 + |
|
7407 + | impl ::std::fmt::Display for ConstraintViolation {
|
7408 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7409 + | let message = match self {
|
7410 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7411 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7412 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7413 + | failing_member)
|
7414 + | };
|
7415 + | write!(f, "{message}")
|
7416 + | }
|
7417 + | }
|
7418 + |
|
7419 + | impl ::std::error::Error for ConstraintViolation {}
|
7420 + | impl ConstraintViolation {
|
7421 + | pub(crate) fn as_validation_exception_field(
|
7422 + | self,
|
7423 + | path: ::std::string::String,
|
7424 + | ) -> crate::model::ValidationExceptionField {
|
7425 + | match self {
|
7426 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7427 + | crate::model::ValidationExceptionField {
|
7428 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7429 + | path,
|
7430 + | },
|
7431 + | Self::Member(index, member_constraint_violation) =>
|
7432 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7433 + | }
|
7434 + | }
|
7435 + | }
|
7436 + | }
|
7437 + | pub(crate) mod set_of_range_short_internal {
|
7438 + |
|
7439 + | #[allow(clippy::enum_variant_names)]
|
7440 + | #[derive(Debug, PartialEq)]
|
7441 + | pub(crate) enum ConstraintViolation {
|
7442 + | /// Constraint violation error when the list does not contain unique items
|
7443 + | UniqueItems {
|
7444 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7445 + | /// at least two elements.
|
7446 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7447 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7448 + | /// Nothing is guaranteed about the order of the indices.
|
7449 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7450 + | /// The original vector, that contains duplicate items.
|
7451 + | original: ::std::vec::Vec<crate::model::RangeShort>,
|
7452 + | },
|
7453 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7454 + | /// The first component of the tuple is the index in the collection where the
|
7455 + | /// first constraint violation was found.
|
7456 + | #[doc(hidden)]
|
7457 + | Member(
|
7458 + | usize,
|
7459 + | crate::model::range_short_internal::ConstraintViolation,
|
7460 + | ),
|
7461 + | }
|
7462 + |
|
7463 + | impl ::std::fmt::Display for ConstraintViolation {
|
7464 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7465 + | let message = match self {
|
7466 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7467 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7468 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7469 + | failing_member)
|
7470 + | };
|
7471 + | write!(f, "{message}")
|
7472 + | }
|
7473 + | }
|
7474 + |
|
7475 + | impl ::std::error::Error for ConstraintViolation {}
|
7476 + | impl ConstraintViolation {
|
7477 + | pub(crate) fn as_validation_exception_field(
|
7478 + | self,
|
7479 + | path: ::std::string::String,
|
7480 + | ) -> crate::model::ValidationExceptionField {
|
7481 + | match self {
|
7482 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7483 + | crate::model::ValidationExceptionField {
|
7484 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7485 + | path,
|
7486 + | },
|
7487 + | Self::Member(index, member_constraint_violation) =>
|
7488 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7489 + | }
|
7490 + | }
|
7491 + | }
|
7492 + | }
|
7493 + | pub(crate) mod set_of_range_integer_internal {
|
7494 + |
|
7495 + | #[allow(clippy::enum_variant_names)]
|
7496 + | #[derive(Debug, PartialEq)]
|
7497 + | pub(crate) enum ConstraintViolation {
|
7498 + | /// Constraint violation error when the list does not contain unique items
|
7499 + | UniqueItems {
|
7500 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7501 + | /// at least two elements.
|
7502 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7503 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7504 + | /// Nothing is guaranteed about the order of the indices.
|
7505 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7506 + | /// The original vector, that contains duplicate items.
|
7507 + | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
7508 + | },
|
7509 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7510 + | /// The first component of the tuple is the index in the collection where the
|
7511 + | /// first constraint violation was found.
|
7512 + | #[doc(hidden)]
|
7513 + | Member(
|
7514 + | usize,
|
7515 + | crate::model::range_integer_internal::ConstraintViolation,
|
7516 + | ),
|
7517 + | }
|
7518 + |
|
7519 + | impl ::std::fmt::Display for ConstraintViolation {
|
7520 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7521 + | let message = match self {
|
7522 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7523 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7524 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7525 + | failing_member)
|
7526 + | };
|
7527 + | write!(f, "{message}")
|
7528 + | }
|
7529 + | }
|
7530 + |
|
7531 + | impl ::std::error::Error for ConstraintViolation {}
|
7532 + | impl ConstraintViolation {
|
7533 + | pub(crate) fn as_validation_exception_field(
|
7534 + | self,
|
7535 + | path: ::std::string::String,
|
7536 + | ) -> crate::model::ValidationExceptionField {
|
7537 + | match self {
|
7538 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7539 + | crate::model::ValidationExceptionField {
|
7540 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7541 + | path,
|
7542 + | },
|
7543 + | Self::Member(index, member_constraint_violation) =>
|
7544 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7545 + | }
|
7546 + | }
|
7547 + | }
|
7548 + | }
|
7549 + | pub(crate) mod set_of_range_long_internal {
|
7550 + |
|
7551 + | #[allow(clippy::enum_variant_names)]
|
7552 + | #[derive(Debug, PartialEq)]
|
7553 + | pub(crate) enum ConstraintViolation {
|
7554 + | /// Constraint violation error when the list does not contain unique items
|
7555 + | UniqueItems {
|
7556 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
7557 + | /// at least two elements.
|
7558 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
7559 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
7560 + | /// Nothing is guaranteed about the order of the indices.
|
7561 + | duplicate_indices: ::std::vec::Vec<usize>,
|
7562 + | /// The original vector, that contains duplicate items.
|
7563 + | original: ::std::vec::Vec<crate::model::RangeLong>,
|
7564 + | },
|
7565 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7566 + | /// The first component of the tuple is the index in the collection where the
|
7567 + | /// first constraint violation was found.
|
7568 + | #[doc(hidden)]
|
7569 + | Member(
|
7570 + | usize,
|
7571 + | crate::model::range_long_internal::ConstraintViolation,
|
7572 + | ),
|
7573 + | }
|
7574 + |
|
7575 + | impl ::std::fmt::Display for ConstraintViolation {
|
7576 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7577 + | let message = match self {
|
7578 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7579 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
7580 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
7581 + | failing_member)
|
7582 + | };
|
7583 + | write!(f, "{message}")
|
7584 + | }
|
7585 + | }
|
7586 + |
|
7587 + | impl ::std::error::Error for ConstraintViolation {}
|
7588 + | impl ConstraintViolation {
|
7589 + | pub(crate) fn as_validation_exception_field(
|
7590 + | self,
|
7591 + | path: ::std::string::String,
|
7592 + | ) -> crate::model::ValidationExceptionField {
|
7593 + | match self {
|
7594 + | Self::UniqueItems { duplicate_indices, .. } =>
|
7595 + | crate::model::ValidationExceptionField {
|
7596 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
7597 + | path,
|
7598 + | },
|
7599 + | Self::Member(index, member_constraint_violation) =>
|
7600 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
7601 + | }
|
7602 + | }
|
7603 + | }
|
7604 + | }
|
7605 + | pub(crate) mod list_of_range_byte_internal {
|
7606 + |
|
7607 + | #[allow(clippy::enum_variant_names)]
|
7608 + | #[derive(Debug, PartialEq)]
|
7609 + | pub(crate) enum ConstraintViolation {
|
7610 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7611 + | /// The first component of the tuple is the index in the collection where the
|
7612 + | /// first constraint violation was found.
|
7613 + | #[doc(hidden)]
|
7614 + | Member(
|
7615 + | usize,
|
7616 + | crate::model::range_byte_internal::ConstraintViolation,
|
7617 + | ),
|
7618 + | }
|
7619 + |
|
7620 + | impl ::std::fmt::Display for ConstraintViolation {
|
7621 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7622 + | let message = match self {
|
7623 + | Self::Member(index, failing_member) => format!(
|
7624 + | "Value at index {index} failed to satisfy constraint. {}",
|
7625 + | failing_member
|
7626 + | ),
|
7627 + | };
|
7628 + | write!(f, "{message}")
|
7629 + | }
|
7630 + | }
|
7631 + |
|
7632 + | impl ::std::error::Error for ConstraintViolation {}
|
7633 + | impl ConstraintViolation {
|
7634 + | pub(crate) fn as_validation_exception_field(
|
7635 + | self,
|
7636 + | path: ::std::string::String,
|
7637 + | ) -> crate::model::ValidationExceptionField {
|
7638 + | match self {
|
7639 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7640 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7641 + | }
|
7642 + | }
|
7643 + | }
|
7644 + | }
|
7645 + | pub(crate) mod list_of_range_short_internal {
|
7646 + |
|
7647 + | #[allow(clippy::enum_variant_names)]
|
7648 + | #[derive(Debug, PartialEq)]
|
7649 + | pub(crate) enum ConstraintViolation {
|
7650 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7651 + | /// The first component of the tuple is the index in the collection where the
|
7652 + | /// first constraint violation was found.
|
7653 + | #[doc(hidden)]
|
7654 + | Member(
|
7655 + | usize,
|
7656 + | crate::model::range_short_internal::ConstraintViolation,
|
7657 + | ),
|
7658 + | }
|
7659 + |
|
7660 + | impl ::std::fmt::Display for ConstraintViolation {
|
7661 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7662 + | let message = match self {
|
7663 + | Self::Member(index, failing_member) => format!(
|
7664 + | "Value at index {index} failed to satisfy constraint. {}",
|
7665 + | failing_member
|
7666 + | ),
|
7667 + | };
|
7668 + | write!(f, "{message}")
|
7669 + | }
|
7670 + | }
|
7671 + |
|
7672 + | impl ::std::error::Error for ConstraintViolation {}
|
7673 + | impl ConstraintViolation {
|
7674 + | pub(crate) fn as_validation_exception_field(
|
7675 + | self,
|
7676 + | path: ::std::string::String,
|
7677 + | ) -> crate::model::ValidationExceptionField {
|
7678 + | match self {
|
7679 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7680 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7681 + | }
|
7682 + | }
|
7683 + | }
|
7684 + | }
|
7685 + | pub(crate) mod list_of_range_integer_internal {
|
7686 + |
|
7687 + | #[allow(clippy::enum_variant_names)]
|
7688 + | #[derive(Debug, PartialEq)]
|
7689 + | pub(crate) enum ConstraintViolation {
|
7690 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7691 + | /// The first component of the tuple is the index in the collection where the
|
7692 + | /// first constraint violation was found.
|
7693 + | #[doc(hidden)]
|
7694 + | Member(
|
7695 + | usize,
|
7696 + | crate::model::range_integer_internal::ConstraintViolation,
|
7697 + | ),
|
7698 + | }
|
7699 + |
|
7700 + | impl ::std::fmt::Display for ConstraintViolation {
|
7701 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7702 + | let message = match self {
|
7703 + | Self::Member(index, failing_member) => format!(
|
7704 + | "Value at index {index} failed to satisfy constraint. {}",
|
7705 + | failing_member
|
7706 + | ),
|
7707 + | };
|
7708 + | write!(f, "{message}")
|
7709 + | }
|
7710 + | }
|
7711 + |
|
7712 + | impl ::std::error::Error for ConstraintViolation {}
|
7713 + | impl ConstraintViolation {
|
7714 + | pub(crate) fn as_validation_exception_field(
|
7715 + | self,
|
7716 + | path: ::std::string::String,
|
7717 + | ) -> crate::model::ValidationExceptionField {
|
7718 + | match self {
|
7719 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7720 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7721 + | }
|
7722 + | }
|
7723 + | }
|
7724 + | }
|
7725 + | pub(crate) mod list_of_range_long_internal {
|
7726 + |
|
7727 + | #[allow(clippy::enum_variant_names)]
|
7728 + | #[derive(Debug, PartialEq)]
|
7729 + | pub(crate) enum ConstraintViolation {
|
7730 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7731 + | /// The first component of the tuple is the index in the collection where the
|
7732 + | /// first constraint violation was found.
|
7733 + | #[doc(hidden)]
|
7734 + | Member(
|
7735 + | usize,
|
7736 + | crate::model::range_long_internal::ConstraintViolation,
|
7737 + | ),
|
7738 + | }
|
7739 + |
|
7740 + | impl ::std::fmt::Display for ConstraintViolation {
|
7741 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7742 + | let message = match self {
|
7743 + | Self::Member(index, failing_member) => format!(
|
7744 + | "Value at index {index} failed to satisfy constraint. {}",
|
7745 + | failing_member
|
7746 + | ),
|
7747 + | };
|
7748 + | write!(f, "{message}")
|
7749 + | }
|
7750 + | }
|
7751 + |
|
7752 + | impl ::std::error::Error for ConstraintViolation {}
|
7753 + | impl ConstraintViolation {
|
7754 + | pub(crate) fn as_validation_exception_field(
|
7755 + | self,
|
7756 + | path: ::std::string::String,
|
7757 + | ) -> crate::model::ValidationExceptionField {
|
7758 + | match self {
|
7759 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7760 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7761 + | }
|
7762 + | }
|
7763 + | }
|
7764 + | }
|
7765 + | pub(crate) mod list_of_enum_string_internal {
|
7766 + |
|
7767 + | #[allow(clippy::enum_variant_names)]
|
7768 + | #[derive(Debug, PartialEq)]
|
7769 + | pub(crate) enum ConstraintViolation {
|
7770 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7771 + | /// The first component of the tuple is the index in the collection where the
|
7772 + | /// first constraint violation was found.
|
7773 + | #[doc(hidden)]
|
7774 + | Member(
|
7775 + | usize,
|
7776 + | crate::model::enum_string_internal::ConstraintViolation,
|
7777 + | ),
|
7778 + | }
|
7779 + |
|
7780 + | impl ::std::fmt::Display for ConstraintViolation {
|
7781 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7782 + | let message = match self {
|
7783 + | Self::Member(index, failing_member) => format!(
|
7784 + | "Value at index {index} failed to satisfy constraint. {}",
|
7785 + | failing_member
|
7786 + | ),
|
7787 + | };
|
7788 + | write!(f, "{message}")
|
7789 + | }
|
7790 + | }
|
7791 + |
|
7792 + | impl ::std::error::Error for ConstraintViolation {}
|
7793 + | impl ConstraintViolation {
|
7794 + | pub(crate) fn as_validation_exception_field(
|
7795 + | self,
|
7796 + | path: ::std::string::String,
|
7797 + | ) -> crate::model::ValidationExceptionField {
|
7798 + | match self {
|
7799 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
7800 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
7801 + | }
|
7802 + | }
|
7803 + | }
|
7804 + | }
|
7805 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7806 + | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
7807 + |
|
7808 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7809 + | /// Holds one variant for each of the ways the builder can fail.
|
7810 + | #[non_exhaustive]
|
7811 + | #[allow(clippy::enum_variant_names)]
|
7812 + | pub(crate) enum ConstraintViolation {
|
7813 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
7814 + | MissingRecursiveMember,
|
7815 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`.
|
7816 + | #[doc(hidden)]
|
7817 + | RecursiveMember(
|
7818 + | ::std::boxed::Box<
|
7819 + | crate::model::recursive_shapes_input_output_nested2_internal::ConstraintViolation,
|
7820 + | >,
|
7821 + | ),
|
7822 + | }
|
7823 + | impl ::std::fmt::Display for ConstraintViolation {
|
7824 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7825 + | match self {
|
7826 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
7827 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested1`"),
|
7828 + | }
|
7829 + | }
|
7830 + | }
|
7831 + | impl ::std::error::Error for ConstraintViolation {}
|
7832 + | impl ConstraintViolation {
|
7833 + | pub(crate) fn as_validation_exception_field(
|
7834 + | self,
|
7835 + | path: ::std::string::String,
|
7836 + | ) -> crate::model::ValidationExceptionField {
|
7837 + | match self {
|
7838 + | ConstraintViolation::MissingRecursiveMember => crate::model::ValidationExceptionField {
|
7839 + | message: format!("Value at '{}/recursiveMember' failed to satisfy constraint: Member must not be null", path),
|
7840 + | path: path + "/recursiveMember",
|
7841 + | },
|
7842 + | ConstraintViolation::RecursiveMember(inner) => inner.as_validation_exception_field(path + "/recursiveMember"),
|
7843 + | }
|
7844 + | }
|
7845 + | }
|
7846 + | impl ::std::convert::From<Builder>
|
7847 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>
|
7848 + | {
|
7849 + | fn from(builder: Builder) -> Self {
|
7850 + | Self::Unconstrained(builder)
|
7851 + | }
|
7852 + | }
|
7853 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
7854 + | type Error = ConstraintViolation;
|
7855 + |
|
7856 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7857 + | builder.build()
|
7858 + | }
|
7859 + | }
|
7860 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7861 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7862 + | pub(crate) struct Builder {
|
7863 + | pub(crate) recursive_member: ::std::option::Option<
|
7864 + | ::std::boxed::Box<
|
7865 + | crate::constrained::MaybeConstrained<
|
7866 + | crate::model::RecursiveShapesInputOutputNested2,
|
7867 + | >,
|
7868 + | >,
|
7869 + | >,
|
7870 + | }
|
7871 + | impl Builder {
|
7872 + | #[allow(missing_docs)] // documentation missing in model
|
7873 + | pub(crate) fn set_recursive_member(
|
7874 + | mut self,
|
7875 + | input: impl ::std::convert::Into<
|
7876 + | ::std::boxed::Box<
|
7877 + | crate::constrained::MaybeConstrained<
|
7878 + | crate::model::RecursiveShapesInputOutputNested2,
|
7879 + | >,
|
7880 + | >,
|
7881 + | >,
|
7882 + | ) -> Self {
|
7883 + | self.recursive_member = Some(input.into());
|
7884 + | self
|
7885 + | }
|
7886 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7887 + | ///
|
7888 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if a [`ConstraintViolation`] occurs.
|
7889 + | ///
|
7890 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
7891 + | pub fn build(
|
7892 + | self,
|
7893 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7894 + | self.build_enforcing_all_constraints()
|
7895 + | }
|
7896 + | fn build_enforcing_all_constraints(
|
7897 + | self,
|
7898 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7899 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
7900 + | recursive_member: self
|
7901 + | .recursive_member
|
7902 + | .map(|v| match *v {
|
7903 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(Box::new(x)),
|
7904 + | crate::constrained::MaybeConstrained::Unconstrained(x) => {
|
7905 + | Ok(Box::new(x.try_into()?))
|
7906 + | }
|
7476 7907 | })
|
7477 7908 | .map(|res| {
|
7478 - | res.map(|v| v.into())
|
7479 - | .map_err(ConstraintViolation::ListOfLengthPatternString)
|
7480 - | })
|
7481 - | .transpose()?,
|
7482 - | set_of_length_pattern_string: self
|
7483 - | .set_of_length_pattern_string
|
7484 - | .map(|v| match v {
|
7485 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7486 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7487 - | })
|
7488 - | .map(|res| res.map_err(ConstraintViolation::SetOfLengthPatternString))
|
7489 - | .transpose()?
|
7490 - | .map(|v: crate::model::SetOfLengthPatternString| v.into()),
|
7491 - | length_list_of_pattern_string: self
|
7492 - | .length_list_of_pattern_string
|
7493 - | .map(|v| match v {
|
7494 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7495 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7909 + | res.map_err(Box::new)
|
7910 + | .map_err(ConstraintViolation::RecursiveMember)
|
7496 7911 | })
|
7497 - | .map(|res| res.map_err(ConstraintViolation::LengthListOfPatternString))
|
7498 7912 | .transpose()?
|
7499 - | .map(|v: crate::model::LengthListOfPatternString| v.into()),
|
7500 - | length_set_of_pattern_string: self
|
7501 - | .length_set_of_pattern_string
|
7502 - | .map(|v| match v {
|
7503 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
7504 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
7913 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
7505 7914 | })
|
7506 - | .map(|res| res.map_err(ConstraintViolation::LengthSetOfPatternString))
|
7507 - | .transpose()?
|
7508 - | .map(|v: crate::model::LengthSetOfPatternString| v.into()),
|
7915 + | }
|
7916 + | }
|
7917 + | }
|
7918 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7919 + | pub mod recursive_shapes_input_output_nested1 {
|
7920 + |
|
7921 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7922 + | /// Holds one variant for each of the ways the builder can fail.
|
7923 + | #[allow(clippy::enum_variant_names)]
|
7924 + | pub enum ConstraintViolation {
|
7925 + | /// `recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`.
|
7926 + | MissingRecursiveMember,
|
7927 + | }
|
7928 + | impl ::std::fmt::Display for ConstraintViolation {
|
7929 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7930 + | match self {
|
7931 + | ConstraintViolation::MissingRecursiveMember => write!(f, "`recursive_member` was not provided but it is required when building `RecursiveShapesInputOutputNested1`"),
|
7932 + | }
|
7933 + | }
|
7934 + | }
|
7935 + | impl ::std::error::Error for ConstraintViolation {}
|
7936 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
7937 + | type Error = ConstraintViolation;
|
7938 + |
|
7939 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7940 + | builder.build()
|
7941 + | }
|
7942 + | }
|
7943 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7944 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7945 + | pub struct Builder {
|
7946 + | pub(crate) recursive_member: ::std::option::Option<
|
7947 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
7948 + | >,
|
7949 + | }
|
7950 + | impl Builder {
|
7951 + | #[allow(missing_docs)] // documentation missing in model
|
7952 + | pub fn recursive_member(
|
7953 + | mut self,
|
7954 + | input: ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
7955 + | ) -> Self {
|
7956 + | self.recursive_member = Some(input);
|
7957 + | self
|
7958 + | }
|
7959 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
7960 + | ///
|
7961 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1) if you do not provide a value for all non-`Option`al members.
|
7962 + | ///
|
7963 + | pub fn build(
|
7964 + | self,
|
7965 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7966 + | self.build_enforcing_required_and_enum_traits()
|
7967 + | }
|
7968 + | fn build_enforcing_required_and_enum_traits(
|
7969 + | self,
|
7970 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested1, ConstraintViolation> {
|
7971 + | Ok(crate::model::RecursiveShapesInputOutputNested1 {
|
7972 + | recursive_member: self
|
7973 + | .recursive_member
|
7974 + | .ok_or(ConstraintViolation::MissingRecursiveMember)?,
|
7509 7975 | })
|
7510 7976 | }
|
7511 7977 | }
|
7512 7978 | }
|
7513 - | /// See [`ConA`](crate::model::ConA).
|
7514 - | pub mod con_a {
|
7979 + | pub(crate) mod recursive_list_internal {
|
7980 + |
|
7981 + | #[allow(clippy::enum_variant_names)]
|
7982 + | #[derive(Debug, PartialEq)]
|
7983 + | pub(crate) enum ConstraintViolation {
|
7984 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
7985 + | /// The first component of the tuple is the index in the collection where the
|
7986 + | /// first constraint violation was found.
|
7987 + | #[doc(hidden)]
|
7988 + | Member(
|
7989 + | usize,
|
7990 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
7991 + | ),
|
7992 + | }
|
7993 + |
|
7994 + | impl ::std::fmt::Display for ConstraintViolation {
|
7995 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7996 + | let message = match self {
|
7997 + | Self::Member(index, failing_member) => format!(
|
7998 + | "Value at index {index} failed to satisfy constraint. {}",
|
7999 + | failing_member
|
8000 + | ),
|
8001 + | };
|
8002 + | write!(f, "{message}")
|
8003 + | }
|
8004 + | }
|
8005 + |
|
8006 + | impl ::std::error::Error for ConstraintViolation {}
|
8007 + | impl ConstraintViolation {
|
8008 + | pub(crate) fn as_validation_exception_field(
|
8009 + | self,
|
8010 + | path: ::std::string::String,
|
8011 + | ) -> crate::model::ValidationExceptionField {
|
8012 + | match self {
|
8013 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8014 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8015 + | }
|
8016 + | }
|
8017 + | }
|
8018 + | }
|
8019 + | pub(crate) mod con_b_map_internal {
|
8020 + |
|
8021 + | #[allow(clippy::enum_variant_names)]
|
8022 + | #[derive(Debug, PartialEq)]
|
8023 + | pub(crate) enum ConstraintViolation {
|
8024 + | Length(usize),
|
8025 + |
|
8026 + | #[doc(hidden)]
|
8027 + | Value(
|
8028 + | ::std::string::String,
|
8029 + | crate::model::length_string_internal::ConstraintViolation,
|
8030 + | ),
|
8031 + | }
|
8032 + |
|
8033 + | impl ::std::fmt::Display for ConstraintViolation {
|
8034 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8035 + | match self {
|
8036 + | Self::Length(length) => {
|
8037 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConBMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
8038 + | }
|
8039 + |
|
8040 + | Self::Value(_, value_constraint_violation) => {
|
8041 + | write!(f, "{}", value_constraint_violation)
|
8042 + | }
|
8043 + | }
|
8044 + | }
|
8045 + | }
|
8046 + |
|
8047 + | impl ::std::error::Error for ConstraintViolation {}
|
8048 + | impl ConstraintViolation {
|
8049 + | pub(crate) fn as_validation_exception_field(
|
8050 + | self,
|
8051 + | path: ::std::string::String,
|
8052 + | ) -> crate::model::ValidationExceptionField {
|
8053 + | match self {
|
8054 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8055 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
8056 + | path,
|
8057 + | },
|
8058 + | Self::Value(key, value_constraint_violation) => value_constraint_violation.as_validation_exception_field(path + "/" + key.as_str()),
|
8059 + | }
|
8060 + | }
|
8061 + | }
|
8062 + | }
|
8063 + | pub(crate) mod map_of_list_of_length_string_internal {
|
8064 + |
|
8065 + | #[allow(clippy::enum_variant_names)]
|
8066 + | #[derive(Debug, PartialEq)]
|
8067 + | pub(crate) enum ConstraintViolation {
|
8068 + | #[doc(hidden)]
|
8069 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
8070 + | #[doc(hidden)]
|
8071 + | Value(
|
8072 + | crate::model::LengthString,
|
8073 + | crate::model::list_of_length_string_internal::ConstraintViolation,
|
8074 + | ),
|
8075 + | }
|
8076 + |
|
8077 + | impl ::std::fmt::Display for ConstraintViolation {
|
8078 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8079 + | match self {
|
8080 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8081 + | Self::Value(_, value_constraint_violation) => {
|
8082 + | write!(f, "{}", value_constraint_violation)
|
8083 + | }
|
8084 + | }
|
8085 + | }
|
8086 + | }
|
8087 + |
|
8088 + | impl ::std::error::Error for ConstraintViolation {}
|
8089 + | impl ConstraintViolation {
|
8090 + | pub(crate) fn as_validation_exception_field(
|
8091 + | self,
|
8092 + | path: ::std::string::String,
|
8093 + | ) -> crate::model::ValidationExceptionField {
|
8094 + | match self {
|
8095 + | Self::Key(key_constraint_violation) => {
|
8096 + | key_constraint_violation.as_validation_exception_field(path)
|
8097 + | }
|
8098 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8099 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8100 + | }
|
8101 + | }
|
8102 + | }
|
8103 + | }
|
8104 + | pub(crate) mod map_of_set_of_length_string_internal {
|
8105 + |
|
8106 + | #[allow(clippy::enum_variant_names)]
|
8107 + | #[derive(Debug, PartialEq)]
|
8108 + | pub(crate) enum ConstraintViolation {
|
8109 + | #[doc(hidden)]
|
8110 + | Key(crate::model::length_string_internal::ConstraintViolation),
|
8111 + | #[doc(hidden)]
|
8112 + | Value(
|
8113 + | crate::model::LengthString,
|
8114 + | crate::model::set_of_length_string_internal::ConstraintViolation,
|
8115 + | ),
|
8116 + | }
|
8117 + |
|
8118 + | impl ::std::fmt::Display for ConstraintViolation {
|
8119 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8120 + | match self {
|
8121 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8122 + | Self::Value(_, value_constraint_violation) => {
|
8123 + | write!(f, "{}", value_constraint_violation)
|
8124 + | }
|
8125 + | }
|
8126 + | }
|
8127 + | }
|
8128 + |
|
8129 + | impl ::std::error::Error for ConstraintViolation {}
|
8130 + | impl ConstraintViolation {
|
8131 + | pub(crate) fn as_validation_exception_field(
|
8132 + | self,
|
8133 + | path: ::std::string::String,
|
8134 + | ) -> crate::model::ValidationExceptionField {
|
8135 + | match self {
|
8136 + | Self::Key(key_constraint_violation) => {
|
8137 + | key_constraint_violation.as_validation_exception_field(path)
|
8138 + | }
|
8139 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8140 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8141 + | }
|
8142 + | }
|
8143 + | }
|
8144 + | }
|
8145 + | pub(crate) mod map_of_length_list_of_pattern_string_internal {
|
7515 8146 |
|
7516 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
7517 - | /// Holds one variant for each of the ways the builder can fail.
|
7518 8147 | #[allow(clippy::enum_variant_names)]
|
7519 - | pub enum ConstraintViolation {
|
7520 - | /// `con_b` was not provided but it is required when building `ConA`.
|
7521 - | MissingConB,
|
8148 + | #[derive(Debug, PartialEq)]
|
8149 + | pub(crate) enum ConstraintViolation {
|
8150 + | #[doc(hidden)]
|
8151 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
8152 + | #[doc(hidden)]
|
8153 + | Value(
|
8154 + | crate::model::PatternString,
|
8155 + | crate::model::length_list_of_pattern_string_internal::ConstraintViolation,
|
8156 + | ),
|
7522 8157 | }
|
8158 + |
|
7523 8159 | impl ::std::fmt::Display for ConstraintViolation {
|
7524 8160 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
7525 8161 | match self {
|
7526 - | ConstraintViolation::MissingConB => write!(
|
7527 - | f,
|
7528 - | "`con_b` was not provided but it is required when building `ConA`"
|
7529 - | ),
|
8162 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8163 + | Self::Value(_, value_constraint_violation) => {
|
8164 + | write!(f, "{}", value_constraint_violation)
|
8165 + | }
|
7530 8166 | }
|
7531 8167 | }
|
7532 8168 | }
|
7533 - | impl ::std::error::Error for ConstraintViolation {}
|
7534 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConA {
|
7535 - | type Error = ConstraintViolation;
|
7536 8169 |
|
7537 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
7538 - | builder.build()
|
8170 + | impl ::std::error::Error for ConstraintViolation {}
|
8171 + | impl ConstraintViolation {
|
8172 + | pub(crate) fn as_validation_exception_field(
|
8173 + | self,
|
8174 + | path: ::std::string::String,
|
8175 + | ) -> crate::model::ValidationExceptionField {
|
8176 + | match self {
|
8177 + | Self::Key(key_constraint_violation) => {
|
8178 + | key_constraint_violation.as_validation_exception_field(path)
|
7539 8179 | }
|
8180 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8181 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7540 8182 | }
|
7541 - | /// A builder for [`ConA`](crate::model::ConA).
|
7542 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
7543 - | pub struct Builder {
|
7544 - | pub(crate) con_b: ::std::option::Option<crate::model::ConB>,
|
7545 - | pub(crate) opt_con_b: ::std::option::Option<crate::model::ConB>,
|
7546 - | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
7547 - | pub(crate) min_length_string: ::std::option::Option<::std::string::String>,
|
7548 - | pub(crate) max_length_string: ::std::option::Option<::std::string::String>,
|
7549 - | pub(crate) fixed_length_string: ::std::option::Option<::std::string::String>,
|
7550 - | pub(crate) length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7551 - | pub(crate) min_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7552 - | pub(crate) max_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7553 - | pub(crate) fixed_length_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7554 - | pub(crate) range_integer: ::std::option::Option<i32>,
|
7555 - | pub(crate) min_range_integer: ::std::option::Option<i32>,
|
7556 - | pub(crate) max_range_integer: ::std::option::Option<i32>,
|
7557 - | pub(crate) fixed_value_integer: ::std::option::Option<i32>,
|
7558 - | pub(crate) range_short: ::std::option::Option<i16>,
|
7559 - | pub(crate) min_range_short: ::std::option::Option<i16>,
|
7560 - | pub(crate) max_range_short: ::std::option::Option<i16>,
|
7561 - | pub(crate) fixed_value_short: ::std::option::Option<i16>,
|
7562 - | pub(crate) range_long: ::std::option::Option<i64>,
|
7563 - | pub(crate) min_range_long: ::std::option::Option<i64>,
|
7564 - | pub(crate) max_range_long: ::std::option::Option<i64>,
|
7565 - | pub(crate) fixed_value_long: ::std::option::Option<i64>,
|
7566 - | pub(crate) range_byte: ::std::option::Option<i8>,
|
7567 - | pub(crate) min_range_byte: ::std::option::Option<i8>,
|
7568 - | pub(crate) max_range_byte: ::std::option::Option<i8>,
|
7569 - | pub(crate) fixed_value_byte: ::std::option::Option<i8>,
|
7570 - | pub(crate) con_b_list:
|
7571 - | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7572 - | pub(crate) length_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7573 - | pub(crate) sensitive_length_list:
|
7574 - | ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7575 - | pub(crate) con_b_set:
|
7576 - | ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7577 - | pub(crate) con_b_map: ::std::option::Option<
|
7578 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7579 - | >,
|
7580 - | pub(crate) length_map: ::std::option::Option<
|
7581 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7582 - | >,
|
7583 - | pub(crate) map_of_map_of_list_of_list_of_con_b: ::std::option::Option<
|
7584 - | ::std::collections::HashMap<
|
7585 - | ::std::string::String,
|
7586 - | ::std::collections::HashMap<
|
7587 - | ::std::string::String,
|
7588 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7589 - | >,
|
7590 - | >,
|
7591 - | >,
|
7592 - | pub(crate) sparse_map: ::std::option::Option<
|
7593 - | ::std::collections::HashMap<
|
7594 - | ::std::string::String,
|
7595 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7596 - | >,
|
7597 - | >,
|
7598 - | pub(crate) sparse_list:
|
7599 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7600 - | pub(crate) sparse_length_map: ::std::option::Option<
|
7601 - | ::std::collections::HashMap<
|
7602 - | ::std::string::String,
|
7603 - | ::std::option::Option<::std::string::String>,
|
7604 - | >,
|
7605 - | >,
|
7606 - | pub(crate) sparse_length_list:
|
7607 - | ::std::option::Option<::std::vec::Vec<::std::option::Option<::std::string::String>>>,
|
7608 - | pub(crate) constrained_union: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7609 - | pub(crate) enum_string: ::std::option::Option<crate::model::EnumString>,
|
7610 - | pub(crate) list_of_length_string:
|
7611 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7612 - | pub(crate) set_of_length_string:
|
7613 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7614 - | pub(crate) map_of_length_string: ::std::option::Option<
|
7615 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7616 - | >,
|
7617 - | pub(crate) list_of_length_blob:
|
7618 - | ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
7619 - | pub(crate) map_of_length_blob: ::std::option::Option<
|
7620 - | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
7621 - | >,
|
7622 - | pub(crate) list_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7623 - | pub(crate) set_of_range_integer: ::std::option::Option<::std::vec::Vec<i32>>,
|
7624 - | pub(crate) map_of_range_integer:
|
7625 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
7626 - | pub(crate) list_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7627 - | pub(crate) set_of_range_short: ::std::option::Option<::std::vec::Vec<i16>>,
|
7628 - | pub(crate) map_of_range_short:
|
7629 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
7630 - | pub(crate) list_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7631 - | pub(crate) set_of_range_long: ::std::option::Option<::std::vec::Vec<i64>>,
|
7632 - | pub(crate) map_of_range_long:
|
7633 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
7634 - | pub(crate) list_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7635 - | pub(crate) set_of_range_byte: ::std::option::Option<::std::vec::Vec<i8>>,
|
7636 - | pub(crate) map_of_range_byte:
|
7637 - | ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
7638 - | pub(crate) non_streaming_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
7639 - | pub(crate) pattern_string: ::std::option::Option<::std::string::String>,
|
7640 - | pub(crate) map_of_pattern_string: ::std::option::Option<
|
7641 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7642 - | >,
|
7643 - | pub(crate) list_of_pattern_string:
|
7644 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7645 - | pub(crate) set_of_pattern_string:
|
7646 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7647 - | pub(crate) length_length_pattern_string: ::std::option::Option<::std::string::String>,
|
7648 - | pub(crate) map_of_length_pattern_string: ::std::option::Option<
|
7649 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7650 - | >,
|
7651 - | pub(crate) list_of_length_pattern_string:
|
7652 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7653 - | pub(crate) set_of_length_pattern_string:
|
7654 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7655 - | pub(crate) length_list_of_pattern_string:
|
7656 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7657 - | pub(crate) length_set_of_pattern_string:
|
7658 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7659 8183 | }
|
7660 - | impl Builder {
|
7661 - | #[allow(missing_docs)] // documentation missing in model
|
7662 - | pub fn con_b(mut self, input: crate::model::ConB) -> Self {
|
7663 - | self.con_b = Some(input);
|
7664 - | self
|
7665 8184 | }
|
7666 - | #[allow(missing_docs)] // documentation missing in model
|
7667 - | pub fn opt_con_b(mut self, input: ::std::option::Option<crate::model::ConB>) -> Self {
|
7668 - | self.opt_con_b = input;
|
7669 - | self
|
8185 + | }
|
8186 + | pub(crate) mod map_of_list_of_enum_string_internal {
|
8187 + |
|
8188 + | #[allow(clippy::enum_variant_names)]
|
8189 + | #[derive(Debug, PartialEq)]
|
8190 + | pub(crate) enum ConstraintViolation {
|
8191 + | #[doc(hidden)]
|
8192 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
8193 + | #[doc(hidden)]
|
8194 + | Value(
|
8195 + | crate::model::EnumString,
|
8196 + | crate::model::list_of_enum_string_internal::ConstraintViolation,
|
8197 + | ),
|
7670 8198 | }
|
7671 - | #[allow(missing_docs)] // documentation missing in model
|
7672 - | pub fn length_string(
|
7673 - | mut self,
|
7674 - | input: ::std::option::Option<::std::string::String>,
|
7675 - | ) -> Self {
|
7676 - | self.length_string = input;
|
7677 - | self
|
8199 + |
|
8200 + | impl ::std::fmt::Display for ConstraintViolation {
|
8201 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8202 + | match self {
|
8203 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8204 + | Self::Value(_, value_constraint_violation) => {
|
8205 + | write!(f, "{}", value_constraint_violation)
|
7678 8206 | }
|
7679 - | #[allow(missing_docs)] // documentation missing in model
|
7680 - | pub fn min_length_string(
|
7681 - | mut self,
|
7682 - | input: ::std::option::Option<::std::string::String>,
|
7683 - | ) -> Self {
|
7684 - | self.min_length_string = input;
|
7685 - | self
|
7686 8207 | }
|
7687 - | #[allow(missing_docs)] // documentation missing in model
|
7688 - | pub fn max_length_string(
|
7689 - | mut self,
|
7690 - | input: ::std::option::Option<::std::string::String>,
|
7691 - | ) -> Self {
|
7692 - | self.max_length_string = input;
|
7693 - | self
|
7694 8208 | }
|
7695 - | #[allow(missing_docs)] // documentation missing in model
|
7696 - | pub fn fixed_length_string(
|
7697 - | mut self,
|
7698 - | input: ::std::option::Option<::std::string::String>,
|
7699 - | ) -> Self {
|
7700 - | self.fixed_length_string = input;
|
7701 - | self
|
7702 8209 | }
|
7703 - | #[allow(missing_docs)] // documentation missing in model
|
7704 - | pub fn length_blob(
|
7705 - | mut self,
|
7706 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7707 - | ) -> Self {
|
7708 - | self.length_blob = input;
|
7709 - | self
|
8210 + |
|
8211 + | impl ::std::error::Error for ConstraintViolation {}
|
8212 + | impl ConstraintViolation {
|
8213 + | pub(crate) fn as_validation_exception_field(
|
8214 + | self,
|
8215 + | path: ::std::string::String,
|
8216 + | ) -> crate::model::ValidationExceptionField {
|
8217 + | match self {
|
8218 + | Self::Key(key_constraint_violation) => {
|
8219 + | key_constraint_violation.as_validation_exception_field(path)
|
8220 + | }
|
8221 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8222 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7710 8223 | }
|
7711 - | #[allow(missing_docs)] // documentation missing in model
|
7712 - | pub fn min_length_blob(
|
7713 - | mut self,
|
7714 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7715 - | ) -> Self {
|
7716 - | self.min_length_blob = input;
|
7717 - | self
|
7718 8224 | }
|
7719 - | #[allow(missing_docs)] // documentation missing in model
|
7720 - | pub fn max_length_blob(
|
7721 - | mut self,
|
7722 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7723 - | ) -> Self {
|
7724 - | self.max_length_blob = input;
|
7725 - | self
|
7726 8225 | }
|
7727 - | #[allow(missing_docs)] // documentation missing in model
|
7728 - | pub fn fixed_length_blob(
|
7729 - | mut self,
|
7730 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
7731 - | ) -> Self {
|
7732 - | self.fixed_length_blob = input;
|
7733 - | self
|
8226 + | }
|
8227 + | pub(crate) mod map_of_pattern_string_internal {
|
8228 + |
|
8229 + | #[allow(clippy::enum_variant_names)]
|
8230 + | #[derive(Debug, PartialEq)]
|
8231 + | pub(crate) enum ConstraintViolation {
|
8232 + | #[doc(hidden)]
|
8233 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
8234 + | #[doc(hidden)]
|
8235 + | Value(
|
8236 + | crate::model::PatternString,
|
8237 + | crate::model::pattern_string_internal::ConstraintViolation,
|
8238 + | ),
|
7734 8239 | }
|
7735 - | #[allow(missing_docs)] // documentation missing in model
|
7736 - | pub fn range_integer(mut self, input: i32) -> Self {
|
7737 - | self.range_integer = Some(input);
|
7738 - | self
|
8240 + |
|
8241 + | impl ::std::fmt::Display for ConstraintViolation {
|
8242 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8243 + | match self {
|
8244 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8245 + | Self::Value(_, value_constraint_violation) => {
|
8246 + | write!(f, "{}", value_constraint_violation)
|
7739 8247 | }
|
7740 - | #[allow(missing_docs)] // documentation missing in model
|
7741 - | pub fn min_range_integer(mut self, input: i32) -> Self {
|
7742 - | self.min_range_integer = Some(input);
|
7743 - | self
|
7744 8248 | }
|
7745 - | #[allow(missing_docs)] // documentation missing in model
|
7746 - | pub fn max_range_integer(mut self, input: i32) -> Self {
|
7747 - | self.max_range_integer = Some(input);
|
7748 - | self
|
7749 8249 | }
|
7750 - | #[allow(missing_docs)] // documentation missing in model
|
7751 - | pub fn fixed_value_integer(mut self, input: i32) -> Self {
|
7752 - | self.fixed_value_integer = Some(input);
|
7753 - | self
|
7754 8250 | }
|
7755 - | #[allow(missing_docs)] // documentation missing in model
|
7756 - | pub fn range_short(mut self, input: i16) -> Self {
|
7757 - | self.range_short = Some(input);
|
7758 - | self
|
8251 + |
|
8252 + | impl ::std::error::Error for ConstraintViolation {}
|
8253 + | impl ConstraintViolation {
|
8254 + | pub(crate) fn as_validation_exception_field(
|
8255 + | self,
|
8256 + | path: ::std::string::String,
|
8257 + | ) -> crate::model::ValidationExceptionField {
|
8258 + | match self {
|
8259 + | Self::Key(key_constraint_violation) => {
|
8260 + | key_constraint_violation.as_validation_exception_field(path)
|
7759 8261 | }
|
7760 - | #[allow(missing_docs)] // documentation missing in model
|
7761 - | pub fn min_range_short(mut self, input: i16) -> Self {
|
7762 - | self.min_range_short = Some(input);
|
7763 - | self
|
8262 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8263 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7764 8264 | }
|
7765 - | #[allow(missing_docs)] // documentation missing in model
|
7766 - | pub fn max_range_short(mut self, input: i16) -> Self {
|
7767 - | self.max_range_short = Some(input);
|
7768 - | self
|
7769 8265 | }
|
7770 - | #[allow(missing_docs)] // documentation missing in model
|
7771 - | pub fn fixed_value_short(mut self, input: i16) -> Self {
|
7772 - | self.fixed_value_short = Some(input);
|
7773 - | self
|
7774 8266 | }
|
7775 - | #[allow(missing_docs)] // documentation missing in model
|
7776 - | pub fn range_long(mut self, input: i64) -> Self {
|
7777 - | self.range_long = Some(input);
|
7778 - | self
|
8267 + | }
|
8268 + | pub(crate) mod map_of_list_of_pattern_string_internal {
|
8269 + |
|
8270 + | #[allow(clippy::enum_variant_names)]
|
8271 + | #[derive(Debug, PartialEq)]
|
8272 + | pub(crate) enum ConstraintViolation {
|
8273 + | #[doc(hidden)]
|
8274 + | Key(crate::model::pattern_string_internal::ConstraintViolation),
|
8275 + | #[doc(hidden)]
|
8276 + | Value(
|
8277 + | crate::model::PatternString,
|
8278 + | crate::model::list_of_pattern_string_internal::ConstraintViolation,
|
8279 + | ),
|
7779 8280 | }
|
7780 - | #[allow(missing_docs)] // documentation missing in model
|
7781 - | pub fn min_range_long(mut self, input: i64) -> Self {
|
7782 - | self.min_range_long = Some(input);
|
7783 - | self
|
8281 + |
|
8282 + | impl ::std::fmt::Display for ConstraintViolation {
|
8283 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8284 + | match self {
|
8285 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8286 + | Self::Value(_, value_constraint_violation) => {
|
8287 + | write!(f, "{}", value_constraint_violation)
|
7784 8288 | }
|
7785 - | #[allow(missing_docs)] // documentation missing in model
|
7786 - | pub fn max_range_long(mut self, input: i64) -> Self {
|
7787 - | self.max_range_long = Some(input);
|
7788 - | self
|
7789 8289 | }
|
7790 - | #[allow(missing_docs)] // documentation missing in model
|
7791 - | pub fn fixed_value_long(mut self, input: i64) -> Self {
|
7792 - | self.fixed_value_long = Some(input);
|
7793 - | self
|
7794 8290 | }
|
7795 - | #[allow(missing_docs)] // documentation missing in model
|
7796 - | pub fn range_byte(mut self, input: i8) -> Self {
|
7797 - | self.range_byte = Some(input);
|
7798 - | self
|
7799 8291 | }
|
7800 - | #[allow(missing_docs)] // documentation missing in model
|
7801 - | pub fn min_range_byte(mut self, input: i8) -> Self {
|
7802 - | self.min_range_byte = Some(input);
|
7803 - | self
|
8292 + |
|
8293 + | impl ::std::error::Error for ConstraintViolation {}
|
8294 + | impl ConstraintViolation {
|
8295 + | pub(crate) fn as_validation_exception_field(
|
8296 + | self,
|
8297 + | path: ::std::string::String,
|
8298 + | ) -> crate::model::ValidationExceptionField {
|
8299 + | match self {
|
8300 + | Self::Key(key_constraint_violation) => {
|
8301 + | key_constraint_violation.as_validation_exception_field(path)
|
7804 8302 | }
|
7805 - | #[allow(missing_docs)] // documentation missing in model
|
7806 - | pub fn max_range_byte(mut self, input: i8) -> Self {
|
7807 - | self.max_range_byte = Some(input);
|
7808 - | self
|
8303 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8304 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7809 8305 | }
|
7810 - | #[allow(missing_docs)] // documentation missing in model
|
7811 - | pub fn fixed_value_byte(mut self, input: i8) -> Self {
|
7812 - | self.fixed_value_byte = Some(input);
|
7813 - | self
|
7814 8306 | }
|
7815 - | #[allow(missing_docs)] // documentation missing in model
|
7816 - | pub fn con_b_list(
|
7817 - | mut self,
|
7818 - | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>>,
|
7819 - | ) -> Self {
|
7820 - | self.con_b_list = input;
|
7821 - | self
|
7822 8307 | }
|
7823 - | #[allow(missing_docs)] // documentation missing in model
|
7824 - | pub fn length_list(
|
7825 - | mut self,
|
7826 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7827 - | ) -> Self {
|
7828 - | self.length_list = input;
|
7829 - | self
|
8308 + | }
|
8309 + | pub(crate) mod map_of_length_pattern_string_internal {
|
8310 + |
|
8311 + | #[allow(clippy::enum_variant_names)]
|
8312 + | #[derive(Debug, PartialEq)]
|
8313 + | pub(crate) enum ConstraintViolation {
|
8314 + | #[doc(hidden)]
|
8315 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
8316 + | #[doc(hidden)]
|
8317 + | Value(
|
8318 + | crate::model::LengthPatternString,
|
8319 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
8320 + | ),
|
7830 8321 | }
|
7831 - | #[allow(missing_docs)] // documentation missing in model
|
7832 - | pub fn sensitive_length_list(
|
7833 - | mut self,
|
7834 - | input: ::std::option::Option<::std::vec::Vec<crate::model::SensitiveStructure>>,
|
7835 - | ) -> Self {
|
7836 - | self.sensitive_length_list = input;
|
7837 - | self
|
8322 + |
|
8323 + | impl ::std::fmt::Display for ConstraintViolation {
|
8324 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8325 + | match self {
|
8326 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8327 + | Self::Value(_, value_constraint_violation) => {
|
8328 + | write!(f, "{}", value_constraint_violation)
|
7838 8329 | }
|
7839 - | #[allow(missing_docs)] // documentation missing in model
|
7840 - | pub fn con_b_set(
|
7841 - | mut self,
|
7842 - | input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
|
7843 - | ) -> Self {
|
7844 - | self.con_b_set = input;
|
7845 - | self
|
7846 8330 | }
|
7847 - | #[allow(missing_docs)] // documentation missing in model
|
7848 - | pub fn con_b_map(
|
7849 - | mut self,
|
7850 - | input: ::std::option::Option<
|
7851 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7852 - | >,
|
7853 - | ) -> Self {
|
7854 - | self.con_b_map = input;
|
7855 - | self
|
7856 8331 | }
|
7857 - | #[allow(missing_docs)] // documentation missing in model
|
7858 - | pub fn length_map(
|
7859 - | mut self,
|
7860 - | input: ::std::option::Option<
|
7861 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7862 - | >,
|
7863 - | ) -> Self {
|
7864 - | self.length_map = input;
|
7865 - | self
|
7866 8332 | }
|
7867 - | #[allow(missing_docs)] // documentation missing in model
|
7868 - | pub fn map_of_map_of_list_of_list_of_con_b(
|
7869 - | mut self,
|
7870 - | input: ::std::option::Option<
|
7871 - | ::std::collections::HashMap<
|
7872 - | ::std::string::String,
|
7873 - | ::std::collections::HashMap<
|
7874 - | ::std::string::String,
|
7875 - | ::std::vec::Vec<::std::vec::Vec<crate::model::ConB>>,
|
7876 - | >,
|
7877 - | >,
|
7878 - | >,
|
7879 - | ) -> Self {
|
7880 - | self.map_of_map_of_list_of_list_of_con_b = input;
|
7881 - | self
|
8333 + |
|
8334 + | impl ::std::error::Error for ConstraintViolation {}
|
8335 + | impl ConstraintViolation {
|
8336 + | pub(crate) fn as_validation_exception_field(
|
8337 + | self,
|
8338 + | path: ::std::string::String,
|
8339 + | ) -> crate::model::ValidationExceptionField {
|
8340 + | match self {
|
8341 + | Self::Key(key_constraint_violation) => {
|
8342 + | key_constraint_violation.as_validation_exception_field(path)
|
7882 8343 | }
|
7883 - | #[allow(missing_docs)] // documentation missing in model
|
7884 - | pub fn sparse_map(
|
7885 - | mut self,
|
7886 - | input: ::std::option::Option<
|
7887 - | ::std::collections::HashMap<
|
7888 - | ::std::string::String,
|
7889 - | ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7890 - | >,
|
7891 - | >,
|
7892 - | ) -> Self {
|
7893 - | self.sparse_map = input;
|
7894 - | self
|
8344 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8345 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7895 8346 | }
|
7896 - | #[allow(missing_docs)] // documentation missing in model
|
7897 - | pub fn sparse_list(
|
7898 - | mut self,
|
7899 - | input: ::std::option::Option<
|
7900 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7901 - | >,
|
7902 - | ) -> Self {
|
7903 - | self.sparse_list = input;
|
7904 - | self
|
7905 8347 | }
|
7906 - | #[allow(missing_docs)] // documentation missing in model
|
7907 - | pub fn sparse_length_map(
|
7908 - | mut self,
|
7909 - | input: ::std::option::Option<
|
7910 - | ::std::collections::HashMap<
|
7911 - | ::std::string::String,
|
7912 - | ::std::option::Option<::std::string::String>,
|
7913 - | >,
|
7914 - | >,
|
7915 - | ) -> Self {
|
7916 - | self.sparse_length_map = input;
|
7917 - | self
|
7918 8348 | }
|
7919 - | #[allow(missing_docs)] // documentation missing in model
|
7920 - | pub fn sparse_length_list(
|
7921 - | mut self,
|
7922 - | input: ::std::option::Option<
|
7923 - | ::std::vec::Vec<::std::option::Option<::std::string::String>>,
|
7924 - | >,
|
7925 - | ) -> Self {
|
7926 - | self.sparse_length_list = input;
|
7927 - | self
|
8349 + | }
|
8350 + | pub(crate) mod map_of_list_of_length_pattern_string_internal {
|
8351 + |
|
8352 + | #[allow(clippy::enum_variant_names)]
|
8353 + | #[derive(Debug, PartialEq)]
|
8354 + | pub(crate) enum ConstraintViolation {
|
8355 + | #[doc(hidden)]
|
8356 + | Key(crate::model::length_pattern_string_internal::ConstraintViolation),
|
8357 + | #[doc(hidden)]
|
8358 + | Value(
|
8359 + | crate::model::LengthPatternString,
|
8360 + | crate::model::list_of_length_pattern_string_internal::ConstraintViolation,
|
8361 + | ),
|
7928 8362 | }
|
7929 - | /// A union with constrained members.
|
7930 - | pub fn constrained_union(
|
7931 - | mut self,
|
7932 - | input: ::std::option::Option<crate::model::ConstrainedUnion>,
|
7933 - | ) -> Self {
|
7934 - | self.constrained_union = input;
|
7935 - | self
|
8363 + |
|
8364 + | impl ::std::fmt::Display for ConstraintViolation {
|
8365 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8366 + | match self {
|
8367 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8368 + | Self::Value(_, value_constraint_violation) => {
|
8369 + | write!(f, "{}", value_constraint_violation)
|
7936 8370 | }
|
7937 - | #[allow(missing_docs)] // documentation missing in model
|
7938 - | pub fn enum_string(
|
7939 - | mut self,
|
7940 - | input: ::std::option::Option<crate::model::EnumString>,
|
7941 - | ) -> Self {
|
7942 - | self.enum_string = input;
|
7943 - | self
|
7944 8371 | }
|
7945 - | #[allow(missing_docs)] // documentation missing in model
|
7946 - | pub fn list_of_length_string(
|
7947 - | mut self,
|
7948 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7949 - | ) -> Self {
|
7950 - | self.list_of_length_string = input;
|
7951 - | self
|
7952 8372 | }
|
7953 - | #[allow(missing_docs)] // documentation missing in model
|
7954 - | pub fn set_of_length_string(
|
7955 - | mut self,
|
7956 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
7957 - | ) -> Self {
|
7958 - | self.set_of_length_string = input;
|
7959 - | self
|
7960 8373 | }
|
7961 - | #[allow(missing_docs)] // documentation missing in model
|
7962 - | pub fn map_of_length_string(
|
7963 - | mut self,
|
7964 - | input: ::std::option::Option<
|
7965 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
7966 - | >,
|
7967 - | ) -> Self {
|
7968 - | self.map_of_length_string = input;
|
7969 - | self
|
8374 + |
|
8375 + | impl ::std::error::Error for ConstraintViolation {}
|
8376 + | impl ConstraintViolation {
|
8377 + | pub(crate) fn as_validation_exception_field(
|
8378 + | self,
|
8379 + | path: ::std::string::String,
|
8380 + | ) -> crate::model::ValidationExceptionField {
|
8381 + | match self {
|
8382 + | Self::Key(key_constraint_violation) => {
|
8383 + | key_constraint_violation.as_validation_exception_field(path)
|
7970 8384 | }
|
7971 - | #[allow(missing_docs)] // documentation missing in model
|
7972 - | pub fn list_of_length_blob(
|
7973 - | mut self,
|
7974 - | input: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::Blob>>,
|
7975 - | ) -> Self {
|
7976 - | self.list_of_length_blob = input;
|
7977 - | self
|
8385 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8386 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
7978 8387 | }
|
7979 - | #[allow(missing_docs)] // documentation missing in model
|
7980 - | pub fn map_of_length_blob(
|
7981 - | mut self,
|
7982 - | input: ::std::option::Option<
|
7983 - | ::std::collections::HashMap<::std::string::String, ::aws_smithy_types::Blob>,
|
7984 - | >,
|
7985 - | ) -> Self {
|
7986 - | self.map_of_length_blob = input;
|
7987 - | self
|
7988 8388 | }
|
7989 - | #[allow(missing_docs)] // documentation missing in model
|
7990 - | pub fn list_of_range_integer(
|
7991 - | mut self,
|
7992 - | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
7993 - | ) -> Self {
|
7994 - | self.list_of_range_integer = input;
|
7995 - | self
|
7996 8389 | }
|
7997 - | #[allow(missing_docs)] // documentation missing in model
|
7998 - | pub fn set_of_range_integer(
|
7999 - | mut self,
|
8000 - | input: ::std::option::Option<::std::vec::Vec<i32>>,
|
8001 - | ) -> Self {
|
8002 - | self.set_of_range_integer = input;
|
8003 - | self
|
8390 + | }
|
8391 + | pub(crate) mod map_of_enum_string_internal {
|
8392 + |
|
8393 + | #[allow(clippy::enum_variant_names)]
|
8394 + | #[derive(Debug, PartialEq)]
|
8395 + | pub(crate) enum ConstraintViolation {
|
8396 + | #[doc(hidden)]
|
8397 + | Key(crate::model::enum_string_internal::ConstraintViolation),
|
8398 + | #[doc(hidden)]
|
8399 + | Value(
|
8400 + | crate::model::EnumString,
|
8401 + | crate::model::enum_string_internal::ConstraintViolation,
|
8402 + | ),
|
8004 8403 | }
|
8005 - | #[allow(missing_docs)] // documentation missing in model
|
8006 - | pub fn map_of_range_integer(
|
8007 - | mut self,
|
8008 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
|
8009 - | ) -> Self {
|
8010 - | self.map_of_range_integer = input;
|
8011 - | self
|
8404 + |
|
8405 + | impl ::std::fmt::Display for ConstraintViolation {
|
8406 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8407 + | match self {
|
8408 + | Self::Key(key_constraint_violation) => write!(f, "{}", key_constraint_violation),
|
8409 + | Self::Value(_, value_constraint_violation) => {
|
8410 + | write!(f, "{}", value_constraint_violation)
|
8012 8411 | }
|
8013 - | #[allow(missing_docs)] // documentation missing in model
|
8014 - | pub fn list_of_range_short(
|
8015 - | mut self,
|
8016 - | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
8017 - | ) -> Self {
|
8018 - | self.list_of_range_short = input;
|
8019 - | self
|
8020 8412 | }
|
8021 - | #[allow(missing_docs)] // documentation missing in model
|
8022 - | pub fn set_of_range_short(
|
8023 - | mut self,
|
8024 - | input: ::std::option::Option<::std::vec::Vec<i16>>,
|
8025 - | ) -> Self {
|
8026 - | self.set_of_range_short = input;
|
8027 - | self
|
8028 8413 | }
|
8029 - | #[allow(missing_docs)] // documentation missing in model
|
8030 - | pub fn map_of_range_short(
|
8031 - | mut self,
|
8032 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i16>>,
|
8033 - | ) -> Self {
|
8034 - | self.map_of_range_short = input;
|
8035 - | self
|
8036 8414 | }
|
8037 - | #[allow(missing_docs)] // documentation missing in model
|
8038 - | pub fn list_of_range_long(
|
8039 - | mut self,
|
8040 - | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
8041 - | ) -> Self {
|
8042 - | self.list_of_range_long = input;
|
8043 - | self
|
8415 + |
|
8416 + | impl ::std::error::Error for ConstraintViolation {}
|
8417 + | impl ConstraintViolation {
|
8418 + | pub(crate) fn as_validation_exception_field(
|
8419 + | self,
|
8420 + | path: ::std::string::String,
|
8421 + | ) -> crate::model::ValidationExceptionField {
|
8422 + | match self {
|
8423 + | Self::Key(key_constraint_violation) => {
|
8424 + | key_constraint_violation.as_validation_exception_field(path)
|
8044 8425 | }
|
8045 - | #[allow(missing_docs)] // documentation missing in model
|
8046 - | pub fn set_of_range_long(
|
8047 - | mut self,
|
8048 - | input: ::std::option::Option<::std::vec::Vec<i64>>,
|
8049 - | ) -> Self {
|
8050 - | self.set_of_range_long = input;
|
8051 - | self
|
8426 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8427 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
8052 8428 | }
|
8053 - | #[allow(missing_docs)] // documentation missing in model
|
8054 - | pub fn map_of_range_long(
|
8055 - | mut self,
|
8056 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i64>>,
|
8057 - | ) -> Self {
|
8058 - | self.map_of_range_long = input;
|
8059 - | self
|
8060 8429 | }
|
8061 - | #[allow(missing_docs)] // documentation missing in model
|
8062 - | pub fn list_of_range_byte(
|
8063 - | mut self,
|
8064 - | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
8065 - | ) -> Self {
|
8066 - | self.list_of_range_byte = input;
|
8067 - | self
|
8068 8430 | }
|
8069 - | #[allow(missing_docs)] // documentation missing in model
|
8070 - | pub fn set_of_range_byte(
|
8071 - | mut self,
|
8072 - | input: ::std::option::Option<::std::vec::Vec<i8>>,
|
8073 - | ) -> Self {
|
8074 - | self.set_of_range_byte = input;
|
8075 - | self
|
8431 + | }
|
8432 + | /// See [`ConB`](crate::model::ConB).
|
8433 + | pub(crate) mod con_b_internal {
|
8434 + |
|
8435 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8436 + | /// Holds one variant for each of the ways the builder can fail.
|
8437 + | #[non_exhaustive]
|
8438 + | #[allow(clippy::enum_variant_names)]
|
8439 + | pub(crate) enum ConstraintViolation {
|
8440 + | /// `nice` was not provided but it is required when building `ConB`.
|
8441 + | MissingNice,
|
8442 + | /// `int` was not provided but it is required when building `ConB`.
|
8443 + | MissingInt,
|
8444 + | }
|
8445 + | impl ::std::fmt::Display for ConstraintViolation {
|
8446 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8447 + | match self {
|
8448 + | ConstraintViolation::MissingNice => write!(
|
8449 + | f,
|
8450 + | "`nice` was not provided but it is required when building `ConB`"
|
8451 + | ),
|
8452 + | ConstraintViolation::MissingInt => write!(
|
8453 + | f,
|
8454 + | "`int` was not provided but it is required when building `ConB`"
|
8455 + | ),
|
8456 + | }
|
8076 8457 | }
|
8077 - | #[allow(missing_docs)] // documentation missing in model
|
8078 - | pub fn map_of_range_byte(
|
8079 - | mut self,
|
8080 - | input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i8>>,
|
8081 - | ) -> Self {
|
8082 - | self.map_of_range_byte = input;
|
8083 - | self
|
8084 8458 | }
|
8085 - | #[allow(missing_docs)] // documentation missing in model
|
8086 - | pub fn non_streaming_blob(
|
8087 - | mut self,
|
8088 - | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
8089 - | ) -> Self {
|
8090 - | self.non_streaming_blob = input;
|
8091 - | self
|
8459 + | impl ::std::error::Error for ConstraintViolation {}
|
8460 + | impl ConstraintViolation {
|
8461 + | pub(crate) fn as_validation_exception_field(
|
8462 + | self,
|
8463 + | path: ::std::string::String,
|
8464 + | ) -> crate::model::ValidationExceptionField {
|
8465 + | match self {
|
8466 + | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
8467 + | message: format!(
|
8468 + | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
8469 + | path
|
8470 + | ),
|
8471 + | path: path + "/nice",
|
8472 + | },
|
8473 + | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
8474 + | message: format!(
|
8475 + | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
8476 + | path
|
8477 + | ),
|
8478 + | path: path + "/int",
|
8479 + | },
|
8092 8480 | }
|
8093 - | #[allow(missing_docs)] // documentation missing in model
|
8094 - | pub fn pattern_string(
|
8095 - | mut self,
|
8096 - | input: ::std::option::Option<::std::string::String>,
|
8097 - | ) -> Self {
|
8098 - | self.pattern_string = input;
|
8099 - | self
|
8100 8481 | }
|
8101 - | #[allow(missing_docs)] // documentation missing in model
|
8102 - | pub fn map_of_pattern_string(
|
8103 - | mut self,
|
8104 - | input: ::std::option::Option<
|
8105 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8106 - | >,
|
8107 - | ) -> Self {
|
8108 - | self.map_of_pattern_string = input;
|
8109 - | self
|
8110 8482 | }
|
8111 - | #[allow(missing_docs)] // documentation missing in model
|
8112 - | pub fn list_of_pattern_string(
|
8113 - | mut self,
|
8114 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8115 - | ) -> Self {
|
8116 - | self.list_of_pattern_string = input;
|
8117 - | self
|
8483 + | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
8484 + | fn from(builder: Builder) -> Self {
|
8485 + | Self::Unconstrained(builder)
|
8118 8486 | }
|
8119 - | #[allow(missing_docs)] // documentation missing in model
|
8120 - | pub fn set_of_pattern_string(
|
8121 - | mut self,
|
8122 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8123 - | ) -> Self {
|
8124 - | self.set_of_pattern_string = input;
|
8125 - | self
|
8126 8487 | }
|
8127 - | #[allow(missing_docs)] // documentation missing in model
|
8128 - | pub fn length_length_pattern_string(
|
8129 - | mut self,
|
8130 - | input: ::std::option::Option<::std::string::String>,
|
8131 - | ) -> Self {
|
8132 - | self.length_length_pattern_string = input;
|
8133 - | self
|
8488 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
8489 + | type Error = ConstraintViolation;
|
8490 + |
|
8491 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8492 + | builder.build()
|
8134 8493 | }
|
8135 - | #[allow(missing_docs)] // documentation missing in model
|
8136 - | pub fn map_of_length_pattern_string(
|
8137 - | mut self,
|
8138 - | input: ::std::option::Option<
|
8139 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
8140 - | >,
|
8141 - | ) -> Self {
|
8142 - | self.map_of_length_pattern_string = input;
|
8143 - | self
|
8144 8494 | }
|
8495 + | /// A builder for [`ConB`](crate::model::ConB).
|
8496 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8497 + | pub(crate) struct Builder {
|
8498 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
8499 + | pub(crate) int: ::std::option::Option<i32>,
|
8500 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
8501 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
8502 + | }
|
8503 + | impl Builder {
|
8145 8504 | #[allow(missing_docs)] // documentation missing in model
|
8146 - | pub fn list_of_length_pattern_string(
|
8505 + | pub(crate) fn set_nice(
|
8147 8506 | mut self,
|
8148 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8507 + | input: impl ::std::convert::Into<::std::string::String>,
|
8149 8508 | ) -> Self {
|
8150 - | self.list_of_length_pattern_string = input;
|
8509 + | self.nice = Some(input.into());
|
8151 8510 | self
|
8152 8511 | }
|
8153 8512 | #[allow(missing_docs)] // documentation missing in model
|
8154 - | pub fn set_of_length_pattern_string(
|
8155 - | mut self,
|
8156 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8157 - | ) -> Self {
|
8158 - | self.set_of_length_pattern_string = input;
|
8513 + | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
8514 + | self.int = Some(input.into());
|
8159 8515 | self
|
8160 8516 | }
|
8161 8517 | #[allow(missing_docs)] // documentation missing in model
|
8162 - | pub fn length_list_of_pattern_string(
|
8518 + | pub(crate) fn set_opt_nice(
|
8163 8519 | mut self,
|
8164 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8520 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
8165 8521 | ) -> Self {
|
8166 - | self.length_list_of_pattern_string = input;
|
8522 + | self.opt_nice = input.map(|v| v.into());
|
8167 8523 | self
|
8168 8524 | }
|
8169 8525 | #[allow(missing_docs)] // documentation missing in model
|
8170 - | pub fn length_set_of_pattern_string(
|
8171 - | mut self,
|
8172 - | input: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
8173 - | ) -> Self {
|
8174 - | self.length_set_of_pattern_string = input;
|
8526 + | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
8527 + | self.opt_int = input.map(|v| v.into());
|
8175 8528 | self
|
8176 8529 | }
|
8177 - | /// Consumes the builder and constructs a [`ConA`](crate::model::ConA).
|
8178 - | ///
|
8179 - | /// The builder fails to construct a [`ConA`](crate::model::ConA) if you do not provide a value for all non-`Option`al members.
|
8530 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
8180 8531 | ///
|
8181 - | pub fn build(self) -> Result<crate::model::ConA, ConstraintViolation> {
|
8182 - | self.build_enforcing_required_and_enum_traits()
|
8183 - | }
|
8184 - | fn build_enforcing_required_and_enum_traits(
|
8185 - | self,
|
8186 - | ) -> Result<crate::model::ConA, ConstraintViolation> {
|
8187 - | Ok(crate::model::ConA {
|
8188 - | con_b: self.con_b.ok_or(ConstraintViolation::MissingConB)?,
|
8189 - | opt_con_b: self.opt_con_b,
|
8190 - | length_string: self.length_string,
|
8191 - | min_length_string: self.min_length_string,
|
8192 - | max_length_string: self.max_length_string,
|
8193 - | fixed_length_string: self.fixed_length_string,
|
8194 - | length_blob: self.length_blob,
|
8195 - | min_length_blob: self.min_length_blob,
|
8196 - | max_length_blob: self.max_length_blob,
|
8197 - | fixed_length_blob: self.fixed_length_blob,
|
8198 - | range_integer: self.range_integer.unwrap_or(0i32),
|
8199 - | min_range_integer: self.min_range_integer.unwrap_or(0i32),
|
8200 - | max_range_integer: self.max_range_integer.unwrap_or(0i32),
|
8201 - | fixed_value_integer: self.fixed_value_integer.unwrap_or(0i32),
|
8202 - | range_short: self.range_short.unwrap_or(0i16),
|
8203 - | min_range_short: self.min_range_short.unwrap_or(0i16),
|
8204 - | max_range_short: self.max_range_short.unwrap_or(0i16),
|
8205 - | fixed_value_short: self.fixed_value_short.unwrap_or(0i16),
|
8206 - | range_long: self.range_long.unwrap_or(0i64),
|
8207 - | min_range_long: self.min_range_long.unwrap_or(0i64),
|
8208 - | max_range_long: self.max_range_long.unwrap_or(0i64),
|
8209 - | fixed_value_long: self.fixed_value_long.unwrap_or(0i64),
|
8210 - | range_byte: self.range_byte.unwrap_or(0i8),
|
8211 - | min_range_byte: self.min_range_byte.unwrap_or(0i8),
|
8212 - | max_range_byte: self.max_range_byte.unwrap_or(0i8),
|
8213 - | fixed_value_byte: self.fixed_value_byte.unwrap_or(0i8),
|
8214 - | con_b_list: self.con_b_list,
|
8215 - | length_list: self.length_list,
|
8216 - | sensitive_length_list: self.sensitive_length_list,
|
8217 - | con_b_set: self.con_b_set,
|
8218 - | con_b_map: self.con_b_map,
|
8219 - | length_map: self.length_map,
|
8220 - | map_of_map_of_list_of_list_of_con_b: self.map_of_map_of_list_of_list_of_con_b,
|
8221 - | sparse_map: self.sparse_map,
|
8222 - | sparse_list: self.sparse_list,
|
8223 - | sparse_length_map: self.sparse_length_map,
|
8224 - | sparse_length_list: self.sparse_length_list,
|
8225 - | constrained_union: self.constrained_union,
|
8226 - | enum_string: self.enum_string,
|
8227 - | list_of_length_string: self.list_of_length_string,
|
8228 - | set_of_length_string: self.set_of_length_string,
|
8229 - | map_of_length_string: self.map_of_length_string,
|
8230 - | list_of_length_blob: self.list_of_length_blob,
|
8231 - | map_of_length_blob: self.map_of_length_blob,
|
8232 - | list_of_range_integer: self.list_of_range_integer,
|
8233 - | set_of_range_integer: self.set_of_range_integer,
|
8234 - | map_of_range_integer: self.map_of_range_integer,
|
8235 - | list_of_range_short: self.list_of_range_short,
|
8236 - | set_of_range_short: self.set_of_range_short,
|
8237 - | map_of_range_short: self.map_of_range_short,
|
8238 - | list_of_range_long: self.list_of_range_long,
|
8239 - | set_of_range_long: self.set_of_range_long,
|
8240 - | map_of_range_long: self.map_of_range_long,
|
8241 - | list_of_range_byte: self.list_of_range_byte,
|
8242 - | set_of_range_byte: self.set_of_range_byte,
|
8243 - | map_of_range_byte: self.map_of_range_byte,
|
8244 - | non_streaming_blob: self.non_streaming_blob,
|
8245 - | pattern_string: self.pattern_string,
|
8246 - | map_of_pattern_string: self.map_of_pattern_string,
|
8247 - | list_of_pattern_string: self.list_of_pattern_string,
|
8248 - | set_of_pattern_string: self.set_of_pattern_string,
|
8249 - | length_length_pattern_string: self.length_length_pattern_string,
|
8250 - | map_of_length_pattern_string: self.map_of_length_pattern_string,
|
8251 - | list_of_length_pattern_string: self.list_of_length_pattern_string,
|
8252 - | set_of_length_pattern_string: self.set_of_length_pattern_string,
|
8253 - | length_list_of_pattern_string: self.length_list_of_pattern_string,
|
8254 - | length_set_of_pattern_string: self.length_set_of_pattern_string,
|
8255 - | })
|
8256 - | }
|
8257 - | }
|
8258 - | }
|
8259 - | pub(crate) mod length_set_of_pattern_string_internal {
|
8260 - |
|
8261 - | #[allow(clippy::enum_variant_names)]
|
8262 - | #[derive(Debug, PartialEq)]
|
8263 - | pub(crate) enum ConstraintViolation {
|
8264 - | /// Constraint violation error when the list doesn't have the required length
|
8265 - | Length(usize),
|
8266 - | /// Constraint violation error when the list does not contain unique items
|
8267 - | UniqueItems {
|
8268 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8269 - | /// at least two elements.
|
8270 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8271 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8272 - | /// Nothing is guaranteed about the order of the indices.
|
8273 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8274 - | /// The original vector, that contains duplicate items.
|
8275 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
8276 - | },
|
8277 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8278 - | /// The first component of the tuple is the index in the collection where the
|
8279 - | /// first constraint violation was found.
|
8280 - | #[doc(hidden)]
|
8281 - | Member(
|
8282 - | usize,
|
8283 - | crate::model::pattern_string_internal::ConstraintViolation,
|
8284 - | ),
|
8285 - | }
|
8286 - |
|
8287 - | impl ::std::fmt::Display for ConstraintViolation {
|
8288 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8289 - | let message = match self {
|
8290 - | Self::Length(length) => {
|
8291 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length)
|
8292 - | },
|
8293 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8294 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#LengthSetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8295 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8296 - | failing_member)
|
8297 - | };
|
8298 - | write!(f, "{message}")
|
8299 - | }
|
8532 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
8533 + | ///
|
8534 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
8535 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
8536 + | self.build_enforcing_all_constraints()
|
8300 8537 | }
|
8301 - |
|
8302 - | impl ::std::error::Error for ConstraintViolation {}
|
8303 - | impl ConstraintViolation {
|
8304 - | pub(crate) fn as_validation_exception_field(
|
8538 + | fn build_enforcing_all_constraints(
|
8305 8539 | self,
|
8306 - | path: ::std::string::String,
|
8307 - | ) -> crate::model::ValidationExceptionField {
|
8308 - | match self {
|
8309 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
8310 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 9, inclusive", length, &path),
|
8311 - | path,
|
8312 - | },
|
8313 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8314 - | crate::model::ValidationExceptionField {
|
8315 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8316 - | path,
|
8317 - | },
|
8318 - | Self::Member(index, member_constraint_violation) =>
|
8319 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8320 - | }
|
8540 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
8541 + | Ok(crate::model::ConB {
|
8542 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
8543 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
8544 + | opt_nice: self.opt_nice,
|
8545 + | opt_int: self.opt_int,
|
8546 + | })
|
8321 8547 | }
|
8322 8548 | }
|
8323 8549 | }
|
8324 - | pub(crate) mod set_of_length_pattern_string_internal {
|
8550 + | /// See [`ConB`](crate::model::ConB).
|
8551 + | pub mod con_b {
|
8325 8552 |
|
8553 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
8554 + | /// Holds one variant for each of the ways the builder can fail.
|
8326 8555 | #[allow(clippy::enum_variant_names)]
|
8327 - | #[derive(Debug, PartialEq)]
|
8328 - | pub(crate) enum ConstraintViolation {
|
8329 - | /// Constraint violation error when the list does not contain unique items
|
8330 - | UniqueItems {
|
8331 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8332 - | /// at least two elements.
|
8333 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8334 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8335 - | /// Nothing is guaranteed about the order of the indices.
|
8336 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8337 - | /// The original vector, that contains duplicate items.
|
8338 - | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
8339 - | },
|
8340 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8341 - | /// The first component of the tuple is the index in the collection where the
|
8342 - | /// first constraint violation was found.
|
8343 - | #[doc(hidden)]
|
8344 - | Member(
|
8345 - | usize,
|
8346 - | crate::model::length_pattern_string_internal::ConstraintViolation,
|
8347 - | ),
|
8556 + | pub enum ConstraintViolation {
|
8557 + | /// `nice` was not provided but it is required when building `ConB`.
|
8558 + | MissingNice,
|
8559 + | /// `int` was not provided but it is required when building `ConB`.
|
8560 + | MissingInt,
|
8348 8561 | }
|
8349 - |
|
8350 8562 | impl ::std::fmt::Display for ConstraintViolation {
|
8351 8563 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8352 - | let message = match self {
|
8353 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8354 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8355 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8356 - | failing_member)
|
8357 - | };
|
8358 - | write!(f, "{message}")
|
8564 + | match self {
|
8565 + | ConstraintViolation::MissingNice => write!(
|
8566 + | f,
|
8567 + | "`nice` was not provided but it is required when building `ConB`"
|
8568 + | ),
|
8569 + | ConstraintViolation::MissingInt => write!(
|
8570 + | f,
|
8571 + | "`int` was not provided but it is required when building `ConB`"
|
8572 + | ),
|
8573 + | }
|
8359 8574 | }
|
8360 8575 | }
|
8361 - |
|
8362 8576 | impl ::std::error::Error for ConstraintViolation {}
|
8363 - | impl ConstraintViolation {
|
8364 - | pub(crate) fn as_validation_exception_field(
|
8365 - | self,
|
8366 - | path: ::std::string::String,
|
8367 - | ) -> crate::model::ValidationExceptionField {
|
8368 - | match self {
|
8369 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8370 - | crate::model::ValidationExceptionField {
|
8371 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8372 - | path,
|
8373 - | },
|
8374 - | Self::Member(index, member_constraint_violation) =>
|
8375 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8577 + | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
8578 + | type Error = ConstraintViolation;
|
8579 + |
|
8580 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
8581 + | builder.build()
|
8582 + | }
|
8583 + | }
|
8584 + | /// A builder for [`ConB`](crate::model::ConB).
|
8585 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
8586 + | pub struct Builder {
|
8587 + | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
8588 + | pub(crate) int: ::std::option::Option<i32>,
|
8589 + | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
8590 + | pub(crate) opt_int: ::std::option::Option<i32>,
|
8591 + | }
|
8592 + | impl Builder {
|
8593 + | #[allow(missing_docs)] // documentation missing in model
|
8594 + | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
8595 + | self.nice = Some(input);
|
8596 + | self
|
8597 + | }
|
8598 + | #[allow(missing_docs)] // documentation missing in model
|
8599 + | pub fn int(mut self, input: i32) -> Self {
|
8600 + | self.int = Some(input);
|
8601 + | self
|
8602 + | }
|
8603 + | #[allow(missing_docs)] // documentation missing in model
|
8604 + | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
8605 + | self.opt_nice = input;
|
8606 + | self
|
8607 + | }
|
8608 + | #[allow(missing_docs)] // documentation missing in model
|
8609 + | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
8610 + | self.opt_int = input;
|
8611 + | self
|
8612 + | }
|
8613 + | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
8614 + | ///
|
8615 + | /// The builder fails to construct a [`ConB`](crate::model::ConB) if you do not provide a value for all non-`Option`al members.
|
8616 + | ///
|
8617 + | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
8618 + | self.build_enforcing_required_and_enum_traits()
|
8376 8619 | }
|
8620 + | fn build_enforcing_required_and_enum_traits(
|
8621 + | self,
|
8622 + | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
8623 + | Ok(crate::model::ConB {
|
8624 + | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
8625 + | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
8626 + | opt_nice: self.opt_nice,
|
8627 + | opt_int: self.opt_int,
|
8628 + | })
|
8377 8629 | }
|
8378 8630 | }
|
8379 8631 | }
|
8380 - | pub(crate) mod set_of_pattern_string_internal {
|
8632 + | pub(crate) mod min_length_string_internal {
|
8381 8633 |
|
8382 - | #[allow(clippy::enum_variant_names)]
|
8383 8634 | #[derive(Debug, PartialEq)]
|
8384 - | pub(crate) enum ConstraintViolation {
|
8385 - | /// Constraint violation error when the list does not contain unique items
|
8386 - | UniqueItems {
|
8387 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8388 - | /// at least two elements.
|
8389 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8390 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8391 - | /// Nothing is guaranteed about the order of the indices.
|
8392 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8393 - | /// The original vector, that contains duplicate items.
|
8394 - | original: ::std::vec::Vec<crate::model::PatternString>,
|
8395 - | },
|
8396 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8397 - | /// The first component of the tuple is the index in the collection where the
|
8398 - | /// first constraint violation was found.
|
8399 - | #[doc(hidden)]
|
8400 - | Member(
|
8401 - | usize,
|
8402 - | crate::model::pattern_string_internal::ConstraintViolation,
|
8403 - | ),
|
8635 + | pub enum ConstraintViolation {
|
8636 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8637 + | Length(usize),
|
8404 8638 | }
|
8405 8639 |
|
8406 8640 | impl ::std::fmt::Display for ConstraintViolation {
|
8407 8641 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8408 8642 | let message = match self {
|
8409 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8410 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8411 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8412 - | failing_member)
|
8643 + | Self::Length(length) => {
|
8644 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthString' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
8645 + | }
|
8413 8646 | };
|
8414 8647 | write!(f, "{message}")
|
8415 8648 | }
|
8416 8649 | }
|
8417 8650 |
|
8418 8651 | impl ::std::error::Error for ConstraintViolation {}
|
8419 8652 | impl ConstraintViolation {
|
8420 8653 | pub(crate) fn as_validation_exception_field(
|
8421 8654 | self,
|
8422 8655 | path: ::std::string::String,
|
8423 8656 | ) -> crate::model::ValidationExceptionField {
|
8424 8657 | match self {
|
8425 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8426 - | crate::model::ValidationExceptionField {
|
8427 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8658 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8659 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
8428 8660 | path,
|
8429 8661 | },
|
8430 - | Self::Member(index, member_constraint_violation) =>
|
8431 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8432 8662 | }
|
8433 8663 | }
|
8434 8664 | }
|
8435 8665 | }
|
8436 - | pub(crate) mod map_of_range_byte_internal {
|
8666 + | pub(crate) mod max_length_string_internal {
|
8437 8667 |
|
8438 - | #[allow(clippy::enum_variant_names)]
|
8439 8668 | #[derive(Debug, PartialEq)]
|
8440 - | pub(crate) enum ConstraintViolation {
|
8441 - | #[doc(hidden)]
|
8442 - | Value(
|
8443 - | ::std::string::String,
|
8444 - | crate::model::range_byte_internal::ConstraintViolation,
|
8445 - | ),
|
8669 + | pub enum ConstraintViolation {
|
8670 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8671 + | Length(usize),
|
8446 8672 | }
|
8447 8673 |
|
8448 8674 | impl ::std::fmt::Display for ConstraintViolation {
|
8449 8675 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8450 - | match self {
|
8451 - | Self::Value(_, value_constraint_violation) => {
|
8452 - | write!(f, "{}", value_constraint_violation)
|
8453 - | }
|
8676 + | let message = match self {
|
8677 + | Self::Length(length) => {
|
8678 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthString' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
8454 8679 | }
|
8680 + | };
|
8681 + | write!(f, "{message}")
|
8455 8682 | }
|
8456 8683 | }
|
8457 8684 |
|
8458 8685 | impl ::std::error::Error for ConstraintViolation {}
|
8459 8686 | impl ConstraintViolation {
|
8460 8687 | pub(crate) fn as_validation_exception_field(
|
8461 8688 | self,
|
8462 8689 | path: ::std::string::String,
|
8463 8690 | ) -> crate::model::ValidationExceptionField {
|
8464 8691 | match self {
|
8465 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8466 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8692 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8693 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
8694 + | path,
|
8695 + | },
|
8467 8696 | }
|
8468 8697 | }
|
8469 8698 | }
|
8470 8699 | }
|
8471 - | pub(crate) mod range_byte_internal {
|
8700 + | pub(crate) mod fixed_length_string_internal {
|
8472 8701 |
|
8473 8702 | #[derive(Debug, PartialEq)]
|
8474 8703 | pub enum ConstraintViolation {
|
8475 - | Range(i8),
|
8704 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
8705 + | Length(usize),
|
8476 8706 | }
|
8477 8707 |
|
8478 8708 | impl ::std::fmt::Display for ConstraintViolation {
|
8479 8709 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8480 - | write!(f, "Value for `com.amazonaws.constraints#RangeByte`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8710 + | let message = match self {
|
8711 + | Self::Length(length) => {
|
8712 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
8713 + | }
|
8714 + | };
|
8715 + | write!(f, "{message}")
|
8481 8716 | }
|
8482 8717 | }
|
8483 8718 |
|
8484 8719 | impl ::std::error::Error for ConstraintViolation {}
|
8485 8720 | impl ConstraintViolation {
|
8486 8721 | pub(crate) fn as_validation_exception_field(
|
8487 8722 | self,
|
8488 8723 | path: ::std::string::String,
|
8489 8724 | ) -> crate::model::ValidationExceptionField {
|
8490 8725 | match self {
|
8491 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
8492 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8726 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8727 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
8493 8728 | path,
|
8494 8729 | },
|
8495 8730 | }
|
8496 - | }
|
8497 - | }
|
8498 - | }
|
8499 - | pub(crate) mod set_of_range_byte_internal {
|
8500 - |
|
8501 - | #[allow(clippy::enum_variant_names)]
|
8502 - | #[derive(Debug, PartialEq)]
|
8503 - | pub(crate) enum ConstraintViolation {
|
8504 - | /// Constraint violation error when the list does not contain unique items
|
8505 - | UniqueItems {
|
8506 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8507 - | /// at least two elements.
|
8508 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8509 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8510 - | /// Nothing is guaranteed about the order of the indices.
|
8511 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8512 - | /// The original vector, that contains duplicate items.
|
8513 - | original: ::std::vec::Vec<crate::model::RangeByte>,
|
8514 - | },
|
8515 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8516 - | /// The first component of the tuple is the index in the collection where the
|
8517 - | /// first constraint violation was found.
|
8518 - | #[doc(hidden)]
|
8519 - | Member(
|
8520 - | usize,
|
8521 - | crate::model::range_byte_internal::ConstraintViolation,
|
8522 - | ),
|
8523 - | }
|
8731 + | }
|
8732 + | }
|
8733 + | }
|
8734 + | pub(crate) mod length_blob_internal {
|
8735 + |
|
8736 + | #[derive(Debug, PartialEq)]
|
8737 + | pub enum ConstraintViolation {
|
8738 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8739 + | Length(usize),
|
8740 + | }
|
8524 8741 |
|
8525 8742 | impl ::std::fmt::Display for ConstraintViolation {
|
8526 8743 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8527 8744 | let message = match self {
|
8528 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8529 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeByte' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8530 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8531 - | failing_member)
|
8745 + | Self::Length(length) => {
|
8746 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
8747 + | }
|
8532 8748 | };
|
8533 8749 | write!(f, "{message}")
|
8534 8750 | }
|
8535 8751 | }
|
8536 8752 |
|
8537 8753 | impl ::std::error::Error for ConstraintViolation {}
|
8538 8754 | impl ConstraintViolation {
|
8539 8755 | pub(crate) fn as_validation_exception_field(
|
8540 8756 | self,
|
8541 8757 | path: ::std::string::String,
|
8542 8758 | ) -> crate::model::ValidationExceptionField {
|
8543 8759 | match self {
|
8544 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8545 - | crate::model::ValidationExceptionField {
|
8546 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8760 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8761 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
8547 8762 | path,
|
8548 8763 | },
|
8549 - | Self::Member(index, member_constraint_violation) =>
|
8550 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8551 8764 | }
|
8552 8765 | }
|
8553 8766 | }
|
8554 8767 | }
|
8555 - | pub(crate) mod list_of_range_byte_internal {
|
8768 + | pub(crate) mod min_length_blob_internal {
|
8556 8769 |
|
8557 - | #[allow(clippy::enum_variant_names)]
|
8558 8770 | #[derive(Debug, PartialEq)]
|
8559 - | pub(crate) enum ConstraintViolation {
|
8560 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8561 - | /// The first component of the tuple is the index in the collection where the
|
8562 - | /// first constraint violation was found.
|
8563 - | #[doc(hidden)]
|
8564 - | Member(
|
8565 - | usize,
|
8566 - | crate::model::range_byte_internal::ConstraintViolation,
|
8567 - | ),
|
8771 + | pub enum ConstraintViolation {
|
8772 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8773 + | Length(usize),
|
8568 8774 | }
|
8569 8775 |
|
8570 8776 | impl ::std::fmt::Display for ConstraintViolation {
|
8571 8777 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8572 8778 | let message = match self {
|
8573 - | Self::Member(index, failing_member) => format!(
|
8574 - | "Value at index {index} failed to satisfy constraint. {}",
|
8575 - | failing_member
|
8576 - | ),
|
8779 + | Self::Length(length) => {
|
8780 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthBlob' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
8781 + | }
|
8577 8782 | };
|
8578 8783 | write!(f, "{message}")
|
8579 8784 | }
|
8580 8785 | }
|
8581 8786 |
|
8582 8787 | impl ::std::error::Error for ConstraintViolation {}
|
8583 8788 | impl ConstraintViolation {
|
8584 8789 | pub(crate) fn as_validation_exception_field(
|
8585 8790 | self,
|
8586 8791 | path: ::std::string::String,
|
8587 8792 | ) -> crate::model::ValidationExceptionField {
|
8588 8793 | match self {
|
8589 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8590 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8794 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8795 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
8796 + | path,
|
8797 + | },
|
8591 8798 | }
|
8592 8799 | }
|
8593 8800 | }
|
8594 8801 | }
|
8595 - | pub(crate) mod map_of_range_long_internal {
|
8802 + | pub(crate) mod max_length_blob_internal {
|
8596 8803 |
|
8597 - | #[allow(clippy::enum_variant_names)]
|
8598 8804 | #[derive(Debug, PartialEq)]
|
8599 - | pub(crate) enum ConstraintViolation {
|
8600 - | #[doc(hidden)]
|
8601 - | Value(
|
8602 - | ::std::string::String,
|
8603 - | crate::model::range_long_internal::ConstraintViolation,
|
8604 - | ),
|
8805 + | pub enum ConstraintViolation {
|
8806 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8807 + | Length(usize),
|
8605 8808 | }
|
8606 8809 |
|
8607 8810 | impl ::std::fmt::Display for ConstraintViolation {
|
8608 8811 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8609 - | match self {
|
8610 - | Self::Value(_, value_constraint_violation) => {
|
8611 - | write!(f, "{}", value_constraint_violation)
|
8612 - | }
|
8812 + | let message = match self {
|
8813 + | Self::Length(length) => {
|
8814 + | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthBlob' failed to satisfy constraint: Member must have length less than or equal to 70", length)
|
8613 8815 | }
|
8816 + | };
|
8817 + | write!(f, "{message}")
|
8614 8818 | }
|
8615 8819 | }
|
8616 8820 |
|
8617 8821 | impl ::std::error::Error for ConstraintViolation {}
|
8618 8822 | impl ConstraintViolation {
|
8619 8823 | pub(crate) fn as_validation_exception_field(
|
8620 8824 | self,
|
8621 8825 | path: ::std::string::String,
|
8622 8826 | ) -> crate::model::ValidationExceptionField {
|
8623 8827 | match self {
|
8624 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8625 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8828 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8829 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
8830 + | path,
|
8831 + | },
|
8626 8832 | }
|
8627 8833 | }
|
8628 8834 | }
|
8629 8835 | }
|
8630 - | pub(crate) mod range_long_internal {
|
8836 + | pub(crate) mod fixed_length_blob_internal {
|
8631 8837 |
|
8632 8838 | #[derive(Debug, PartialEq)]
|
8633 8839 | pub enum ConstraintViolation {
|
8634 - | Range(i64),
|
8840 + | /// Error when a blob doesn't satisfy its `@length` requirements.
|
8841 + | Length(usize),
|
8635 8842 | }
|
8636 8843 |
|
8637 8844 | impl ::std::fmt::Display for ConstraintViolation {
|
8638 8845 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8639 - | write!(f, "Value for `com.amazonaws.constraints#RangeLong`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8846 + | let message = match self {
|
8847 + | Self::Length(length) => {
|
8848 + | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
8849 + | }
|
8850 + | };
|
8851 + | write!(f, "{message}")
|
8640 8852 | }
|
8641 8853 | }
|
8642 8854 |
|
8643 8855 | impl ::std::error::Error for ConstraintViolation {}
|
8644 8856 | impl ConstraintViolation {
|
8645 8857 | pub(crate) fn as_validation_exception_field(
|
8646 8858 | self,
|
8647 8859 | path: ::std::string::String,
|
8648 8860 | ) -> crate::model::ValidationExceptionField {
|
8649 8861 | match self {
|
8650 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
8651 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8862 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
8863 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
8652 8864 | path,
|
8653 8865 | },
|
8654 8866 | }
|
8655 8867 | }
|
8656 8868 | }
|
8657 8869 | }
|
8658 - | pub(crate) mod set_of_range_long_internal {
|
8870 + | pub(crate) mod min_range_integer_internal {
|
8659 8871 |
|
8660 - | #[allow(clippy::enum_variant_names)]
|
8661 8872 | #[derive(Debug, PartialEq)]
|
8662 - | pub(crate) enum ConstraintViolation {
|
8663 - | /// Constraint violation error when the list does not contain unique items
|
8664 - | UniqueItems {
|
8665 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8666 - | /// at least two elements.
|
8667 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8668 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8669 - | /// Nothing is guaranteed about the order of the indices.
|
8670 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8671 - | /// The original vector, that contains duplicate items.
|
8672 - | original: ::std::vec::Vec<crate::model::RangeLong>,
|
8673 - | },
|
8674 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8675 - | /// The first component of the tuple is the index in the collection where the
|
8676 - | /// first constraint violation was found.
|
8677 - | #[doc(hidden)]
|
8678 - | Member(
|
8679 - | usize,
|
8680 - | crate::model::range_long_internal::ConstraintViolation,
|
8681 - | ),
|
8873 + | pub enum ConstraintViolation {
|
8874 + | Range(i32),
|
8682 8875 | }
|
8683 8876 |
|
8684 8877 | impl ::std::fmt::Display for ConstraintViolation {
|
8685 8878 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8686 - | let message = match self {
|
8687 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8688 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeLong' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8689 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8690 - | failing_member)
|
8691 - | };
|
8692 - | write!(f, "{message}")
|
8879 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8693 8880 | }
|
8694 8881 | }
|
8695 8882 |
|
8696 8883 | impl ::std::error::Error for ConstraintViolation {}
|
8697 8884 | impl ConstraintViolation {
|
8698 8885 | pub(crate) fn as_validation_exception_field(
|
8699 8886 | self,
|
8700 8887 | path: ::std::string::String,
|
8701 8888 | ) -> crate::model::ValidationExceptionField {
|
8702 8889 | match self {
|
8703 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8704 - | crate::model::ValidationExceptionField {
|
8705 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
8890 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8891 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8706 8892 | path,
|
8707 8893 | },
|
8708 - | Self::Member(index, member_constraint_violation) =>
|
8709 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8710 8894 | }
|
8711 8895 | }
|
8712 8896 | }
|
8713 8897 | }
|
8714 - | pub(crate) mod list_of_range_long_internal {
|
8898 + | pub(crate) mod max_range_integer_internal {
|
8715 8899 |
|
8716 - | #[allow(clippy::enum_variant_names)]
|
8717 8900 | #[derive(Debug, PartialEq)]
|
8718 - | pub(crate) enum ConstraintViolation {
|
8719 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8720 - | /// The first component of the tuple is the index in the collection where the
|
8721 - | /// first constraint violation was found.
|
8722 - | #[doc(hidden)]
|
8723 - | Member(
|
8724 - | usize,
|
8725 - | crate::model::range_long_internal::ConstraintViolation,
|
8726 - | ),
|
8901 + | pub enum ConstraintViolation {
|
8902 + | Range(i32),
|
8727 8903 | }
|
8728 8904 |
|
8729 8905 | impl ::std::fmt::Display for ConstraintViolation {
|
8730 8906 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8731 - | let message = match self {
|
8732 - | Self::Member(index, failing_member) => format!(
|
8733 - | "Value at index {index} failed to satisfy constraint. {}",
|
8734 - | failing_member
|
8735 - | ),
|
8736 - | };
|
8737 - | write!(f, "{message}")
|
8907 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
8738 8908 | }
|
8739 8909 | }
|
8740 8910 |
|
8741 8911 | impl ::std::error::Error for ConstraintViolation {}
|
8742 8912 | impl ConstraintViolation {
|
8743 8913 | pub(crate) fn as_validation_exception_field(
|
8744 8914 | self,
|
8745 8915 | path: ::std::string::String,
|
8746 8916 | ) -> crate::model::ValidationExceptionField {
|
8747 8917 | match self {
|
8748 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8749 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
8918 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8919 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
8920 + | path,
|
8921 + | },
|
8750 8922 | }
|
8751 8923 | }
|
8752 8924 | }
|
8753 8925 | }
|
8754 - | pub(crate) mod map_of_range_short_internal {
|
8926 + | pub(crate) mod fixed_value_integer_internal {
|
8755 8927 |
|
8756 - | #[allow(clippy::enum_variant_names)]
|
8757 8928 | #[derive(Debug, PartialEq)]
|
8758 - | pub(crate) enum ConstraintViolation {
|
8759 - | #[doc(hidden)]
|
8760 - | Value(
|
8761 - | ::std::string::String,
|
8762 - | crate::model::range_short_internal::ConstraintViolation,
|
8763 - | ),
|
8929 + | pub enum ConstraintViolation {
|
8930 + | Range(i32),
|
8764 8931 | }
|
8765 8932 |
|
8766 8933 | impl ::std::fmt::Display for ConstraintViolation {
|
8767 8934 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8768 - | match self {
|
8769 - | Self::Value(_, value_constraint_violation) => {
|
8770 - | write!(f, "{}", value_constraint_violation)
|
8771 - | }
|
8772 - | }
|
8935 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
8773 8936 | }
|
8774 8937 | }
|
8775 8938 |
|
8776 8939 | impl ::std::error::Error for ConstraintViolation {}
|
8777 8940 | impl ConstraintViolation {
|
8778 8941 | pub(crate) fn as_validation_exception_field(
|
8779 8942 | self,
|
8780 8943 | path: ::std::string::String,
|
8781 8944 | ) -> crate::model::ValidationExceptionField {
|
8782 8945 | match self {
|
8783 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8784 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
8946 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
8947 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
8948 + | path,
|
8949 + | },
|
8785 8950 | }
|
8786 8951 | }
|
8787 8952 | }
|
8788 8953 | }
|
8789 - | pub(crate) mod range_short_internal {
|
8954 + | pub(crate) mod min_range_short_internal {
|
8790 8955 |
|
8791 8956 | #[derive(Debug, PartialEq)]
|
8792 8957 | pub enum ConstraintViolation {
|
8793 8958 | Range(i16),
|
8794 8959 | }
|
8795 8960 |
|
8796 8961 | impl ::std::fmt::Display for ConstraintViolation {
|
8797 8962 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8798 - | write!(f, "Value for `com.amazonaws.constraints#RangeShort`failed to satisfy constraint: Member must be between 0 and 10, inclusive")
|
8963 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8799 8964 | }
|
8800 8965 | }
|
8801 8966 |
|
8802 8967 | impl ::std::error::Error for ConstraintViolation {}
|
8803 8968 | impl ConstraintViolation {
|
8804 8969 | pub(crate) fn as_validation_exception_field(
|
8805 8970 | self,
|
8806 8971 | path: ::std::string::String,
|
8807 8972 | ) -> crate::model::ValidationExceptionField {
|
8808 8973 | match self {
|
8809 8974 | Self::Range(_) => crate::model::ValidationExceptionField {
|
8810 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 10, inclusive", &path),
|
8975 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
8811 8976 | path,
|
8812 8977 | },
|
8813 8978 | }
|
8814 8979 | }
|
8815 8980 | }
|
8816 8981 | }
|
8817 - | pub(crate) mod set_of_range_short_internal {
|
8982 + | pub(crate) mod max_range_short_internal {
|
8818 8983 |
|
8819 - | #[allow(clippy::enum_variant_names)]
|
8820 8984 | #[derive(Debug, PartialEq)]
|
8821 - | pub(crate) enum ConstraintViolation {
|
8822 - | /// Constraint violation error when the list does not contain unique items
|
8823 - | UniqueItems {
|
8824 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8825 - | /// at least two elements.
|
8826 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8827 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8828 - | /// Nothing is guaranteed about the order of the indices.
|
8829 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8830 - | /// The original vector, that contains duplicate items.
|
8831 - | original: ::std::vec::Vec<crate::model::RangeShort>,
|
8832 - | },
|
8833 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8834 - | /// The first component of the tuple is the index in the collection where the
|
8835 - | /// first constraint violation was found.
|
8836 - | #[doc(hidden)]
|
8837 - | Member(
|
8838 - | usize,
|
8839 - | crate::model::range_short_internal::ConstraintViolation,
|
8840 - | ),
|
8985 + | pub enum ConstraintViolation {
|
8986 + | Range(i16),
|
8841 8987 | }
|
8842 8988 |
|
8843 8989 | impl ::std::fmt::Display for ConstraintViolation {
|
8844 8990 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8845 - | let message = match self {
|
8846 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8847 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeShort' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
8848 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
8849 - | failing_member)
|
8850 - | };
|
8851 - | write!(f, "{message}")
|
8991 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
8852 8992 | }
|
8853 8993 | }
|
8854 8994 |
|
8855 8995 | impl ::std::error::Error for ConstraintViolation {}
|
8856 8996 | impl ConstraintViolation {
|
8857 8997 | pub(crate) fn as_validation_exception_field(
|
8858 8998 | self,
|
8859 8999 | path: ::std::string::String,
|
8860 9000 | ) -> crate::model::ValidationExceptionField {
|
8861 9001 | match self {
|
8862 - | Self::UniqueItems { duplicate_indices, .. } =>
|
8863 - | crate::model::ValidationExceptionField {
|
8864 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9002 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9003 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
8865 9004 | path,
|
8866 9005 | },
|
8867 - | Self::Member(index, member_constraint_violation) =>
|
8868 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
8869 9006 | }
|
8870 9007 | }
|
8871 9008 | }
|
8872 9009 | }
|
8873 - | pub(crate) mod list_of_range_short_internal {
|
9010 + | pub(crate) mod fixed_value_short_internal {
|
8874 9011 |
|
8875 - | #[allow(clippy::enum_variant_names)]
|
8876 9012 | #[derive(Debug, PartialEq)]
|
8877 - | pub(crate) enum ConstraintViolation {
|
8878 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8879 - | /// The first component of the tuple is the index in the collection where the
|
8880 - | /// first constraint violation was found.
|
8881 - | #[doc(hidden)]
|
8882 - | Member(
|
8883 - | usize,
|
8884 - | crate::model::range_short_internal::ConstraintViolation,
|
8885 - | ),
|
8886 - | }
|
8887 - |
|
8888 - | impl ::std::fmt::Display for ConstraintViolation {
|
8889 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8890 - | let message = match self {
|
8891 - | Self::Member(index, failing_member) => format!(
|
8892 - | "Value at index {index} failed to satisfy constraint. {}",
|
8893 - | failing_member
|
8894 - | ),
|
8895 - | };
|
8896 - | write!(f, "{message}")
|
9013 + | pub enum ConstraintViolation {
|
9014 + | Range(i16),
|
9015 + | }
|
9016 + |
|
9017 + | impl ::std::fmt::Display for ConstraintViolation {
|
9018 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9019 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
8897 9020 | }
|
8898 9021 | }
|
8899 9022 |
|
8900 9023 | impl ::std::error::Error for ConstraintViolation {}
|
8901 9024 | impl ConstraintViolation {
|
8902 9025 | pub(crate) fn as_validation_exception_field(
|
8903 9026 | self,
|
8904 9027 | path: ::std::string::String,
|
8905 9028 | ) -> crate::model::ValidationExceptionField {
|
8906 9029 | match self {
|
8907 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
8908 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9030 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9031 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9032 + | path,
|
9033 + | },
|
8909 9034 | }
|
8910 9035 | }
|
8911 9036 | }
|
8912 9037 | }
|
8913 - | pub(crate) mod map_of_range_integer_internal {
|
9038 + | pub(crate) mod min_range_long_internal {
|
8914 9039 |
|
8915 - | #[allow(clippy::enum_variant_names)]
|
8916 9040 | #[derive(Debug, PartialEq)]
|
8917 - | pub(crate) enum ConstraintViolation {
|
8918 - | #[doc(hidden)]
|
8919 - | Value(
|
8920 - | ::std::string::String,
|
8921 - | crate::model::range_integer_internal::ConstraintViolation,
|
8922 - | ),
|
9041 + | pub enum ConstraintViolation {
|
9042 + | Range(i64),
|
8923 9043 | }
|
8924 9044 |
|
8925 9045 | impl ::std::fmt::Display for ConstraintViolation {
|
8926 9046 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8927 - | match self {
|
8928 - | Self::Value(_, value_constraint_violation) => {
|
8929 - | write!(f, "{}", value_constraint_violation)
|
8930 - | }
|
8931 - | }
|
9047 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
8932 9048 | }
|
8933 9049 | }
|
8934 9050 |
|
8935 9051 | impl ::std::error::Error for ConstraintViolation {}
|
8936 9052 | impl ConstraintViolation {
|
8937 9053 | pub(crate) fn as_validation_exception_field(
|
8938 9054 | self,
|
8939 9055 | path: ::std::string::String,
|
8940 9056 | ) -> crate::model::ValidationExceptionField {
|
8941 9057 | match self {
|
8942 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
8943 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9058 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9059 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9060 + | path,
|
9061 + | },
|
8944 9062 | }
|
8945 9063 | }
|
8946 9064 | }
|
8947 9065 | }
|
8948 - | pub(crate) mod range_integer_internal {
|
9066 + | pub(crate) mod max_range_long_internal {
|
8949 9067 |
|
8950 9068 | #[derive(Debug, PartialEq)]
|
8951 9069 | pub enum ConstraintViolation {
|
8952 - | Range(i32),
|
9070 + | Range(i64),
|
8953 9071 | }
|
8954 9072 |
|
8955 9073 | impl ::std::fmt::Display for ConstraintViolation {
|
8956 9074 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
8957 - | write!(f, "Value for `com.amazonaws.constraints#RangeInteger`failed to satisfy constraint: Member must be between 0 and 69, inclusive")
|
9075 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
8958 9076 | }
|
8959 9077 | }
|
8960 9078 |
|
8961 9079 | impl ::std::error::Error for ConstraintViolation {}
|
8962 9080 | impl ConstraintViolation {
|
8963 9081 | pub(crate) fn as_validation_exception_field(
|
8964 9082 | self,
|
8965 9083 | path: ::std::string::String,
|
8966 9084 | ) -> crate::model::ValidationExceptionField {
|
8967 9085 | match self {
|
8968 9086 | Self::Range(_) => crate::model::ValidationExceptionField {
|
8969 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 0 and 69, inclusive", &path),
|
9087 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
8970 9088 | path,
|
8971 9089 | },
|
8972 9090 | }
|
8973 9091 | }
|
8974 9092 | }
|
8975 9093 | }
|
8976 - | pub(crate) mod set_of_range_integer_internal {
|
9094 + | pub(crate) mod fixed_value_long_internal {
|
8977 9095 |
|
8978 - | #[allow(clippy::enum_variant_names)]
|
8979 9096 | #[derive(Debug, PartialEq)]
|
8980 - | pub(crate) enum ConstraintViolation {
|
8981 - | /// Constraint violation error when the list does not contain unique items
|
8982 - | UniqueItems {
|
8983 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
8984 - | /// at least two elements.
|
8985 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
8986 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
8987 - | /// Nothing is guaranteed about the order of the indices.
|
8988 - | duplicate_indices: ::std::vec::Vec<usize>,
|
8989 - | /// The original vector, that contains duplicate items.
|
8990 - | original: ::std::vec::Vec<crate::model::RangeInteger>,
|
8991 - | },
|
8992 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
8993 - | /// The first component of the tuple is the index in the collection where the
|
8994 - | /// first constraint violation was found.
|
8995 - | #[doc(hidden)]
|
8996 - | Member(
|
8997 - | usize,
|
8998 - | crate::model::range_integer_internal::ConstraintViolation,
|
8999 - | ),
|
9097 + | pub enum ConstraintViolation {
|
9098 + | Range(i64),
|
9000 9099 | }
|
9001 9100 |
|
9002 9101 | impl ::std::fmt::Display for ConstraintViolation {
|
9003 9102 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9004 - | let message = match self {
|
9005 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9006 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfRangeInteger' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9007 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9008 - | failing_member)
|
9009 - | };
|
9010 - | write!(f, "{message}")
|
9103 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9011 9104 | }
|
9012 9105 | }
|
9013 9106 |
|
9014 9107 | impl ::std::error::Error for ConstraintViolation {}
|
9015 9108 | impl ConstraintViolation {
|
9016 9109 | pub(crate) fn as_validation_exception_field(
|
9017 9110 | self,
|
9018 9111 | path: ::std::string::String,
|
9019 9112 | ) -> crate::model::ValidationExceptionField {
|
9020 9113 | match self {
|
9021 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9022 - | crate::model::ValidationExceptionField {
|
9023 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9114 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9115 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9024 9116 | path,
|
9025 9117 | },
|
9026 - | Self::Member(index, member_constraint_violation) =>
|
9027 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9028 9118 | }
|
9029 9119 | }
|
9030 9120 | }
|
9031 9121 | }
|
9032 - | pub(crate) mod list_of_range_integer_internal {
|
9122 + | pub(crate) mod min_range_byte_internal {
|
9033 9123 |
|
9034 - | #[allow(clippy::enum_variant_names)]
|
9035 9124 | #[derive(Debug, PartialEq)]
|
9036 - | pub(crate) enum ConstraintViolation {
|
9037 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9038 - | /// The first component of the tuple is the index in the collection where the
|
9039 - | /// first constraint violation was found.
|
9040 - | #[doc(hidden)]
|
9041 - | Member(
|
9042 - | usize,
|
9043 - | crate::model::range_integer_internal::ConstraintViolation,
|
9044 - | ),
|
9125 + | pub enum ConstraintViolation {
|
9126 + | Range(i8),
|
9045 9127 | }
|
9046 9128 |
|
9047 9129 | impl ::std::fmt::Display for ConstraintViolation {
|
9048 9130 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9049 - | let message = match self {
|
9050 - | Self::Member(index, failing_member) => format!(
|
9051 - | "Value at index {index} failed to satisfy constraint. {}",
|
9052 - | failing_member
|
9053 - | ),
|
9054 - | };
|
9055 - | write!(f, "{message}")
|
9131 + | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9056 9132 | }
|
9057 9133 | }
|
9058 9134 |
|
9059 9135 | impl ::std::error::Error for ConstraintViolation {}
|
9060 9136 | impl ConstraintViolation {
|
9061 9137 | pub(crate) fn as_validation_exception_field(
|
9062 9138 | self,
|
9063 9139 | path: ::std::string::String,
|
9064 9140 | ) -> crate::model::ValidationExceptionField {
|
9065 9141 | match self {
|
9066 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9067 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9142 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9143 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
9144 + | path,
|
9145 + | },
|
9068 9146 | }
|
9069 9147 | }
|
9070 9148 | }
|
9071 9149 | }
|
9072 - | pub(crate) mod map_of_length_blob_internal {
|
9150 + | pub(crate) mod max_range_byte_internal {
|
9073 9151 |
|
9074 - | #[allow(clippy::enum_variant_names)]
|
9075 9152 | #[derive(Debug, PartialEq)]
|
9076 - | pub(crate) enum ConstraintViolation {
|
9077 - | #[doc(hidden)]
|
9078 - | Value(
|
9079 - | ::std::string::String,
|
9080 - | crate::model::length_blob_internal::ConstraintViolation,
|
9081 - | ),
|
9153 + | pub enum ConstraintViolation {
|
9154 + | Range(i8),
|
9082 9155 | }
|
9083 9156 |
|
9084 9157 | impl ::std::fmt::Display for ConstraintViolation {
|
9085 9158 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9086 - | match self {
|
9087 - | Self::Value(_, value_constraint_violation) => {
|
9088 - | write!(f, "{}", value_constraint_violation)
|
9089 - | }
|
9090 - | }
|
9159 + | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
9091 9160 | }
|
9092 9161 | }
|
9093 9162 |
|
9094 9163 | impl ::std::error::Error for ConstraintViolation {}
|
9095 9164 | impl ConstraintViolation {
|
9096 9165 | pub(crate) fn as_validation_exception_field(
|
9097 9166 | self,
|
9098 9167 | path: ::std::string::String,
|
9099 9168 | ) -> crate::model::ValidationExceptionField {
|
9100 9169 | match self {
|
9101 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9102 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
9170 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9171 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9172 + | path,
|
9173 + | },
|
9103 9174 | }
|
9104 9175 | }
|
9105 9176 | }
|
9106 9177 | }
|
9107 - | pub(crate) mod length_blob_internal {
|
9178 + | pub(crate) mod fixed_value_byte_internal {
|
9108 9179 |
|
9109 9180 | #[derive(Debug, PartialEq)]
|
9110 9181 | pub enum ConstraintViolation {
|
9111 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
9112 - | Length(usize),
|
9182 + | Range(i8),
|
9113 9183 | }
|
9114 9184 |
|
9115 9185 | impl ::std::fmt::Display for ConstraintViolation {
|
9116 9186 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9117 - | let message = match self {
|
9118 - | Self::Length(length) => {
|
9119 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthBlob' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length)
|
9120 - | }
|
9121 - | };
|
9122 - | write!(f, "{message}")
|
9187 + | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9123 9188 | }
|
9124 9189 | }
|
9125 9190 |
|
9126 9191 | impl ::std::error::Error for ConstraintViolation {}
|
9127 9192 | impl ConstraintViolation {
|
9128 9193 | pub(crate) fn as_validation_exception_field(
|
9129 9194 | self,
|
9130 9195 | path: ::std::string::String,
|
9131 9196 | ) -> crate::model::ValidationExceptionField {
|
9132 9197 | match self {
|
9133 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9134 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 2 and 70, inclusive", length, &path),
|
9198 + | Self::Range(_) => crate::model::ValidationExceptionField {
|
9199 + | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
9135 9200 | path,
|
9136 9201 | },
|
9137 9202 | }
|
9138 9203 | }
|
9139 9204 | }
|
9140 9205 | }
|
9141 - | pub(crate) mod list_of_length_blob_internal {
|
9206 + | pub(crate) mod con_b_list_internal {
|
9142 9207 |
|
9143 9208 | #[allow(clippy::enum_variant_names)]
|
9144 9209 | #[derive(Debug, PartialEq)]
|
9145 9210 | pub(crate) enum ConstraintViolation {
|
9146 9211 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9147 9212 | /// The first component of the tuple is the index in the collection where the
|
9148 9213 | /// first constraint violation was found.
|
9149 9214 | #[doc(hidden)]
|
9150 9215 | Member(
|
9151 9216 | usize,
|
9152 - | crate::model::length_blob_internal::ConstraintViolation,
|
9217 + | crate::model::con_b_list_inner_internal::ConstraintViolation,
|
9153 9218 | ),
|
9154 9219 | }
|
9155 9220 |
|
9156 9221 | impl ::std::fmt::Display for ConstraintViolation {
|
9157 9222 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9158 9223 | let message = match self {
|
9159 9224 | Self::Member(index, failing_member) => format!(
|
9160 9225 | "Value at index {index} failed to satisfy constraint. {}",
|
9161 9226 | failing_member
|
9162 9227 | ),
|
9163 9228 | };
|
9164 9229 | write!(f, "{message}")
|
9165 9230 | }
|
9166 9231 | }
|
9167 9232 |
|
9168 9233 | impl ::std::error::Error for ConstraintViolation {}
|
9169 9234 | impl ConstraintViolation {
|
9170 9235 | pub(crate) fn as_validation_exception_field(
|
9171 9236 | self,
|
9172 9237 | path: ::std::string::String,
|
9173 9238 | ) -> crate::model::ValidationExceptionField {
|
9174 9239 | match self {
|
9175 9240 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9176 9241 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9177 9242 | }
|
9178 9243 | }
|
9179 9244 | }
|
9180 9245 | }
|
9181 - | pub(crate) mod constrained_union_internal {
|
9246 + | pub(crate) mod length_list_internal {
|
9182 9247 |
|
9183 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9184 9248 | #[allow(clippy::enum_variant_names)]
|
9249 + | #[derive(Debug, PartialEq)]
|
9185 9250 | pub(crate) enum ConstraintViolation {
|
9186 - | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
9187 - | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
9188 - | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
9189 - | ConstrainedStructure(crate::model::con_b_internal::ConstraintViolation),
|
9190 - | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
9191 - | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
9251 + | /// Constraint violation error when the list doesn't have the required length
|
9252 + | Length(usize),
|
9192 9253 | }
|
9254 + |
|
9193 9255 | impl ::std::fmt::Display for ConstraintViolation {
|
9194 9256 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9195 - | match self {
|
9196 - | Self::ConBList(inner) => write!(f, "{inner}"),
|
9197 - | Self::ConBMap(inner) => write!(f, "{inner}"),
|
9198 - | Self::ConBSet(inner) => write!(f, "{inner}"),
|
9199 - | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
9200 - | Self::EnumString(inner) => write!(f, "{inner}"),
|
9201 - | Self::LengthString(inner) => write!(f, "{inner}"),
|
9257 + | let message = match self {
|
9258 + | Self::Length(length) => {
|
9259 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9202 9260 | }
|
9261 + | };
|
9262 + | write!(f, "{message}")
|
9203 9263 | }
|
9204 9264 | }
|
9205 9265 |
|
9206 9266 | impl ::std::error::Error for ConstraintViolation {}
|
9207 9267 | impl ConstraintViolation {
|
9208 9268 | pub(crate) fn as_validation_exception_field(
|
9209 9269 | self,
|
9210 9270 | path: ::std::string::String,
|
9211 9271 | ) -> crate::model::ValidationExceptionField {
|
9212 9272 | match self {
|
9213 - | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
9214 - | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
9215 - | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
9216 - | Self::ConstrainedStructure(inner) => {
|
9217 - | inner.as_validation_exception_field(path + "/constrainedStructure")
|
9273 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9274 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9275 + | path,
|
9276 + | },
|
9218 9277 | }
|
9219 - | Self::EnumString(inner) => {
|
9220 - | inner.as_validation_exception_field(path + "/enumString")
|
9221 9278 | }
|
9222 - | Self::LengthString(inner) => {
|
9223 - | inner.as_validation_exception_field(path + "/lengthString")
|
9224 9279 | }
|
9280 + | }
|
9281 + | pub(crate) mod sensitive_length_list_internal {
|
9282 + |
|
9283 + | #[allow(clippy::enum_variant_names)]
|
9284 + | #[derive(Debug, PartialEq)]
|
9285 + | pub(crate) enum ConstraintViolation {
|
9286 + | /// Constraint violation error when the list doesn't have the required length
|
9287 + | Length(usize),
|
9288 + | }
|
9289 + |
|
9290 + | impl ::std::fmt::Display for ConstraintViolation {
|
9291 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9292 + | let message = match self {
|
9293 + | Self::Length(length) => {
|
9294 + | format!("Value with length {} provided for 'com.amazonaws.constraints#SensitiveLengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9295 + | }
|
9296 + | };
|
9297 + | write!(f, "{message}")
|
9298 + | }
|
9299 + | }
|
9300 + |
|
9301 + | impl ::std::error::Error for ConstraintViolation {}
|
9302 + | impl ConstraintViolation {
|
9303 + | pub(crate) fn as_validation_exception_field(
|
9304 + | self,
|
9305 + | path: ::std::string::String,
|
9306 + | ) -> crate::model::ValidationExceptionField {
|
9307 + | match self {
|
9308 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9309 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9310 + | path,
|
9311 + | },
|
9225 9312 | }
|
9226 9313 | }
|
9227 9314 | }
|
9228 9315 | }
|
9229 9316 | pub(crate) mod con_b_set_internal {
|
9230 9317 |
|
9231 9318 | #[allow(clippy::enum_variant_names)]
|
9232 9319 | #[derive(Debug, PartialEq)]
|
9233 9320 | pub(crate) enum ConstraintViolation {
|
9234 9321 | /// Constraint violation error when the list does not contain unique items
|
9235 9322 | UniqueItems {
|
9236 9323 | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9237 9324 | /// at least two elements.
|
9238 9325 | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9239 9326 | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9240 9327 | /// Nothing is guaranteed about the order of the indices.
|
9241 9328 | duplicate_indices: ::std::vec::Vec<usize>,
|
9242 9329 | /// The original vector, that contains duplicate items.
|
9243 9330 | original: ::std::vec::Vec<crate::model::ConBSetInner>,
|
9244 9331 | },
|
9245 9332 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9246 9333 | /// The first component of the tuple is the index in the collection where the
|
9247 9334 | /// first constraint violation was found.
|
9248 9335 | #[doc(hidden)]
|
9249 9336 | Member(
|
9250 9337 | usize,
|
9251 9338 | crate::model::con_b_set_inner_internal::ConstraintViolation,
|
9252 9339 | ),
|
9253 9340 | }
|
9254 9341 |
|
9255 9342 | impl ::std::fmt::Display for ConstraintViolation {
|
9256 9343 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9257 9344 | let message = match self {
|
9258 9345 | Self::UniqueItems { duplicate_indices, .. } =>
|
9259 9346 | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9260 9347 | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9261 9348 | failing_member)
|
9262 9349 | };
|
9263 9350 | write!(f, "{message}")
|
9264 9351 | }
|
9265 9352 | }
|
9266 9353 |
|
9267 9354 | impl ::std::error::Error for ConstraintViolation {}
|
9268 9355 | impl ConstraintViolation {
|
9269 9356 | pub(crate) fn as_validation_exception_field(
|
9270 9357 | self,
|
9271 9358 | path: ::std::string::String,
|
9272 9359 | ) -> crate::model::ValidationExceptionField {
|
9273 9360 | match self {
|
9274 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9275 - | crate::model::ValidationExceptionField {
|
9276 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9361 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9362 + | crate::model::ValidationExceptionField {
|
9363 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9364 + | path,
|
9365 + | },
|
9366 + | Self::Member(index, member_constraint_violation) =>
|
9367 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9368 + | }
|
9369 + | }
|
9370 + | }
|
9371 + | }
|
9372 + | pub(crate) mod length_map_internal {
|
9373 + |
|
9374 + | #[allow(clippy::enum_variant_names)]
|
9375 + | #[derive(Debug, PartialEq)]
|
9376 + | pub(crate) enum ConstraintViolation {
|
9377 + | Length(usize),
|
9378 + | }
|
9379 + |
|
9380 + | impl ::std::fmt::Display for ConstraintViolation {
|
9381 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9382 + | match self {
|
9383 + | Self::Length(length) => {
|
9384 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#LengthMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
9385 + | }
|
9386 + | }
|
9387 + | }
|
9388 + | }
|
9389 + |
|
9390 + | impl ::std::error::Error for ConstraintViolation {}
|
9391 + | impl ConstraintViolation {
|
9392 + | pub(crate) fn as_validation_exception_field(
|
9393 + | self,
|
9394 + | path: ::std::string::String,
|
9395 + | ) -> crate::model::ValidationExceptionField {
|
9396 + | match self {
|
9397 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9398 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9277 9399 | path,
|
9278 9400 | },
|
9279 - | Self::Member(index, member_constraint_violation) =>
|
9280 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
9281 9401 | }
|
9282 9402 | }
|
9283 9403 | }
|
9284 9404 | }
|
9285 - | pub(crate) mod con_b_set_inner_internal {
|
9405 + | pub(crate) mod map_of_map_of_list_of_list_of_con_b_internal {
|
9286 9406 |
|
9287 9407 | #[allow(clippy::enum_variant_names)]
|
9288 9408 | #[derive(Debug, PartialEq)]
|
9289 9409 | pub(crate) enum ConstraintViolation {
|
9290 - | /// Constraint violation error when the list does not contain unique items
|
9291 - | UniqueItems {
|
9292 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9293 - | /// at least two elements.
|
9294 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9295 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9296 - | /// Nothing is guaranteed about the order of the indices.
|
9297 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9298 - | /// The original vector, that contains duplicate items.
|
9299 - | original: ::std::vec::Vec<::std::string::String>,
|
9300 - | },
|
9410 + | #[doc(hidden)]
|
9411 + | Value(
|
9412 + | ::std::string::String,
|
9413 + | crate::model::map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
9414 + | ),
|
9301 9415 | }
|
9302 9416 |
|
9303 9417 | impl ::std::fmt::Display for ConstraintViolation {
|
9304 9418 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9305 - | let message = match self {
|
9306 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9307 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9308 - | };
|
9309 - | write!(f, "{message}")
|
9419 + | match self {
|
9420 + | Self::Value(_, value_constraint_violation) => {
|
9421 + | write!(f, "{}", value_constraint_violation)
|
9422 + | }
|
9423 + | }
|
9310 9424 | }
|
9311 9425 | }
|
9312 9426 |
|
9313 9427 | impl ::std::error::Error for ConstraintViolation {}
|
9314 9428 | impl ConstraintViolation {
|
9315 9429 | pub(crate) fn as_validation_exception_field(
|
9316 9430 | self,
|
9317 9431 | path: ::std::string::String,
|
9318 9432 | ) -> crate::model::ValidationExceptionField {
|
9319 9433 | match self {
|
9320 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9321 - | crate::model::ValidationExceptionField {
|
9322 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9323 - | path,
|
9324 - | },
|
9434 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9435 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9325 9436 | }
|
9326 9437 | }
|
9327 9438 | }
|
9328 9439 | }
|
9329 - | pub(crate) mod con_b_list_internal {
|
9440 + | pub(crate) mod sparse_map_internal {
|
9330 9441 |
|
9331 9442 | #[allow(clippy::enum_variant_names)]
|
9332 9443 | #[derive(Debug, PartialEq)]
|
9333 9444 | pub(crate) enum ConstraintViolation {
|
9334 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9335 - | /// The first component of the tuple is the index in the collection where the
|
9336 - | /// first constraint violation was found.
|
9337 9445 | #[doc(hidden)]
|
9338 - | Member(
|
9339 - | usize,
|
9340 - | crate::model::con_b_list_inner_internal::ConstraintViolation,
|
9446 + | Value(
|
9447 + | ::std::string::String,
|
9448 + | crate::model::unique_items_list_internal::ConstraintViolation,
|
9341 9449 | ),
|
9342 9450 | }
|
9343 9451 |
|
9344 9452 | impl ::std::fmt::Display for ConstraintViolation {
|
9345 9453 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9346 - | let message = match self {
|
9347 - | Self::Member(index, failing_member) => format!(
|
9348 - | "Value at index {index} failed to satisfy constraint. {}",
|
9349 - | failing_member
|
9350 - | ),
|
9351 - | };
|
9352 - | write!(f, "{message}")
|
9454 + | match self {
|
9455 + | Self::Value(_, value_constraint_violation) => {
|
9456 + | write!(f, "{}", value_constraint_violation)
|
9457 + | }
|
9458 + | }
|
9353 9459 | }
|
9354 9460 | }
|
9355 9461 |
|
9356 9462 | impl ::std::error::Error for ConstraintViolation {}
|
9357 9463 | impl ConstraintViolation {
|
9358 9464 | pub(crate) fn as_validation_exception_field(
|
9359 9465 | self,
|
9360 9466 | path: ::std::string::String,
|
9361 9467 | ) -> crate::model::ValidationExceptionField {
|
9362 9468 | match self {
|
9363 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9364 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9469 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9470 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9365 9471 | }
|
9366 9472 | }
|
9367 9473 | }
|
9368 9474 | }
|
9369 - | pub(crate) mod con_b_list_inner_internal {
|
9475 + | pub(crate) mod sparse_list_internal {
|
9370 9476 |
|
9371 9477 | #[allow(clippy::enum_variant_names)]
|
9372 9478 | #[derive(Debug, PartialEq)]
|
9373 9479 | pub(crate) enum ConstraintViolation {
|
9374 9480 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9375 9481 | /// The first component of the tuple is the index in the collection where the
|
9376 9482 | /// first constraint violation was found.
|
9377 9483 | #[doc(hidden)]
|
9378 - | Member(usize, crate::model::con_b_internal::ConstraintViolation),
|
9484 + | Member(
|
9485 + | usize,
|
9486 + | crate::model::length_string_internal::ConstraintViolation,
|
9487 + | ),
|
9379 9488 | }
|
9380 9489 |
|
9381 9490 | impl ::std::fmt::Display for ConstraintViolation {
|
9382 9491 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9383 9492 | let message = match self {
|
9384 9493 | Self::Member(index, failing_member) => format!(
|
9385 9494 | "Value at index {index} failed to satisfy constraint. {}",
|
9386 9495 | failing_member
|
9387 9496 | ),
|
9388 9497 | };
|
9389 9498 | write!(f, "{message}")
|
9390 9499 | }
|
9391 9500 | }
|
9392 9501 |
|
9393 9502 | impl ::std::error::Error for ConstraintViolation {}
|
9394 9503 | impl ConstraintViolation {
|
9395 9504 | pub(crate) fn as_validation_exception_field(
|
9396 9505 | self,
|
9397 9506 | path: ::std::string::String,
|
9398 9507 | ) -> crate::model::ValidationExceptionField {
|
9399 9508 | match self {
|
9400 9509 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9401 9510 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9402 9511 | }
|
9403 9512 | }
|
9404 9513 | }
|
9405 9514 | }
|
9406 - | /// See [`ConB`](crate::model::ConB).
|
9407 - | pub(crate) mod con_b_internal {
|
9515 + | pub(crate) mod sparse_length_map_internal {
|
9408 9516 |
|
9409 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9410 - | /// Holds one variant for each of the ways the builder can fail.
|
9411 - | #[non_exhaustive]
|
9412 9517 | #[allow(clippy::enum_variant_names)]
|
9518 + | #[derive(Debug, PartialEq)]
|
9413 9519 | pub(crate) enum ConstraintViolation {
|
9414 - | /// `nice` was not provided but it is required when building `ConB`.
|
9415 - | MissingNice,
|
9416 - | /// `int` was not provided but it is required when building `ConB`.
|
9417 - | MissingInt,
|
9418 - | }
|
9419 - | impl ::std::fmt::Display for ConstraintViolation {
|
9420 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9421 - | match self {
|
9422 - | ConstraintViolation::MissingNice => write!(
|
9423 - | f,
|
9424 - | "`nice` was not provided but it is required when building `ConB`"
|
9425 - | ),
|
9426 - | ConstraintViolation::MissingInt => write!(
|
9427 - | f,
|
9428 - | "`int` was not provided but it is required when building `ConB`"
|
9429 - | ),
|
9430 - | }
|
9431 - | }
|
9432 - | }
|
9433 - | impl ::std::error::Error for ConstraintViolation {}
|
9434 - | impl ConstraintViolation {
|
9435 - | pub(crate) fn as_validation_exception_field(
|
9436 - | self,
|
9437 - | path: ::std::string::String,
|
9438 - | ) -> crate::model::ValidationExceptionField {
|
9439 - | match self {
|
9440 - | ConstraintViolation::MissingNice => crate::model::ValidationExceptionField {
|
9441 - | message: format!(
|
9442 - | "Value at '{}/nice' failed to satisfy constraint: Member must not be null",
|
9443 - | path
|
9444 - | ),
|
9445 - | path: path + "/nice",
|
9446 - | },
|
9447 - | ConstraintViolation::MissingInt => crate::model::ValidationExceptionField {
|
9448 - | message: format!(
|
9449 - | "Value at '{}/int' failed to satisfy constraint: Member must not be null",
|
9450 - | path
|
9451 - | ),
|
9452 - | path: path + "/int",
|
9453 - | },
|
9454 - | }
|
9455 - | }
|
9456 - | }
|
9457 - | impl ::std::convert::From<Builder> for crate::constrained::MaybeConstrained<crate::model::ConB> {
|
9458 - | fn from(builder: Builder) -> Self {
|
9459 - | Self::Unconstrained(builder)
|
9460 - | }
|
9461 - | }
|
9462 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9463 - | type Error = ConstraintViolation;
|
9464 - |
|
9465 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9466 - | builder.build()
|
9467 - | }
|
9468 - | }
|
9469 - | /// A builder for [`ConB`](crate::model::ConB).
|
9470 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9471 - | pub(crate) struct Builder {
|
9472 - | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9473 - | pub(crate) int: ::std::option::Option<i32>,
|
9474 - | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9475 - | pub(crate) opt_int: ::std::option::Option<i32>,
|
9476 - | }
|
9477 - | impl Builder {
|
9478 - | #[allow(missing_docs)] // documentation missing in model
|
9479 - | pub(crate) fn set_nice(
|
9480 - | mut self,
|
9481 - | input: impl ::std::convert::Into<::std::string::String>,
|
9482 - | ) -> Self {
|
9483 - | self.nice = Some(input.into());
|
9484 - | self
|
9485 - | }
|
9486 - | #[allow(missing_docs)] // documentation missing in model
|
9487 - | pub(crate) fn set_int(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
9488 - | self.int = Some(input.into());
|
9489 - | self
|
9490 - | }
|
9491 - | #[allow(missing_docs)] // documentation missing in model
|
9492 - | pub(crate) fn set_opt_nice(
|
9493 - | mut self,
|
9494 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
9495 - | ) -> Self {
|
9496 - | self.opt_nice = input.map(|v| v.into());
|
9497 - | self
|
9498 - | }
|
9499 - | #[allow(missing_docs)] // documentation missing in model
|
9500 - | pub(crate) fn set_opt_int(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
9501 - | self.opt_int = input.map(|v| v.into());
|
9502 - | self
|
9503 - | }
|
9504 - | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9505 - | ///
|
9506 - | /// The builder fails to construct a [`ConB`](crate::model::ConB) if a [`ConstraintViolation`] occurs.
|
9507 - | ///
|
9508 - | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
9509 - | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9510 - | self.build_enforcing_all_constraints()
|
9511 - | }
|
9512 - | fn build_enforcing_all_constraints(
|
9513 - | self,
|
9514 - | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9515 - | Ok(crate::model::ConB {
|
9516 - | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9517 - | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9518 - | opt_nice: self.opt_nice,
|
9519 - | opt_int: self.opt_int,
|
9520 - | })
|
9521 - | }
|
9520 + | Length(usize),
|
9522 9521 | }
|
9523 - | }
|
9524 - | /// See [`ConB`](crate::model::ConB).
|
9525 - | pub mod con_b {
|
9526 9522 |
|
9527 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9528 - | /// Holds one variant for each of the ways the builder can fail.
|
9529 - | #[allow(clippy::enum_variant_names)]
|
9530 - | pub enum ConstraintViolation {
|
9531 - | /// `nice` was not provided but it is required when building `ConB`.
|
9532 - | MissingNice,
|
9533 - | /// `int` was not provided but it is required when building `ConB`.
|
9534 - | MissingInt,
|
9535 - | }
|
9536 9523 | impl ::std::fmt::Display for ConstraintViolation {
|
9537 9524 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9538 9525 | match self {
|
9539 - | ConstraintViolation::MissingNice => write!(
|
9540 - | f,
|
9541 - | "`nice` was not provided but it is required when building `ConB`"
|
9542 - | ),
|
9543 - | ConstraintViolation::MissingInt => write!(
|
9544 - | f,
|
9545 - | "`int` was not provided but it is required when building `ConB`"
|
9546 - | ),
|
9547 - | }
|
9548 - | }
|
9549 - | }
|
9550 - | impl ::std::error::Error for ConstraintViolation {}
|
9551 - | impl ::std::convert::TryFrom<Builder> for crate::model::ConB {
|
9552 - | type Error = ConstraintViolation;
|
9553 - |
|
9554 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
9555 - | builder.build()
|
9556 - | }
|
9557 - | }
|
9558 - | /// A builder for [`ConB`](crate::model::ConB).
|
9559 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
9560 - | pub struct Builder {
|
9561 - | pub(crate) nice: ::std::option::Option<::std::string::String>,
|
9562 - | pub(crate) int: ::std::option::Option<i32>,
|
9563 - | pub(crate) opt_nice: ::std::option::Option<::std::string::String>,
|
9564 - | pub(crate) opt_int: ::std::option::Option<i32>,
|
9565 - | }
|
9566 - | impl Builder {
|
9567 - | #[allow(missing_docs)] // documentation missing in model
|
9568 - | pub fn nice(mut self, input: ::std::string::String) -> Self {
|
9569 - | self.nice = Some(input);
|
9570 - | self
|
9571 - | }
|
9572 - | #[allow(missing_docs)] // documentation missing in model
|
9573 - | pub fn int(mut self, input: i32) -> Self {
|
9574 - | self.int = Some(input);
|
9575 - | self
|
9576 - | }
|
9577 - | #[allow(missing_docs)] // documentation missing in model
|
9578 - | pub fn opt_nice(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
9579 - | self.opt_nice = input;
|
9580 - | self
|
9581 - | }
|
9582 - | #[allow(missing_docs)] // documentation missing in model
|
9583 - | pub fn opt_int(mut self, input: ::std::option::Option<i32>) -> Self {
|
9584 - | self.opt_int = input;
|
9585 - | self
|
9526 + | Self::Length(length) => {
|
9527 + | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#SparseLengthMap' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
9586 9528 | }
|
9587 - | /// Consumes the builder and constructs a [`ConB`](crate::model::ConB).
|
9588 - | ///
|
9589 - | /// The builder fails to construct a [`ConB`](crate::model::ConB) if you do not provide a value for all non-`Option`al members.
|
9590 - | ///
|
9591 - | pub fn build(self) -> Result<crate::model::ConB, ConstraintViolation> {
|
9592 - | self.build_enforcing_required_and_enum_traits()
|
9593 9529 | }
|
9594 - | fn build_enforcing_required_and_enum_traits(
|
9530 + | }
|
9531 + | }
|
9532 + |
|
9533 + | impl ::std::error::Error for ConstraintViolation {}
|
9534 + | impl ConstraintViolation {
|
9535 + | pub(crate) fn as_validation_exception_field(
|
9595 9536 | self,
|
9596 - | ) -> Result<crate::model::ConB, ConstraintViolation> {
|
9597 - | Ok(crate::model::ConB {
|
9598 - | nice: self.nice.ok_or(ConstraintViolation::MissingNice)?,
|
9599 - | int: self.int.ok_or(ConstraintViolation::MissingInt)?,
|
9600 - | opt_nice: self.opt_nice,
|
9601 - | opt_int: self.opt_int,
|
9602 - | })
|
9537 + | path: ::std::string::String,
|
9538 + | ) -> crate::model::ValidationExceptionField {
|
9539 + | match self {
|
9540 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
9541 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9542 + | path,
|
9543 + | },
|
9544 + | }
|
9603 9545 | }
|
9604 9546 | }
|
9605 9547 | }
|
9606 9548 | pub(crate) mod sparse_length_list_internal {
|
9607 9549 |
|
9608 9550 | #[allow(clippy::enum_variant_names)]
|
9609 9551 | #[derive(Debug, PartialEq)]
|
9610 9552 | pub(crate) enum ConstraintViolation {
|
9611 9553 | /// Constraint violation error when the list doesn't have the required length
|
9612 9554 | Length(usize),
|
9613 9555 | }
|
9614 9556 |
|
9615 9557 | impl ::std::fmt::Display for ConstraintViolation {
|
9616 9558 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9617 9559 | let message = match self {
|
9618 9560 | Self::Length(length) => {
|
9619 9561 | format!("Value with length {} provided for 'com.amazonaws.constraints#SparseLengthList' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
9620 9562 | }
|
9621 9563 | };
|
9622 9564 | write!(f, "{message}")
|
9623 9565 | }
|
9624 9566 | }
|
9625 9567 |
|
9626 9568 | impl ::std::error::Error for ConstraintViolation {}
|
9627 9569 | impl ConstraintViolation {
|
9628 9570 | pub(crate) fn as_validation_exception_field(
|
9629 9571 | self,
|
9630 9572 | path: ::std::string::String,
|
9631 9573 | ) -> crate::model::ValidationExceptionField {
|
9632 9574 | match self {
|
9633 9575 | Self::Length(length) => crate::model::ValidationExceptionField {
|
9634 9576 | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9635 9577 | path,
|
9636 9578 | },
|
9637 9579 | }
|
9638 9580 | }
|
9639 9581 | }
|
9640 9582 | }
|
9641 - | pub(crate) mod sparse_length_map_internal {
|
9583 + | pub(crate) mod constrained_union_internal {
|
9642 9584 |
|
9585 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
9643 9586 | #[allow(clippy::enum_variant_names)]
|
9644 - | #[derive(Debug, PartialEq)]
|
9645 9587 | pub(crate) enum ConstraintViolation {
|
9646 - | Length(usize),
|
9588 + | ConBList(crate::model::con_b_list_internal::ConstraintViolation),
|
9589 + | ConBMap(crate::model::con_b_map_internal::ConstraintViolation),
|
9590 + | ConBSet(crate::model::con_b_set_internal::ConstraintViolation),
|
9591 + | ConstrainedStructure(crate::model::con_b_internal::ConstraintViolation),
|
9592 + | EnumString(crate::model::enum_string_internal::ConstraintViolation),
|
9593 + | LengthString(crate::model::length_string_internal::ConstraintViolation),
|
9647 9594 | }
|
9648 - |
|
9649 9595 | impl ::std::fmt::Display for ConstraintViolation {
|
9650 9596 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9651 9597 | match self {
|
9652 - | Self::Length(length) => {
|
9653 - | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#SparseLengthMap' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
9654 - | }
|
9598 + | Self::ConBList(inner) => write!(f, "{inner}"),
|
9599 + | Self::ConBMap(inner) => write!(f, "{inner}"),
|
9600 + | Self::ConBSet(inner) => write!(f, "{inner}"),
|
9601 + | Self::ConstrainedStructure(inner) => write!(f, "{inner}"),
|
9602 + | Self::EnumString(inner) => write!(f, "{inner}"),
|
9603 + | Self::LengthString(inner) => write!(f, "{inner}"),
|
9655 9604 | }
|
9656 9605 | }
|
9657 9606 | }
|
9658 9607 |
|
9659 9608 | impl ::std::error::Error for ConstraintViolation {}
|
9660 9609 | impl ConstraintViolation {
|
9661 9610 | pub(crate) fn as_validation_exception_field(
|
9662 9611 | self,
|
9663 9612 | path: ::std::string::String,
|
9664 9613 | ) -> crate::model::ValidationExceptionField {
|
9665 9614 | match self {
|
9666 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9667 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 69", length, &path),
|
9668 - | path,
|
9669 - | },
|
9615 + | Self::ConBList(inner) => inner.as_validation_exception_field(path + "/conBList"),
|
9616 + | Self::ConBMap(inner) => inner.as_validation_exception_field(path + "/conBMap"),
|
9617 + | Self::ConBSet(inner) => inner.as_validation_exception_field(path + "/conBSet"),
|
9618 + | Self::ConstrainedStructure(inner) => {
|
9619 + | inner.as_validation_exception_field(path + "/constrainedStructure")
|
9620 + | }
|
9621 + | Self::EnumString(inner) => {
|
9622 + | inner.as_validation_exception_field(path + "/enumString")
|
9623 + | }
|
9624 + | Self::LengthString(inner) => {
|
9625 + | inner.as_validation_exception_field(path + "/lengthString")
|
9626 + | }
|
9670 9627 | }
|
9671 9628 | }
|
9672 9629 | }
|
9673 9630 | }
|
9674 - | pub(crate) mod sparse_list_internal {
|
9631 + | pub(crate) mod list_of_length_blob_internal {
|
9675 9632 |
|
9676 9633 | #[allow(clippy::enum_variant_names)]
|
9677 9634 | #[derive(Debug, PartialEq)]
|
9678 9635 | pub(crate) enum ConstraintViolation {
|
9679 9636 | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9680 9637 | /// The first component of the tuple is the index in the collection where the
|
9681 9638 | /// first constraint violation was found.
|
9682 9639 | #[doc(hidden)]
|
9683 9640 | Member(
|
9684 9641 | usize,
|
9685 - | crate::model::length_string_internal::ConstraintViolation,
|
9642 + | crate::model::length_blob_internal::ConstraintViolation,
|
9686 9643 | ),
|
9687 9644 | }
|
9688 9645 |
|
9689 9646 | impl ::std::fmt::Display for ConstraintViolation {
|
9690 9647 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9691 9648 | let message = match self {
|
9692 9649 | Self::Member(index, failing_member) => format!(
|
9693 9650 | "Value at index {index} failed to satisfy constraint. {}",
|
9694 9651 | failing_member
|
9695 9652 | ),
|
9696 9653 | };
|
9697 9654 | write!(f, "{message}")
|
9698 9655 | }
|
9699 9656 | }
|
9700 9657 |
|
9701 9658 | impl ::std::error::Error for ConstraintViolation {}
|
9702 9659 | impl ConstraintViolation {
|
9703 9660 | pub(crate) fn as_validation_exception_field(
|
9704 9661 | self,
|
9705 9662 | path: ::std::string::String,
|
9706 9663 | ) -> crate::model::ValidationExceptionField {
|
9707 9664 | match self {
|
9708 9665 | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9709 9666 | .as_validation_exception_field(path + "/" + &index.to_string()),
|
9710 9667 | }
|
9711 9668 | }
|
9712 9669 | }
|
9713 9670 | }
|
9714 - | pub(crate) mod sparse_map_internal {
|
9671 + | pub(crate) mod map_of_length_blob_internal {
|
9715 9672 |
|
9716 9673 | #[allow(clippy::enum_variant_names)]
|
9717 9674 | #[derive(Debug, PartialEq)]
|
9718 9675 | pub(crate) enum ConstraintViolation {
|
9719 9676 | #[doc(hidden)]
|
9720 9677 | Value(
|
9721 9678 | ::std::string::String,
|
9722 - | crate::model::unique_items_list_internal::ConstraintViolation,
|
9679 + | crate::model::length_blob_internal::ConstraintViolation,
|
9723 9680 | ),
|
9724 9681 | }
|
9725 9682 |
|
9726 9683 | impl ::std::fmt::Display for ConstraintViolation {
|
9727 9684 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9728 9685 | match self {
|
9729 9686 | Self::Value(_, value_constraint_violation) => {
|
9730 9687 | write!(f, "{}", value_constraint_violation)
|
9731 9688 | }
|
9732 9689 | }
|
9733 9690 | }
|
9734 9691 | }
|
9735 9692 |
|
9736 9693 | impl ::std::error::Error for ConstraintViolation {}
|
9737 9694 | impl ConstraintViolation {
|
9738 9695 | pub(crate) fn as_validation_exception_field(
|
9739 9696 | self,
|
9740 9697 | path: ::std::string::String,
|
9741 9698 | ) -> crate::model::ValidationExceptionField {
|
9742 9699 | match self {
|
9743 9700 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9744 9701 | .as_validation_exception_field(path + "/" + key.as_str()),
|
9745 9702 | }
|
9746 9703 | }
|
9747 9704 | }
|
9748 9705 | }
|
9749 - | pub(crate) mod unique_items_list_internal {
|
9706 + | pub(crate) mod map_of_range_integer_internal {
|
9750 9707 |
|
9751 9708 | #[allow(clippy::enum_variant_names)]
|
9752 9709 | #[derive(Debug, PartialEq)]
|
9753 9710 | pub(crate) enum ConstraintViolation {
|
9754 - | /// Constraint violation error when the list does not contain unique items
|
9755 - | UniqueItems {
|
9756 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9757 - | /// at least two elements.
|
9758 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9759 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9760 - | /// Nothing is guaranteed about the order of the indices.
|
9761 - | duplicate_indices: ::std::vec::Vec<usize>,
|
9762 - | /// The original vector, that contains duplicate items.
|
9763 - | original: ::std::vec::Vec<::std::string::String>,
|
9764 - | },
|
9711 + | #[doc(hidden)]
|
9712 + | Value(
|
9713 + | ::std::string::String,
|
9714 + | crate::model::range_integer_internal::ConstraintViolation,
|
9715 + | ),
|
9765 9716 | }
|
9766 9717 |
|
9767 9718 | impl ::std::fmt::Display for ConstraintViolation {
|
9768 9719 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9769 - | let message = match self {
|
9770 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9771 - | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9772 - | };
|
9773 - | write!(f, "{message}")
|
9720 + | match self {
|
9721 + | Self::Value(_, value_constraint_violation) => {
|
9722 + | write!(f, "{}", value_constraint_violation)
|
9723 + | }
|
9724 + | }
|
9774 9725 | }
|
9775 9726 | }
|
9776 9727 |
|
9777 9728 | impl ::std::error::Error for ConstraintViolation {}
|
9778 9729 | impl ConstraintViolation {
|
9779 9730 | pub(crate) fn as_validation_exception_field(
|
9780 9731 | self,
|
9781 9732 | path: ::std::string::String,
|
9782 9733 | ) -> crate::model::ValidationExceptionField {
|
9783 9734 | match self {
|
9784 - | Self::UniqueItems { duplicate_indices, .. } =>
|
9785 - | crate::model::ValidationExceptionField {
|
9786 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
9787 - | path,
|
9788 - | },
|
9735 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9736 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9789 9737 | }
|
9790 9738 | }
|
9791 9739 | }
|
9792 9740 | }
|
9793 - | pub(crate) mod map_of_map_of_list_of_list_of_con_b_internal {
|
9741 + | pub(crate) mod map_of_range_short_internal {
|
9794 9742 |
|
9795 9743 | #[allow(clippy::enum_variant_names)]
|
9796 9744 | #[derive(Debug, PartialEq)]
|
9797 9745 | pub(crate) enum ConstraintViolation {
|
9798 9746 | #[doc(hidden)]
|
9799 9747 | Value(
|
9800 9748 | ::std::string::String,
|
9801 - | crate::model::map_of_list_of_list_of_con_b_internal::ConstraintViolation,
|
9749 + | crate::model::range_short_internal::ConstraintViolation,
|
9802 9750 | ),
|
9803 9751 | }
|
9804 9752 |
|
9805 9753 | impl ::std::fmt::Display for ConstraintViolation {
|
9806 9754 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9807 9755 | match self {
|
9808 9756 | Self::Value(_, value_constraint_violation) => {
|
9809 9757 | write!(f, "{}", value_constraint_violation)
|
9810 9758 | }
|
9811 9759 | }
|
9812 9760 | }
|
9813 9761 | }
|
9814 9762 |
|
9815 9763 | impl ::std::error::Error for ConstraintViolation {}
|
9816 9764 | impl ConstraintViolation {
|
9817 9765 | pub(crate) fn as_validation_exception_field(
|
9818 9766 | self,
|
9819 9767 | path: ::std::string::String,
|
9820 9768 | ) -> crate::model::ValidationExceptionField {
|
9821 9769 | match self {
|
9822 9770 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9823 9771 | .as_validation_exception_field(path + "/" + key.as_str()),
|
9824 9772 | }
|
9825 9773 | }
|
9826 9774 | }
|
9827 9775 | }
|
9828 - | pub(crate) mod map_of_list_of_list_of_con_b_internal {
|
9776 + | pub(crate) mod map_of_range_long_internal {
|
9829 9777 |
|
9830 9778 | #[allow(clippy::enum_variant_names)]
|
9831 9779 | #[derive(Debug, PartialEq)]
|
9832 9780 | pub(crate) enum ConstraintViolation {
|
9833 9781 | #[doc(hidden)]
|
9834 9782 | Value(
|
9835 9783 | ::std::string::String,
|
9836 - | crate::model::con_b_list_internal::ConstraintViolation,
|
9784 + | crate::model::range_long_internal::ConstraintViolation,
|
9837 9785 | ),
|
9838 9786 | }
|
9839 9787 |
|
9840 9788 | impl ::std::fmt::Display for ConstraintViolation {
|
9841 9789 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9842 9790 | match self {
|
9843 9791 | Self::Value(_, value_constraint_violation) => {
|
9844 9792 | write!(f, "{}", value_constraint_violation)
|
9845 9793 | }
|
9846 9794 | }
|
9847 9795 | }
|
9848 9796 | }
|
9849 9797 |
|
9850 9798 | impl ::std::error::Error for ConstraintViolation {}
|
9851 9799 | impl ConstraintViolation {
|
9852 9800 | pub(crate) fn as_validation_exception_field(
|
9853 9801 | self,
|
9854 9802 | path: ::std::string::String,
|
9855 9803 | ) -> crate::model::ValidationExceptionField {
|
9856 9804 | match self {
|
9857 9805 | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9858 9806 | .as_validation_exception_field(path + "/" + key.as_str()),
|
9859 9807 | }
|
9860 9808 | }
|
9861 9809 | }
|
9862 9810 | }
|
9863 - | pub(crate) mod length_map_internal {
|
9811 + | pub(crate) mod map_of_range_byte_internal {
|
9864 9812 |
|
9865 9813 | #[allow(clippy::enum_variant_names)]
|
9866 9814 | #[derive(Debug, PartialEq)]
|
9867 9815 | pub(crate) enum ConstraintViolation {
|
9868 - | Length(usize),
|
9816 + | #[doc(hidden)]
|
9817 + | Value(
|
9818 + | ::std::string::String,
|
9819 + | crate::model::range_byte_internal::ConstraintViolation,
|
9820 + | ),
|
9869 9821 | }
|
9870 9822 |
|
9871 9823 | impl ::std::fmt::Display for ConstraintViolation {
|
9872 9824 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9873 9825 | match self {
|
9874 - | Self::Length(length) => {
|
9875 - | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#LengthMap' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length)
|
9826 + | Self::Value(_, value_constraint_violation) => {
|
9827 + | write!(f, "{}", value_constraint_violation)
|
9876 9828 | }
|
9877 9829 | }
|
9878 9830 | }
|
9879 9831 | }
|
9880 9832 |
|
9881 9833 | impl ::std::error::Error for ConstraintViolation {}
|
9882 9834 | impl ConstraintViolation {
|
9883 9835 | pub(crate) fn as_validation_exception_field(
|
9884 9836 | self,
|
9885 9837 | path: ::std::string::String,
|
9886 9838 | ) -> crate::model::ValidationExceptionField {
|
9887 9839 | match self {
|
9888 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9889 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 1 and 69, inclusive", length, &path),
|
9890 - | path,
|
9891 - | },
|
9840 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
9841 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
9892 9842 | }
|
9893 9843 | }
|
9894 9844 | }
|
9895 9845 | }
|
9896 - | pub(crate) mod sensitive_length_list_internal {
|
9846 + | pub(crate) mod pattern_string_internal {
|
9897 9847 |
|
9898 - | #[allow(clippy::enum_variant_names)]
|
9899 9848 | #[derive(Debug, PartialEq)]
|
9900 - | pub(crate) enum ConstraintViolation {
|
9901 - | /// Constraint violation error when the list doesn't have the required length
|
9902 - | Length(usize),
|
9849 + | pub enum ConstraintViolation {
|
9850 + | /// Error when a string doesn't satisfy its `@pattern`.
|
9851 + | /// Contains the String that failed the pattern.
|
9852 + | Pattern(String),
|
9903 9853 | }
|
9904 9854 |
|
9905 9855 | impl ::std::fmt::Display for ConstraintViolation {
|
9906 9856 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9907 9857 | let message = match self {
|
9908 - | Self::Length(length) => {
|
9909 - | format!("Value with length {} provided for 'com.amazonaws.constraints#SensitiveLengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9858 + | Self::Pattern(_) => {
|
9859 + | format!(
|
9860 + | r#"Value provided for `com.amazonaws.constraints#PatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
9861 + | r#"[a-d]{5}"#
|
9862 + | )
|
9910 9863 | }
|
9911 9864 | };
|
9912 9865 | write!(f, "{message}")
|
9913 9866 | }
|
9914 9867 | }
|
9915 9868 |
|
9916 9869 | impl ::std::error::Error for ConstraintViolation {}
|
9917 9870 | impl ConstraintViolation {
|
9918 9871 | pub(crate) fn as_validation_exception_field(
|
9919 9872 | self,
|
9920 9873 | path: ::std::string::String,
|
9921 9874 | ) -> crate::model::ValidationExceptionField {
|
9922 9875 | match self {
|
9923 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
9924 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
9925 - | path,
|
9876 + | #[allow(unused_variables)]
|
9877 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
9878 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-d]{5}"#),
|
9879 + | path
|
9926 9880 | },
|
9927 9881 | }
|
9928 9882 | }
|
9929 9883 | }
|
9930 9884 | }
|
9931 - | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9932 - | pub(crate) mod sensitive_structure_internal {
|
9933 - |
|
9934 - | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
9935 - | fn from(builder: Builder) -> Self {
|
9936 - | builder.build()
|
9937 - | }
|
9938 - | }
|
9939 - | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9940 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
9941 - | pub(crate) struct Builder {}
|
9942 - | impl Builder {
|
9943 - | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9944 - | pub fn build(self) -> crate::model::SensitiveStructure {
|
9945 - | self.build_enforcing_all_constraints()
|
9946 - | }
|
9947 - | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
9948 - | crate::model::SensitiveStructure {}
|
9949 - | }
|
9950 - | }
|
9951 - | impl ::std::fmt::Debug for Builder {
|
9952 - | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
9953 - | let mut formatter = f.debug_struct("Builder");
|
9954 - | formatter.finish()
|
9955 - | }
|
9956 - | }
|
9957 - | }
|
9958 - | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9959 - | pub mod sensitive_structure {
|
9960 - |
|
9961 - | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
9962 - | fn from(builder: Builder) -> Self {
|
9963 - | builder.build()
|
9964 - | }
|
9965 - | }
|
9966 - | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9967 - | #[derive(::std::clone::Clone, ::std::default::Default)]
|
9968 - | pub struct Builder {}
|
9969 - | impl Builder {
|
9970 - | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
9971 - | pub fn build(self) -> crate::model::SensitiveStructure {
|
9972 - | self.build_enforcing_required_and_enum_traits()
|
9973 - | }
|
9974 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SensitiveStructure {
|
9975 - | crate::model::SensitiveStructure {}
|
9976 - | }
|
9977 - | }
|
9978 - | }
|
9979 - | pub(crate) mod length_list_internal {
|
9885 + | pub(crate) mod list_of_pattern_string_internal {
|
9980 9886 |
|
9981 9887 | #[allow(clippy::enum_variant_names)]
|
9982 9888 | #[derive(Debug, PartialEq)]
|
9983 9889 | pub(crate) enum ConstraintViolation {
|
9984 - | /// Constraint violation error when the list doesn't have the required length
|
9985 - | Length(usize),
|
9890 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9891 + | /// The first component of the tuple is the index in the collection where the
|
9892 + | /// first constraint violation was found.
|
9893 + | #[doc(hidden)]
|
9894 + | Member(
|
9895 + | usize,
|
9896 + | crate::model::pattern_string_internal::ConstraintViolation,
|
9897 + | ),
|
9986 9898 | }
|
9987 9899 |
|
9988 9900 | impl ::std::fmt::Display for ConstraintViolation {
|
9989 9901 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
9990 9902 | let message = match self {
|
9991 - | Self::Length(length) => {
|
9992 - | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthList' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
9993 - | }
|
9994 - | };
|
9995 - | write!(f, "{message}")
|
9996 - | }
|
9997 - | }
|
9998 - |
|
9999 - | impl ::std::error::Error for ConstraintViolation {}
|
10000 - | impl ConstraintViolation {
|
10001 - | pub(crate) fn as_validation_exception_field(
|
10002 - | self,
|
10003 - | path: ::std::string::String,
|
10004 - | ) -> crate::model::ValidationExceptionField {
|
10005 - | match self {
|
10006 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10007 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10008 - | path,
|
10009 - | },
|
10010 - | }
|
10011 - | }
|
10012 - | }
|
10013 - | }
|
10014 - | pub(crate) mod fixed_value_byte_internal {
|
10015 - |
|
10016 - | #[derive(Debug, PartialEq)]
|
10017 - | pub enum ConstraintViolation {
|
10018 - | Range(i8),
|
10019 - | }
|
10020 - |
|
10021 - | impl ::std::fmt::Display for ConstraintViolation {
|
10022 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10023 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueByte`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
9903 + | Self::Member(index, failing_member) => format!(
|
9904 + | "Value at index {index} failed to satisfy constraint. {}",
|
9905 + | failing_member
|
9906 + | ),
|
9907 + | };
|
9908 + | write!(f, "{message}")
|
10024 9909 | }
|
10025 9910 | }
|
10026 9911 |
|
10027 9912 | impl ::std::error::Error for ConstraintViolation {}
|
10028 9913 | impl ConstraintViolation {
|
10029 9914 | pub(crate) fn as_validation_exception_field(
|
10030 9915 | self,
|
10031 9916 | path: ::std::string::String,
|
10032 9917 | ) -> crate::model::ValidationExceptionField {
|
10033 9918 | match self {
|
10034 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10035 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10036 - | path,
|
10037 - | },
|
9919 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
9920 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10038 9921 | }
|
10039 9922 | }
|
10040 9923 | }
|
10041 9924 | }
|
10042 - | pub(crate) mod max_range_byte_internal {
|
9925 + | pub(crate) mod set_of_pattern_string_internal {
|
10043 9926 |
|
9927 + | #[allow(clippy::enum_variant_names)]
|
10044 9928 | #[derive(Debug, PartialEq)]
|
10045 - | pub enum ConstraintViolation {
|
10046 - | Range(i8),
|
9929 + | pub(crate) enum ConstraintViolation {
|
9930 + | /// Constraint violation error when the list does not contain unique items
|
9931 + | UniqueItems {
|
9932 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
9933 + | /// at least two elements.
|
9934 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
9935 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
9936 + | /// Nothing is guaranteed about the order of the indices.
|
9937 + | duplicate_indices: ::std::vec::Vec<usize>,
|
9938 + | /// The original vector, that contains duplicate items.
|
9939 + | original: ::std::vec::Vec<crate::model::PatternString>,
|
9940 + | },
|
9941 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
9942 + | /// The first component of the tuple is the index in the collection where the
|
9943 + | /// first constraint violation was found.
|
9944 + | #[doc(hidden)]
|
9945 + | Member(
|
9946 + | usize,
|
9947 + | crate::model::pattern_string_internal::ConstraintViolation,
|
9948 + | ),
|
10047 9949 | }
|
10048 9950 |
|
10049 9951 | impl ::std::fmt::Display for ConstraintViolation {
|
10050 9952 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10051 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeByte`failed to satisfy constraint: Member must be less than or equal to 11")
|
9953 + | let message = match self {
|
9954 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9955 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
9956 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
9957 + | failing_member)
|
9958 + | };
|
9959 + | write!(f, "{message}")
|
10052 9960 | }
|
10053 9961 | }
|
10054 9962 |
|
10055 9963 | impl ::std::error::Error for ConstraintViolation {}
|
10056 9964 | impl ConstraintViolation {
|
10057 9965 | pub(crate) fn as_validation_exception_field(
|
10058 9966 | self,
|
10059 9967 | path: ::std::string::String,
|
10060 9968 | ) -> crate::model::ValidationExceptionField {
|
10061 9969 | match self {
|
10062 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10063 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
9970 + | Self::UniqueItems { duplicate_indices, .. } =>
|
9971 + | crate::model::ValidationExceptionField {
|
9972 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10064 9973 | path,
|
10065 9974 | },
|
9975 + | Self::Member(index, member_constraint_violation) =>
|
9976 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
10066 9977 | }
|
10067 9978 | }
|
10068 9979 | }
|
10069 9980 | }
|
10070 - | pub(crate) mod min_range_byte_internal {
|
9981 + | pub(crate) mod length_pattern_string_internal {
|
10071 9982 |
|
10072 9983 | #[derive(Debug, PartialEq)]
|
10073 9984 | pub enum ConstraintViolation {
|
10074 - | Range(i8),
|
9985 + | /// Error when a string doesn't satisfy its `@length` requirements.
|
9986 + | Length(usize),
|
9987 + | /// Error when a string doesn't satisfy its `@pattern`.
|
9988 + | /// Contains the String that failed the pattern.
|
9989 + | Pattern(String),
|
10075 9990 | }
|
10076 9991 |
|
10077 9992 | impl ::std::fmt::Display for ConstraintViolation {
|
10078 9993 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10079 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeByte`failed to satisfy constraint: Member must be greater than or equal to -10")
|
9994 + | let message = match self {
|
9995 + | Self::Length(length) => {
|
9996 + | format!("Value with length {} provided for 'com.amazonaws.constraints#LengthPatternString' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length)
|
9997 + | }
|
9998 + | Self::Pattern(_) => {
|
9999 + | format!(
|
10000 + | r#"Value provided for `com.amazonaws.constraints#LengthPatternString` failed to satisfy the constraint: Member must match the regular expression pattern: {}"#,
|
10001 + | r#"[a-f0-5]*"#
|
10002 + | )
|
10003 + | }
|
10004 + | };
|
10005 + | write!(f, "{message}")
|
10080 10006 | }
|
10081 10007 | }
|
10082 10008 |
|
10083 10009 | impl ::std::error::Error for ConstraintViolation {}
|
10084 10010 | impl ConstraintViolation {
|
10085 10011 | pub(crate) fn as_validation_exception_field(
|
10086 10012 | self,
|
10087 10013 | path: ::std::string::String,
|
10088 10014 | ) -> crate::model::ValidationExceptionField {
|
10089 10015 | match self {
|
10090 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10091 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10016 + | Self::Length(length) => crate::model::ValidationExceptionField {
|
10017 + | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 5 and 10, inclusive", length, &path),
|
10092 10018 | path,
|
10093 10019 | },
|
10020 + |
|
10021 + | #[allow(unused_variables)]
|
10022 + | Self::Pattern(_) => crate::model::ValidationExceptionField {
|
10023 + | message: format!("Value at '{}' failed to satisfy constraint: Member must satisfy regular expression pattern: {}", &path, r#"[a-f0-5]*"#),
|
10024 + | path
|
10025 + | },
|
10094 10026 | }
|
10095 10027 | }
|
10096 10028 | }
|
10097 10029 | }
|
10098 - | pub(crate) mod fixed_value_long_internal {
|
10030 + | pub(crate) mod list_of_length_pattern_string_internal {
|
10099 10031 |
|
10032 + | #[allow(clippy::enum_variant_names)]
|
10100 10033 | #[derive(Debug, PartialEq)]
|
10101 - | pub enum ConstraintViolation {
|
10102 - | Range(i64),
|
10034 + | pub(crate) enum ConstraintViolation {
|
10035 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10036 + | /// The first component of the tuple is the index in the collection where the
|
10037 + | /// first constraint violation was found.
|
10038 + | #[doc(hidden)]
|
10039 + | Member(
|
10040 + | usize,
|
10041 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
10042 + | ),
|
10103 10043 | }
|
10104 10044 |
|
10105 10045 | impl ::std::fmt::Display for ConstraintViolation {
|
10106 10046 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10107 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueLong`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10047 + | let message = match self {
|
10048 + | Self::Member(index, failing_member) => format!(
|
10049 + | "Value at index {index} failed to satisfy constraint. {}",
|
10050 + | failing_member
|
10051 + | ),
|
10052 + | };
|
10053 + | write!(f, "{message}")
|
10108 10054 | }
|
10109 10055 | }
|
10110 10056 |
|
10111 10057 | impl ::std::error::Error for ConstraintViolation {}
|
10112 10058 | impl ConstraintViolation {
|
10113 10059 | pub(crate) fn as_validation_exception_field(
|
10114 10060 | self,
|
10115 10061 | path: ::std::string::String,
|
10116 10062 | ) -> crate::model::ValidationExceptionField {
|
10117 10063 | match self {
|
10118 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10119 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10120 - | path,
|
10121 - | },
|
10064 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10065 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10122 10066 | }
|
10123 10067 | }
|
10124 10068 | }
|
10125 10069 | }
|
10126 - | pub(crate) mod max_range_long_internal {
|
10070 + | pub(crate) mod set_of_length_pattern_string_internal {
|
10127 10071 |
|
10072 + | #[allow(clippy::enum_variant_names)]
|
10128 10073 | #[derive(Debug, PartialEq)]
|
10129 - | pub enum ConstraintViolation {
|
10130 - | Range(i64),
|
10074 + | pub(crate) enum ConstraintViolation {
|
10075 + | /// Constraint violation error when the list does not contain unique items
|
10076 + | UniqueItems {
|
10077 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10078 + | /// at least two elements.
|
10079 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10080 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10081 + | /// Nothing is guaranteed about the order of the indices.
|
10082 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10083 + | /// The original vector, that contains duplicate items.
|
10084 + | original: ::std::vec::Vec<crate::model::LengthPatternString>,
|
10085 + | },
|
10086 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10087 + | /// The first component of the tuple is the index in the collection where the
|
10088 + | /// first constraint violation was found.
|
10089 + | #[doc(hidden)]
|
10090 + | Member(
|
10091 + | usize,
|
10092 + | crate::model::length_pattern_string_internal::ConstraintViolation,
|
10093 + | ),
|
10131 10094 | }
|
10132 10095 |
|
10133 10096 | impl ::std::fmt::Display for ConstraintViolation {
|
10134 10097 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10135 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeLong`failed to satisfy constraint: Member must be less than or equal to 11")
|
10098 + | let message = match self {
|
10099 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10100 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#SetOfLengthPatternString' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10101 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
10102 + | failing_member)
|
10103 + | };
|
10104 + | write!(f, "{message}")
|
10136 10105 | }
|
10137 10106 | }
|
10138 10107 |
|
10139 10108 | impl ::std::error::Error for ConstraintViolation {}
|
10140 10109 | impl ConstraintViolation {
|
10141 10110 | pub(crate) fn as_validation_exception_field(
|
10142 10111 | self,
|
10143 10112 | path: ::std::string::String,
|
10144 10113 | ) -> crate::model::ValidationExceptionField {
|
10145 10114 | match self {
|
10146 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10147 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10115 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10116 + | crate::model::ValidationExceptionField {
|
10117 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10148 10118 | path,
|
10149 10119 | },
|
10120 + | Self::Member(index, member_constraint_violation) =>
|
10121 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
10150 10122 | }
|
10151 10123 | }
|
10152 10124 | }
|
10153 10125 | }
|
10154 - | pub(crate) mod min_range_long_internal {
|
10126 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
10127 + | pub mod validation_exception_field {
|
10155 10128 |
|
10156 - | #[derive(Debug, PartialEq)]
|
10129 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10130 + | /// Holds one variant for each of the ways the builder can fail.
|
10131 + | #[allow(clippy::enum_variant_names)]
|
10157 10132 | pub enum ConstraintViolation {
|
10158 - | Range(i64),
|
10133 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
10134 + | MissingPath,
|
10135 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
10136 + | MissingMessage,
|
10159 10137 | }
|
10160 - |
|
10161 10138 | impl ::std::fmt::Display for ConstraintViolation {
|
10162 10139 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10163 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeLong`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10140 + | match self {
|
10141 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
10142 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
10143 + | }
|
10164 10144 | }
|
10165 10145 | }
|
10166 - |
|
10167 10146 | impl ::std::error::Error for ConstraintViolation {}
|
10168 - | impl ConstraintViolation {
|
10169 - | pub(crate) fn as_validation_exception_field(
|
10170 - | self,
|
10171 - | path: ::std::string::String,
|
10172 - | ) -> crate::model::ValidationExceptionField {
|
10173 - | match self {
|
10174 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10175 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10176 - | path,
|
10177 - | },
|
10147 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
10148 + | type Error = ConstraintViolation;
|
10149 + |
|
10150 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
10151 + | builder.build()
|
10152 + | }
|
10153 + | }
|
10154 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
10155 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10156 + | pub struct Builder {
|
10157 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
10158 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
10159 + | }
|
10160 + | impl Builder {
|
10161 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
10162 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
10163 + | self.path = Some(input);
|
10164 + | self
|
10165 + | }
|
10166 + | /// A detailed description of the validation failure.
|
10167 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
10168 + | self.message = Some(input);
|
10169 + | self
|
10170 + | }
|
10171 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
10172 + | ///
|
10173 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
10174 + | ///
|
10175 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
10176 + | self.build_enforcing_required_and_enum_traits()
|
10178 10177 | }
|
10178 + | fn build_enforcing_required_and_enum_traits(
|
10179 + | self,
|
10180 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
10181 + | Ok(crate::model::ValidationExceptionField {
|
10182 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
10183 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
10184 + | })
|
10179 10185 | }
|
10180 10186 | }
|
10181 10187 | }
|
10182 - | pub(crate) mod fixed_value_short_internal {
|
10188 + | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10189 + | pub mod transitively_constrained_structure_in_output {
|
10183 10190 |
|
10184 - | #[derive(Debug, PartialEq)]
|
10185 - | pub enum ConstraintViolation {
|
10186 - | Range(i16),
|
10191 + | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
10192 + | fn from(builder: Builder) -> Self {
|
10193 + | builder.build()
|
10187 10194 | }
|
10188 - |
|
10189 - | impl ::std::fmt::Display for ConstraintViolation {
|
10190 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10191 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueShort`failed to satisfy constraint: Member must be between 10 and 10, inclusive")
|
10192 10195 | }
|
10196 + | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10197 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10198 + | pub struct Builder {
|
10199 + | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
10193 10200 | }
|
10194 - |
|
10195 - | impl ::std::error::Error for ConstraintViolation {}
|
10196 - | impl ConstraintViolation {
|
10197 - | pub(crate) fn as_validation_exception_field(
|
10201 + | impl Builder {
|
10202 + | #[allow(missing_docs)] // documentation missing in model
|
10203 + | pub fn length_string(
|
10204 + | mut self,
|
10205 + | input: ::std::option::Option<::std::string::String>,
|
10206 + | ) -> Self {
|
10207 + | self.length_string = input;
|
10208 + | self
|
10209 + | }
|
10210 + | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10211 + | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10212 + | self.build_enforcing_required_and_enum_traits()
|
10213 + | }
|
10214 + | fn build_enforcing_required_and_enum_traits(
|
10198 10215 | self,
|
10199 - | path: ::std::string::String,
|
10200 - | ) -> crate::model::ValidationExceptionField {
|
10201 - | match self {
|
10202 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10203 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 10 and 10, inclusive", &path),
|
10204 - | path,
|
10205 - | },
|
10216 + | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10217 + | crate::model::TransitivelyConstrainedStructureInOutput {
|
10218 + | length_string: self.length_string,
|
10206 10219 | }
|
10207 10220 | }
|
10208 10221 | }
|
10209 10222 | }
|
10210 - | pub(crate) mod max_range_short_internal {
|
10223 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10224 + | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
10211 10225 |
|
10212 - | #[derive(Debug, PartialEq)]
|
10213 - | pub enum ConstraintViolation {
|
10214 - | Range(i16),
|
10226 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
10227 + | /// Holds one variant for each of the ways the builder can fail.
|
10228 + | #[non_exhaustive]
|
10229 + | #[allow(clippy::enum_variant_names)]
|
10230 + | pub(crate) enum ConstraintViolation {
|
10231 + | /// Constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`.
|
10232 + | #[doc(hidden)]
|
10233 + | RecursiveMember(
|
10234 + | crate::model::recursive_shapes_input_output_nested1_internal::ConstraintViolation,
|
10235 + | ),
|
10215 10236 | }
|
10216 - |
|
10217 10237 | impl ::std::fmt::Display for ConstraintViolation {
|
10218 10238 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10219 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeShort`failed to satisfy constraint: Member must be less than or equal to 11")
|
10239 + | match self {
|
10240 + | ConstraintViolation::RecursiveMember(_) => write!(f, "constraint violation occurred building member `recursive_member` when building `RecursiveShapesInputOutputNested2`"),
|
10241 + | }
|
10220 10242 | }
|
10221 10243 | }
|
10222 - |
|
10223 10244 | impl ::std::error::Error for ConstraintViolation {}
|
10224 10245 | impl ConstraintViolation {
|
10225 10246 | pub(crate) fn as_validation_exception_field(
|
10226 10247 | self,
|
10227 10248 | path: ::std::string::String,
|
10228 10249 | ) -> crate::model::ValidationExceptionField {
|
10229 10250 | match self {
|
10230 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10231 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 11", &path),
|
10232 - | path,
|
10233 - | },
|
10251 + | ConstraintViolation::RecursiveMember(inner) => {
|
10252 + | inner.as_validation_exception_field(path + "/recursiveMember")
|
10234 10253 | }
|
10235 10254 | }
|
10236 10255 | }
|
10237 - | }
|
10238 - | pub(crate) mod min_range_short_internal {
|
10239 - |
|
10240 - | #[derive(Debug, PartialEq)]
|
10241 - | pub enum ConstraintViolation {
|
10242 - | Range(i16),
|
10243 10256 | }
|
10244 - |
|
10245 - | impl ::std::fmt::Display for ConstraintViolation {
|
10246 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10247 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeShort`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10257 + | impl ::std::convert::From<Builder>
|
10258 + | for crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested2>
|
10259 + | {
|
10260 + | fn from(builder: Builder) -> Self {
|
10261 + | Self::Unconstrained(builder)
|
10248 10262 | }
|
10249 10263 | }
|
10264 + | impl ::std::convert::TryFrom<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
10265 + | type Error = ConstraintViolation;
|
10250 10266 |
|
10251 - | impl ::std::error::Error for ConstraintViolation {}
|
10252 - | impl ConstraintViolation {
|
10253 - | pub(crate) fn as_validation_exception_field(
|
10254 - | self,
|
10255 - | path: ::std::string::String,
|
10256 - | ) -> crate::model::ValidationExceptionField {
|
10257 - | match self {
|
10258 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10259 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10260 - | path,
|
10261 - | },
|
10262 - | }
|
10263 - | }
|
10267 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
10268 + | builder.build()
|
10264 10269 | }
|
10265 - | }
|
10266 - | pub(crate) mod fixed_value_integer_internal {
|
10267 - |
|
10268 - | #[derive(Debug, PartialEq)]
|
10269 - | pub enum ConstraintViolation {
|
10270 - | Range(i32),
|
10271 10270 | }
|
10272 - |
|
10273 - | impl ::std::fmt::Display for ConstraintViolation {
|
10274 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10275 - | write!(f, "Value for `com.amazonaws.constraints#FixedValueInteger`failed to satisfy constraint: Member must be between 69 and 69, inclusive")
|
10271 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10272 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10273 + | pub(crate) struct Builder {
|
10274 + | pub(crate) recursive_member: ::std::option::Option<
|
10275 + | crate::constrained::MaybeConstrained<crate::model::RecursiveShapesInputOutputNested1>,
|
10276 + | >,
|
10276 10277 | }
|
10278 + | impl Builder {
|
10279 + | #[allow(missing_docs)] // documentation missing in model
|
10280 + | pub(crate) fn set_recursive_member(
|
10281 + | mut self,
|
10282 + | input: Option<
|
10283 + | impl ::std::convert::Into<
|
10284 + | crate::constrained::MaybeConstrained<
|
10285 + | crate::model::RecursiveShapesInputOutputNested1,
|
10286 + | >,
|
10287 + | >,
|
10288 + | >,
|
10289 + | ) -> Self {
|
10290 + | self.recursive_member = input.map(|v| v.into());
|
10291 + | self
|
10277 10292 | }
|
10278 - |
|
10279 - | impl ::std::error::Error for ConstraintViolation {}
|
10280 - | impl ConstraintViolation {
|
10281 - | pub(crate) fn as_validation_exception_field(
|
10293 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10294 + | ///
|
10295 + | /// The builder fails to construct a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2) if a [`ConstraintViolation`] occurs.
|
10296 + | ///
|
10297 + | pub fn build(
|
10282 10298 | self,
|
10283 - | path: ::std::string::String,
|
10284 - | ) -> crate::model::ValidationExceptionField {
|
10285 - | match self {
|
10286 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10287 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be between 69 and 69, inclusive", &path),
|
10288 - | path,
|
10289 - | },
|
10299 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
10300 + | self.build_enforcing_all_constraints()
|
10290 10301 | }
|
10302 + | fn build_enforcing_all_constraints(
|
10303 + | self,
|
10304 + | ) -> Result<crate::model::RecursiveShapesInputOutputNested2, ConstraintViolation> {
|
10305 + | Ok(crate::model::RecursiveShapesInputOutputNested2 {
|
10306 + | recursive_member: self
|
10307 + | .recursive_member
|
10308 + | .map(|v| match v {
|
10309 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
10310 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
10311 + | })
|
10312 + | .map(|res| res.map_err(ConstraintViolation::RecursiveMember))
|
10313 + | .transpose()?,
|
10314 + | })
|
10291 10315 | }
|
10292 10316 | }
|
10293 10317 | }
|
10294 - | pub(crate) mod max_range_integer_internal {
|
10318 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10319 + | pub mod recursive_shapes_input_output_nested2 {
|
10295 10320 |
|
10296 - | #[derive(Debug, PartialEq)]
|
10297 - | pub enum ConstraintViolation {
|
10298 - | Range(i32),
|
10321 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
10322 + | fn from(builder: Builder) -> Self {
|
10323 + | builder.build()
|
10299 10324 | }
|
10300 - |
|
10301 - | impl ::std::fmt::Display for ConstraintViolation {
|
10302 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10303 - | write!(f, "Value for `com.amazonaws.constraints#MaxRangeInteger`failed to satisfy constraint: Member must be less than or equal to 69")
|
10304 10325 | }
|
10326 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10327 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10328 + | pub struct Builder {
|
10329 + | pub(crate) recursive_member:
|
10330 + | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
10305 10331 | }
|
10306 - |
|
10307 - | impl ::std::error::Error for ConstraintViolation {}
|
10308 - | impl ConstraintViolation {
|
10309 - | pub(crate) fn as_validation_exception_field(
|
10332 + | impl Builder {
|
10333 + | #[allow(missing_docs)] // documentation missing in model
|
10334 + | pub fn recursive_member(
|
10335 + | mut self,
|
10336 + | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
10337 + | ) -> Self {
|
10338 + | self.recursive_member = input;
|
10339 + | self
|
10340 + | }
|
10341 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
10342 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
10343 + | self.build_enforcing_required_and_enum_traits()
|
10344 + | }
|
10345 + | fn build_enforcing_required_and_enum_traits(
|
10310 10346 | self,
|
10311 - | path: ::std::string::String,
|
10312 - | ) -> crate::model::ValidationExceptionField {
|
10313 - | match self {
|
10314 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10315 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be less than or equal to 69", &path),
|
10316 - | path,
|
10317 - | },
|
10347 + | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
10348 + | crate::model::RecursiveShapesInputOutputNested2 {
|
10349 + | recursive_member: self.recursive_member,
|
10318 10350 | }
|
10319 10351 | }
|
10320 10352 | }
|
10321 10353 | }
|
10322 - | pub(crate) mod min_range_integer_internal {
|
10354 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10355 + | pub(crate) mod event_stream_regular_message_internal {
|
10323 10356 |
|
10324 - | #[derive(Debug, PartialEq)]
|
10325 - | pub enum ConstraintViolation {
|
10326 - | Range(i32),
|
10357 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
10358 + | fn from(builder: Builder) -> Self {
|
10359 + | builder.build()
|
10327 10360 | }
|
10328 - |
|
10329 - | impl ::std::fmt::Display for ConstraintViolation {
|
10330 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10331 - | write!(f, "Value for `com.amazonaws.constraints#MinRangeInteger`failed to satisfy constraint: Member must be greater than or equal to -10")
|
10332 10361 | }
|
10362 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10363 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10364 + | pub(crate) struct Builder {
|
10365 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
10333 10366 | }
|
10334 - |
|
10335 - | impl ::std::error::Error for ConstraintViolation {}
|
10336 - | impl ConstraintViolation {
|
10337 - | pub(crate) fn as_validation_exception_field(
|
10338 - | self,
|
10339 - | path: ::std::string::String,
|
10340 - | ) -> crate::model::ValidationExceptionField {
|
10341 - | match self {
|
10342 - | Self::Range(_) => crate::model::ValidationExceptionField {
|
10343 - | message: format!("Value at '{}' failed to satisfy constraint: Member must be greater than or equal to -10", &path),
|
10344 - | path,
|
10345 - | },
|
10367 + | impl Builder {
|
10368 + | #[allow(missing_docs)] // documentation missing in model
|
10369 + | pub(crate) fn set_message_content(
|
10370 + | mut self,
|
10371 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
10372 + | ) -> Self {
|
10373 + | self.message_content = input.map(|v| v.into());
|
10374 + | self
|
10375 + | }
|
10376 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10377 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
10378 + | self.build_enforcing_all_constraints()
|
10379 + | }
|
10380 + | fn build_enforcing_all_constraints(self) -> crate::model::EventStreamRegularMessage {
|
10381 + | crate::model::EventStreamRegularMessage {
|
10382 + | message_content: self.message_content,
|
10346 10383 | }
|
10347 10384 | }
|
10348 10385 | }
|
10349 10386 | }
|
10350 - | pub(crate) mod fixed_length_blob_internal {
|
10387 + | /// See [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10388 + | pub mod event_stream_regular_message {
|
10351 10389 |
|
10352 - | #[derive(Debug, PartialEq)]
|
10353 - | pub enum ConstraintViolation {
|
10354 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10355 - | Length(usize),
|
10390 + | impl ::std::convert::From<Builder> for crate::model::EventStreamRegularMessage {
|
10391 + | fn from(builder: Builder) -> Self {
|
10392 + | builder.build()
|
10356 10393 | }
|
10357 - |
|
10358 - | impl ::std::fmt::Display for ConstraintViolation {
|
10359 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10360 - | let message = match self {
|
10361 - | Self::Length(length) => {
|
10362 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthBlob' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length)
|
10363 10394 | }
|
10364 - | };
|
10365 - | write!(f, "{message}")
|
10395 + | /// A builder for [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10396 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10397 + | pub struct Builder {
|
10398 + | pub(crate) message_content: ::std::option::Option<::std::string::String>,
|
10366 10399 | }
|
10400 + | impl Builder {
|
10401 + | #[allow(missing_docs)] // documentation missing in model
|
10402 + | pub fn message_content(
|
10403 + | mut self,
|
10404 + | input: ::std::option::Option<::std::string::String>,
|
10405 + | ) -> Self {
|
10406 + | self.message_content = input;
|
10407 + | self
|
10367 10408 | }
|
10368 - |
|
10369 - | impl ::std::error::Error for ConstraintViolation {}
|
10370 - | impl ConstraintViolation {
|
10371 - | pub(crate) fn as_validation_exception_field(
|
10372 - | self,
|
10373 - | path: ::std::string::String,
|
10374 - | ) -> crate::model::ValidationExceptionField {
|
10375 - | match self {
|
10376 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10377 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 70 and 70, inclusive", length, &path),
|
10378 - | path,
|
10379 - | },
|
10409 + | /// Consumes the builder and constructs a [`EventStreamRegularMessage`](crate::model::EventStreamRegularMessage).
|
10410 + | pub fn build(self) -> crate::model::EventStreamRegularMessage {
|
10411 + | self.build_enforcing_required_and_enum_traits()
|
10412 + | }
|
10413 + | fn build_enforcing_required_and_enum_traits(
|
10414 + | self,
|
10415 + | ) -> crate::model::EventStreamRegularMessage {
|
10416 + | crate::model::EventStreamRegularMessage {
|
10417 + | message_content: self.message_content,
|
10380 10418 | }
|
10381 10419 | }
|
10382 10420 | }
|
10383 10421 | }
|
10384 - | pub(crate) mod max_length_blob_internal {
|
10422 + | pub(crate) mod con_b_list_inner_internal {
|
10385 10423 |
|
10424 + | #[allow(clippy::enum_variant_names)]
|
10386 10425 | #[derive(Debug, PartialEq)]
|
10387 - | pub enum ConstraintViolation {
|
10388 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10389 - | Length(usize),
|
10426 + | pub(crate) enum ConstraintViolation {
|
10427 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
10428 + | /// The first component of the tuple is the index in the collection where the
|
10429 + | /// first constraint violation was found.
|
10430 + | #[doc(hidden)]
|
10431 + | Member(usize, crate::model::con_b_internal::ConstraintViolation),
|
10390 10432 | }
|
10391 10433 |
|
10392 10434 | impl ::std::fmt::Display for ConstraintViolation {
|
10393 10435 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10394 10436 | let message = match self {
|
10395 - | Self::Length(length) => {
|
10396 - | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthBlob' failed to satisfy constraint: Member must have length less than or equal to 70", length)
|
10397 - | }
|
10437 + | Self::Member(index, failing_member) => format!(
|
10438 + | "Value at index {index} failed to satisfy constraint. {}",
|
10439 + | failing_member
|
10440 + | ),
|
10398 10441 | };
|
10399 10442 | write!(f, "{message}")
|
10400 10443 | }
|
10401 10444 | }
|
10402 10445 |
|
10403 10446 | impl ::std::error::Error for ConstraintViolation {}
|
10404 10447 | impl ConstraintViolation {
|
10405 10448 | pub(crate) fn as_validation_exception_field(
|
10406 10449 | self,
|
10407 10450 | path: ::std::string::String,
|
10408 10451 | ) -> crate::model::ValidationExceptionField {
|
10409 10452 | match self {
|
10410 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10411 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 70", length, &path),
|
10412 - | path,
|
10413 - | },
|
10453 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
10454 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
10414 10455 | }
|
10415 10456 | }
|
10416 10457 | }
|
10417 10458 | }
|
10418 - | pub(crate) mod min_length_blob_internal {
|
10459 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10460 + | pub(crate) mod sensitive_structure_internal {
|
10419 10461 |
|
10420 - | #[derive(Debug, PartialEq)]
|
10421 - | pub enum ConstraintViolation {
|
10422 - | /// Error when a blob doesn't satisfy its `@length` requirements.
|
10423 - | Length(usize),
|
10462 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
10463 + | fn from(builder: Builder) -> Self {
|
10464 + | builder.build()
|
10424 10465 | }
|
10425 - |
|
10426 - | impl ::std::fmt::Display for ConstraintViolation {
|
10427 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10428 - | let message = match self {
|
10429 - | Self::Length(length) => {
|
10430 - | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthBlob' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
10431 10466 | }
|
10432 - | };
|
10433 - | write!(f, "{message}")
|
10467 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10468 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
10469 + | pub(crate) struct Builder {}
|
10470 + | impl Builder {
|
10471 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10472 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
10473 + | self.build_enforcing_all_constraints()
|
10474 + | }
|
10475 + | fn build_enforcing_all_constraints(self) -> crate::model::SensitiveStructure {
|
10476 + | crate::model::SensitiveStructure {}
|
10477 + | }
|
10478 + | }
|
10479 + | impl ::std::fmt::Debug for Builder {
|
10480 + | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
|
10481 + | let mut formatter = f.debug_struct("Builder");
|
10482 + | formatter.finish()
|
10434 10483 | }
|
10435 10484 | }
|
10485 + | }
|
10486 + | /// See [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10487 + | pub mod sensitive_structure {
|
10436 10488 |
|
10437 - | impl ::std::error::Error for ConstraintViolation {}
|
10438 - | impl ConstraintViolation {
|
10439 - | pub(crate) fn as_validation_exception_field(
|
10440 - | self,
|
10441 - | path: ::std::string::String,
|
10442 - | ) -> crate::model::ValidationExceptionField {
|
10443 - | match self {
|
10444 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10445 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10446 - | path,
|
10447 - | },
|
10489 + | impl ::std::convert::From<Builder> for crate::model::SensitiveStructure {
|
10490 + | fn from(builder: Builder) -> Self {
|
10491 + | builder.build()
|
10492 + | }
|
10493 + | }
|
10494 + | /// A builder for [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10495 + | #[derive(::std::clone::Clone, ::std::default::Default)]
|
10496 + | pub struct Builder {}
|
10497 + | impl Builder {
|
10498 + | /// Consumes the builder and constructs a [`SensitiveStructure`](crate::model::SensitiveStructure).
|
10499 + | pub fn build(self) -> crate::model::SensitiveStructure {
|
10500 + | self.build_enforcing_required_and_enum_traits()
|
10448 10501 | }
|
10502 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SensitiveStructure {
|
10503 + | crate::model::SensitiveStructure {}
|
10449 10504 | }
|
10450 10505 | }
|
10451 10506 | }
|
10452 - | pub(crate) mod fixed_length_string_internal {
|
10507 + | pub(crate) mod con_b_set_inner_internal {
|
10453 10508 |
|
10509 + | #[allow(clippy::enum_variant_names)]
|
10454 10510 | #[derive(Debug, PartialEq)]
|
10455 - | pub enum ConstraintViolation {
|
10456 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10457 - | Length(usize),
|
10511 + | pub(crate) enum ConstraintViolation {
|
10512 + | /// Constraint violation error when the list does not contain unique items
|
10513 + | UniqueItems {
|
10514 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10515 + | /// at least two elements.
|
10516 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10517 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10518 + | /// Nothing is guaranteed about the order of the indices.
|
10519 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10520 + | /// The original vector, that contains duplicate items.
|
10521 + | original: ::std::vec::Vec<::std::string::String>,
|
10522 + | },
|
10458 10523 | }
|
10459 10524 |
|
10460 10525 | impl ::std::fmt::Display for ConstraintViolation {
|
10461 10526 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10462 10527 | let message = match self {
|
10463 - | Self::Length(length) => {
|
10464 - | format!("Value with length {} provided for 'com.amazonaws.constraints#FixedLengthString' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length)
|
10465 - | }
|
10528 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10529 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#ConBSetInner' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10466 10530 | };
|
10467 10531 | write!(f, "{message}")
|
10468 10532 | }
|
10469 10533 | }
|
10470 10534 |
|
10471 10535 | impl ::std::error::Error for ConstraintViolation {}
|
10472 10536 | impl ConstraintViolation {
|
10473 10537 | pub(crate) fn as_validation_exception_field(
|
10474 10538 | self,
|
10475 10539 | path: ::std::string::String,
|
10476 10540 | ) -> crate::model::ValidationExceptionField {
|
10477 10541 | match self {
|
10478 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10479 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length between 69 and 69, inclusive", length, &path),
|
10542 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10543 + | crate::model::ValidationExceptionField {
|
10544 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10480 10545 | path,
|
10481 10546 | },
|
10482 10547 | }
|
10483 10548 | }
|
10484 10549 | }
|
10485 10550 | }
|
10486 - | pub(crate) mod max_length_string_internal {
|
10551 + | pub(crate) mod map_of_list_of_list_of_con_b_internal {
|
10487 10552 |
|
10553 + | #[allow(clippy::enum_variant_names)]
|
10488 10554 | #[derive(Debug, PartialEq)]
|
10489 - | pub enum ConstraintViolation {
|
10490 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10491 - | Length(usize),
|
10555 + | pub(crate) enum ConstraintViolation {
|
10556 + | #[doc(hidden)]
|
10557 + | Value(
|
10558 + | ::std::string::String,
|
10559 + | crate::model::con_b_list_internal::ConstraintViolation,
|
10560 + | ),
|
10492 10561 | }
|
10493 10562 |
|
10494 10563 | impl ::std::fmt::Display for ConstraintViolation {
|
10495 10564 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10496 - | let message = match self {
|
10497 - | Self::Length(length) => {
|
10498 - | format!("Value with length {} provided for 'com.amazonaws.constraints#MaxLengthString' failed to satisfy constraint: Member must have length less than or equal to 69", length)
|
10565 + | match self {
|
10566 + | Self::Value(_, value_constraint_violation) => {
|
10567 + | write!(f, "{}", value_constraint_violation)
|
10568 + | }
|
10499 10569 | }
|
10500 - | };
|
10501 - | write!(f, "{message}")
|
10502 10570 | }
|
10503 10571 | }
|
10504 10572 |
|
10505 10573 | impl ::std::error::Error for ConstraintViolation {}
|
10506 10574 | impl ConstraintViolation {
|
10507 10575 | pub(crate) fn as_validation_exception_field(
|
10508 10576 | self,
|
10509 10577 | path: ::std::string::String,
|
10510 10578 | ) -> crate::model::ValidationExceptionField {
|
10511 10579 | match self {
|
10512 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10513 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length less than or equal to 69", length, &path),
|
10514 - | path,
|
10515 - | },
|
10580 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
10581 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
10516 10582 | }
|
10517 10583 | }
|
10518 10584 | }
|
10519 10585 | }
|
10520 - | pub(crate) mod min_length_string_internal {
|
10586 + | pub(crate) mod unique_items_list_internal {
|
10521 10587 |
|
10588 + | #[allow(clippy::enum_variant_names)]
|
10522 10589 | #[derive(Debug, PartialEq)]
|
10523 - | pub enum ConstraintViolation {
|
10524 - | /// Error when a string doesn't satisfy its `@length` requirements.
|
10525 - | Length(usize),
|
10590 + | pub(crate) enum ConstraintViolation {
|
10591 + | /// Constraint violation error when the list does not contain unique items
|
10592 + | UniqueItems {
|
10593 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
10594 + | /// at least two elements.
|
10595 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
10596 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
10597 + | /// Nothing is guaranteed about the order of the indices.
|
10598 + | duplicate_indices: ::std::vec::Vec<usize>,
|
10599 + | /// The original vector, that contains duplicate items.
|
10600 + | original: ::std::vec::Vec<::std::string::String>,
|
10601 + | },
|
10526 10602 | }
|
10527 10603 |
|
10528 10604 | impl ::std::fmt::Display for ConstraintViolation {
|
10529 10605 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10530 10606 | let message = match self {
|
10531 - | Self::Length(length) => {
|
10532 - | format!("Value with length {} provided for 'com.amazonaws.constraints#MinLengthString' failed to satisfy constraint: Member must have length greater than or equal to 2", length)
|
10533 - | }
|
10607 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10608 + | format!("Value with repeated values at indices {:?} provided for 'com.amazonaws.constraints#UniqueItemsList' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
10534 10609 | };
|
10535 10610 | write!(f, "{message}")
|
10536 10611 | }
|
10537 10612 | }
|
10538 10613 |
|
10539 10614 | impl ::std::error::Error for ConstraintViolation {}
|
10540 10615 | impl ConstraintViolation {
|
10541 10616 | pub(crate) fn as_validation_exception_field(
|
10542 10617 | self,
|
10543 10618 | path: ::std::string::String,
|
10544 10619 | ) -> crate::model::ValidationExceptionField {
|
10545 10620 | match self {
|
10546 - | Self::Length(length) => crate::model::ValidationExceptionField {
|
10547 - | message: format!("Value with length {} at '{}' failed to satisfy constraint: Member must have length greater than or equal to 2", length, &path),
|
10621 + | Self::UniqueItems { duplicate_indices, .. } =>
|
10622 + | crate::model::ValidationExceptionField {
|
10623 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
10548 10624 | path,
|
10549 10625 | },
|
10550 10626 | }
|
10551 10627 | }
|
10552 10628 | }
|
10553 10629 | }
|
10554 - | /// See [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10555 - | pub mod transitively_constrained_structure_in_output {
|
10556 - |
|
10557 - | impl ::std::convert::From<Builder> for crate::model::TransitivelyConstrainedStructureInOutput {
|
10558 - | fn from(builder: Builder) -> Self {
|
10559 - | builder.build()
|
10560 - | }
|
10561 - | }
|
10562 - | /// A builder for [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10563 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
10564 - | pub struct Builder {
|
10565 - | pub(crate) length_string: ::std::option::Option<::std::string::String>,
|
10566 - | }
|
10567 - | impl Builder {
|
10568 - | #[allow(missing_docs)] // documentation missing in model
|
10569 - | pub fn length_string(
|
10570 - | mut self,
|
10571 - | input: ::std::option::Option<::std::string::String>,
|
10572 - | ) -> Self {
|
10573 - | self.length_string = input;
|
10574 - | self
|
10575 - | }
|
10576 - | /// Consumes the builder and constructs a [`TransitivelyConstrainedStructureInOutput`](crate::model::TransitivelyConstrainedStructureInOutput).
|
10577 - | pub fn build(self) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10578 - | self.build_enforcing_required_and_enum_traits()
|
10579 - | }
|
10580 - | fn build_enforcing_required_and_enum_traits(
|
10581 - | self,
|
10582 - | ) -> crate::model::TransitivelyConstrainedStructureInOutput {
|
10583 - | crate::model::TransitivelyConstrainedStructureInOutput {
|
10584 - | length_string: self.length_string,
|
10585 - | }
|
10586 - | }
|
10587 - | }
|
10588 - | }
|
10589 - | pub(crate) mod constrained_map_in_output_internal {
|
10590 - |
|
10591 - | #[allow(clippy::enum_variant_names)]
|
10592 - | #[derive(Debug, PartialEq)]
|
10593 - | pub(crate) enum ConstraintViolation {
|
10594 - | Length(usize),
|
10595 - | }
|
10596 - |
|
10597 - | impl ::std::fmt::Display for ConstraintViolation {
|
10598 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10599 - | match self {
|
10600 - | Self::Length(length) => {
|
10601 - | write!(f, "Value with length {} provided for 'com.amazonaws.constraints#ConstrainedMapInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
10602 - | }
|
10603 - | }
|
10604 - | }
|
10605 - | }
|
10606 - |
|
10607 - | impl ::std::error::Error for ConstraintViolation {}
|
10608 - | }
|
10609 - | pub(crate) mod constrained_list_in_output_internal {
|
10610 - |
|
10611 - | #[allow(clippy::enum_variant_names)]
|
10612 - | #[derive(Debug, PartialEq)]
|
10613 - | pub(crate) enum ConstraintViolation {
|
10614 - | /// Constraint violation error when the list doesn't have the required length
|
10615 - | Length(usize),
|
10616 - | }
|
10617 - |
|
10618 - | impl ::std::fmt::Display for ConstraintViolation {
|
10619 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
10620 - | let message = match self {
|
10621 - | Self::Length(length) => {
|
10622 - | format!("Value with length {} provided for 'com.amazonaws.constraints#ConstrainedListInOutput' failed to satisfy constraint: Member must have length greater than or equal to 69", length)
|
10623 - | }
|
10624 - | };
|
10625 - | write!(f, "{message}")
|
10626 - | }
|
10627 - | }
|
10628 - |
|
10629 - | impl ::std::error::Error for ConstraintViolation {}
|
10630 - | }
|