1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[allow(missing_docs)] // documentation missing in model
|
3 - | #[derive(
|
4 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5 - | )]
|
6 - | pub struct PayloadConfig {
|
7 - | #[allow(missing_docs)] // documentation missing in model
|
8 - | pub data: ::std::option::Option<i32>,
|
9 - | }
|
10 - | impl PayloadConfig {
|
11 - | #[allow(missing_docs)] // documentation missing in model
|
12 - | pub fn data(&self) -> ::std::option::Option<i32> {
|
13 - | self.data
|
14 - | }
|
15 - | }
|
16 - | impl PayloadConfig {
|
17 - | /// Creates a new builder-style object to manufacture [`PayloadConfig`](crate::model::PayloadConfig).
|
18 - | pub fn builder() -> crate::model::payload_config::Builder {
|
19 - | crate::model::payload_config::Builder::default()
|
20 - | }
|
21 - | }
|
22 - | impl crate::constrained::Constrained for crate::model::PayloadConfig {
|
23 - | type Unconstrained = crate::model::payload_config::Builder;
|
24 - | }
|
25 - |
|
26 - | #[allow(missing_docs)] // documentation missing in model
|
27 - | #[derive(
|
28 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
29 - | )]
|
30 - | pub struct TestConfig {
|
31 - | #[allow(missing_docs)] // documentation missing in model
|
32 - | pub timeout: ::std::option::Option<i32>,
|
33 - | }
|
34 - | impl TestConfig {
|
35 - | #[allow(missing_docs)] // documentation missing in model
|
36 - | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
37 - | self.timeout
|
38 - | }
|
39 - | }
|
40 - | impl TestConfig {
|
41 - | /// Creates a new builder-style object to manufacture [`TestConfig`](crate::model::TestConfig).
|
42 - | pub fn builder() -> crate::model::test_config::Builder {
|
43 - | crate::model::test_config::Builder::default()
|
44 - | }
|
45 - | }
|
46 - | impl crate::constrained::Constrained for crate::model::TestConfig {
|
47 - | type Unconstrained = crate::model::test_config::Builder;
|
48 - | }
|
49 2 |
|
50 3 | /// Describes one specific validation failure for an input member.
|
51 4 | #[derive(
|
52 5 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
53 6 | )]
|
54 7 | pub struct ValidationExceptionField {
|
55 8 | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
56 9 | pub path: ::std::string::String,
|
57 10 | /// A detailed description of the validation failure.
|
58 11 | pub message: ::std::string::String,
|
59 12 | }
|
60 13 | impl ValidationExceptionField {
|
61 14 | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
62 15 | pub fn path(&self) -> &str {
|
63 16 | use std::ops::Deref;
|
64 17 | self.path.deref()
|
65 18 | }
|
66 19 | /// A detailed description of the validation failure.
|
67 20 | pub fn message(&self) -> &str {
|
68 21 | use std::ops::Deref;
|
69 22 | self.message.deref()
|
70 23 | }
|
71 24 | }
|
72 25 | impl ValidationExceptionField {
|
73 26 | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
74 27 | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
75 28 | crate::model::validation_exception_field::Builder::default()
|
76 29 | }
|
77 30 | }
|
78 31 |
|
79 32 | #[allow(missing_docs)] // documentation missing in model
|
80 33 | #[derive(
|
81 34 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
82 35 | )]
|
83 - | pub enum SimpleUnion {
|
36 + | pub struct Dialog {
|
84 37 | #[allow(missing_docs)] // documentation missing in model
|
85 - | Int(i32),
|
38 + | pub language: ::std::option::Option<::std::string::String>,
|
86 39 | #[allow(missing_docs)] // documentation missing in model
|
87 - | String(::std::string::String),
|
40 + | pub greeting: ::std::string::String,
|
41 + | #[allow(missing_docs)] // documentation missing in model
|
42 + | pub farewell: ::std::option::Option<crate::model::Farewell>,
|
88 43 | }
|
89 - | impl SimpleUnion {
|
90 - | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
91 - | /// Returns `Err(&Self)` if it can't be converted.
|
92 - | pub fn as_int(&self) -> ::std::result::Result<&i32, &Self> {
|
93 - | if let SimpleUnion::Int(val) = &self {
|
94 - | ::std::result::Result::Ok(val)
|
95 - | } else {
|
96 - | ::std::result::Result::Err(self)
|
97 - | }
|
44 + | impl Dialog {
|
45 + | #[allow(missing_docs)] // documentation missing in model
|
46 + | pub fn language(&self) -> ::std::option::Option<&str> {
|
47 + | self.language.as_deref()
|
98 48 | }
|
99 - | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
100 - | pub fn is_int(&self) -> bool {
|
101 - | self.as_int().is_ok()
|
49 + | #[allow(missing_docs)] // documentation missing in model
|
50 + | pub fn greeting(&self) -> &str {
|
51 + | use std::ops::Deref;
|
52 + | self.greeting.deref()
|
102 53 | }
|
103 - | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
104 - | /// Returns `Err(&Self)` if it can't be converted.
|
105 - | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
106 - | if let SimpleUnion::String(val) = &self {
|
107 - | ::std::result::Result::Ok(val)
|
108 - | } else {
|
109 - | ::std::result::Result::Err(self)
|
110 - | }
|
54 + | #[allow(missing_docs)] // documentation missing in model
|
55 + | pub fn farewell(&self) -> ::std::option::Option<&crate::model::Farewell> {
|
56 + | self.farewell.as_ref()
|
111 57 | }
|
112 - | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
113 - | pub fn is_string(&self) -> bool {
|
114 - | self.as_string().is_ok()
|
58 + | }
|
59 + | impl Dialog {
|
60 + | /// Creates a new builder-style object to manufacture [`Dialog`](crate::model::Dialog).
|
61 + | pub fn builder() -> crate::model::dialog::Builder {
|
62 + | crate::model::dialog::Builder::default()
|
115 63 | }
|
116 64 | }
|
65 + | impl crate::constrained::Constrained for crate::model::Dialog {
|
66 + | type Unconstrained = crate::model::dialog::Builder;
|
67 + | }
|
117 68 |
|
118 69 | #[allow(missing_docs)] // documentation missing in model
|
119 70 | #[derive(
|
120 71 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
121 72 | )]
|
122 - | pub enum UnionWithJsonName {
|
123 - | #[allow(missing_docs)] // documentation missing in model
|
124 - | Bar(::std::string::String),
|
125 - | #[allow(missing_docs)] // documentation missing in model
|
126 - | Baz(::std::string::String),
|
73 + | pub struct Farewell {
|
127 74 | #[allow(missing_docs)] // documentation missing in model
|
128 - | Foo(::std::string::String),
|
75 + | pub phrase: ::std::string::String,
|
129 76 | }
|
130 - | impl UnionWithJsonName {
|
131 - | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
132 - | /// Returns `Err(&Self)` if it can't be converted.
|
133 - | pub fn as_bar(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
134 - | if let UnionWithJsonName::Bar(val) = &self {
|
135 - | ::std::result::Result::Ok(val)
|
136 - | } else {
|
137 - | ::std::result::Result::Err(self)
|
138 - | }
|
77 + | impl Farewell {
|
78 + | #[allow(missing_docs)] // documentation missing in model
|
79 + | pub fn phrase(&self) -> &str {
|
80 + | use std::ops::Deref;
|
81 + | self.phrase.deref()
|
139 82 | }
|
140 - | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
141 - | pub fn is_bar(&self) -> bool {
|
142 - | self.as_bar().is_ok()
|
83 + | }
|
84 + | impl Farewell {
|
85 + | /// Creates a new builder-style object to manufacture [`Farewell`](crate::model::Farewell).
|
86 + | pub fn builder() -> crate::model::farewell::Builder {
|
87 + | crate::model::farewell::Builder::default()
|
143 88 | }
|
144 - | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
145 - | /// Returns `Err(&Self)` if it can't be converted.
|
146 - | pub fn as_baz(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
147 - | if let UnionWithJsonName::Baz(val) = &self {
|
148 - | ::std::result::Result::Ok(val)
|
149 - | } else {
|
150 - | ::std::result::Result::Err(self)
|
151 - | }
|
89 + | }
|
90 + | impl crate::constrained::Constrained for crate::model::Farewell {
|
91 + | type Unconstrained = crate::model::farewell::Builder;
|
92 + | }
|
93 + |
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
96 + | pub struct TopLevel {
|
97 + | #[allow(missing_docs)] // documentation missing in model
|
98 + | pub dialog: crate::model::Dialog,
|
99 + | #[allow(missing_docs)] // documentation missing in model
|
100 + | pub dialog_list: ::std::vec::Vec<crate::model::Dialog>,
|
101 + | #[allow(missing_docs)] // documentation missing in model
|
102 + | pub dialog_map: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
103 + | }
|
104 + | impl TopLevel {
|
105 + | #[allow(missing_docs)] // documentation missing in model
|
106 + | pub fn dialog(&self) -> &crate::model::Dialog {
|
107 + | &self.dialog
|
152 108 | }
|
153 - | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
154 - | pub fn is_baz(&self) -> bool {
|
155 - | self.as_baz().is_ok()
|
109 + | #[allow(missing_docs)] // documentation missing in model
|
110 + | pub fn dialog_list(&self) -> &[crate::model::Dialog] {
|
111 + | use std::ops::Deref;
|
112 + | self.dialog_list.deref()
|
156 113 | }
|
157 - | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
158 - | /// Returns `Err(&Self)` if it can't be converted.
|
159 - | pub fn as_foo(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
160 - | if let UnionWithJsonName::Foo(val) = &self {
|
161 - | ::std::result::Result::Ok(val)
|
162 - | } else {
|
163 - | ::std::result::Result::Err(self)
|
164 - | }
|
114 + | #[allow(missing_docs)] // documentation missing in model
|
115 + | pub fn dialog_map(
|
116 + | &self,
|
117 + | ) -> &::std::collections::HashMap<::std::string::String, crate::model::Dialog> {
|
118 + | &self.dialog_map
|
165 119 | }
|
166 - | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
167 - | pub fn is_foo(&self) -> bool {
|
168 - | self.as_foo().is_ok()
|
120 + | }
|
121 + | impl TopLevel {
|
122 + | /// Creates a new builder-style object to manufacture [`TopLevel`](crate::model::TopLevel).
|
123 + | pub fn builder() -> crate::model::top_level::Builder {
|
124 + | crate::model::top_level::Builder::default()
|
169 125 | }
|
170 126 | }
|
127 + | impl crate::constrained::Constrained for crate::model::TopLevel {
|
128 + | type Unconstrained = crate::model::top_level::Builder;
|
129 + | }
|
171 130 |
|
172 131 | #[allow(missing_docs)] // documentation missing in model
|
173 132 | #[derive(
|
174 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
133 + | ::std::clone::Clone,
|
134 + | ::std::cmp::Eq,
|
135 + | ::std::cmp::Ord,
|
136 + | ::std::cmp::PartialEq,
|
137 + | ::std::cmp::PartialOrd,
|
138 + | ::std::fmt::Debug,
|
139 + | ::std::hash::Hash,
|
175 140 | )]
|
176 - | pub enum PlayerAction {
|
177 - | /// Quit the game.
|
178 - | Quit,
|
141 + | pub enum TestEnum {
|
142 + | #[allow(missing_docs)] // documentation missing in model
|
143 + | Bar,
|
144 + | #[allow(missing_docs)] // documentation missing in model
|
145 + | Baz,
|
146 + | #[allow(missing_docs)] // documentation missing in model
|
147 + | Foo,
|
179 148 | }
|
180 - | impl PlayerAction {
|
181 - | #[allow(irrefutable_let_patterns)]
|
182 - | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
183 - | /// Returns `Err(&Self)` if it can't be converted.
|
184 - | pub fn as_quit(&self) -> ::std::result::Result<(), &Self> {
|
185 - | if let PlayerAction::Quit = &self {
|
186 - | ::std::result::Result::Ok(())
|
187 - | } else {
|
188 - | ::std::result::Result::Err(self)
|
149 + | /// See [`TestEnum`](crate::model::TestEnum).
|
150 + | pub mod test_enum {
|
151 + | #[derive(Debug, PartialEq)]
|
152 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
153 + |
|
154 + | impl ::std::fmt::Display for ConstraintViolation {
|
155 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
156 + | write!(
|
157 + | f,
|
158 + | r#"Value provided for 'aws.protocoltests.restjson#TestEnum' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#
|
159 + | )
|
189 160 | }
|
190 161 | }
|
191 - | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
192 - | pub fn is_quit(&self) -> bool {
|
193 - | self.as_quit().is_ok()
|
162 + |
|
163 + | impl ::std::error::Error for ConstraintViolation {}
|
164 + | impl ConstraintViolation {
|
165 + | pub(crate) fn as_validation_exception_field(
|
166 + | self,
|
167 + | path: ::std::string::String,
|
168 + | ) -> crate::model::ValidationExceptionField {
|
169 + | crate::model::ValidationExceptionField {
|
170 + | message: format!(
|
171 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#,
|
172 + | &path
|
173 + | ),
|
174 + | path,
|
175 + | }
|
176 + | }
|
177 + | }
|
178 + | }
|
179 + | impl ::std::convert::TryFrom<&str> for TestEnum {
|
180 + | type Error = crate::model::test_enum::ConstraintViolation;
|
181 + | fn try_from(
|
182 + | s: &str,
|
183 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
184 + | match s {
|
185 + | "BAR" => Ok(TestEnum::Bar),
|
186 + | "BAZ" => Ok(TestEnum::Baz),
|
187 + | "FOO" => Ok(TestEnum::Foo),
|
188 + | _ => Err(crate::model::test_enum::ConstraintViolation(s.to_owned())),
|
189 + | }
|
190 + | }
|
191 + | }
|
192 + | impl ::std::convert::TryFrom<::std::string::String> for TestEnum {
|
193 + | type Error = crate::model::test_enum::ConstraintViolation;
|
194 + | fn try_from(
|
195 + | s: ::std::string::String,
|
196 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
197 + | {
|
198 + | s.as_str().try_into()
|
199 + | }
|
200 + | }
|
201 + | impl std::str::FromStr for TestEnum {
|
202 + | type Err = crate::model::test_enum::ConstraintViolation;
|
203 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
204 + | Self::try_from(s)
|
205 + | }
|
206 + | }
|
207 + | impl TestEnum {
|
208 + | /// Returns the `&str` value of the enum member.
|
209 + | pub fn as_str(&self) -> &str {
|
210 + | match self {
|
211 + | TestEnum::Bar => "BAR",
|
212 + | TestEnum::Baz => "BAZ",
|
213 + | TestEnum::Foo => "FOO",
|
214 + | }
|
215 + | }
|
216 + | /// Returns all the `&str` representations of the enum members.
|
217 + | pub const fn values() -> &'static [&'static str] {
|
218 + | &["BAR", "BAZ", "FOO"]
|
219 + | }
|
220 + | }
|
221 + | impl ::std::convert::AsRef<str> for TestEnum {
|
222 + | fn as_ref(&self) -> &str {
|
223 + | self.as_str()
|
224 + | }
|
225 + | }
|
226 + | impl crate::constrained::Constrained for TestEnum {
|
227 + | type Unconstrained = ::std::string::String;
|
228 + | }
|
229 + |
|
230 + | impl ::std::convert::From<::std::string::String>
|
231 + | for crate::constrained::MaybeConstrained<crate::model::TestEnum>
|
232 + | {
|
233 + | fn from(value: ::std::string::String) -> Self {
|
234 + | Self::Unconstrained(value)
|
194 235 | }
|
195 236 | }
|
196 237 |
|
197 238 | #[allow(missing_docs)] // documentation missing in model
|
198 239 | #[derive(
|
199 240 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
200 241 | )]
|
201 - | pub struct Unit {}
|
202 - | impl Unit {
|
203 - | /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit).
|
204 - | pub fn builder() -> crate::model::unit::Builder {
|
205 - | crate::model::unit::Builder::default()
|
242 + | pub struct ClientOptionalDefaults {
|
243 + | #[allow(missing_docs)] // documentation missing in model
|
244 + | pub member: i32,
|
245 + | }
|
246 + | impl ClientOptionalDefaults {
|
247 + | #[allow(missing_docs)] // documentation missing in model
|
248 + | pub fn member(&self) -> i32 {
|
249 + | self.member
|
206 250 | }
|
207 251 | }
|
208 - | impl crate::constrained::Constrained for crate::model::Unit {
|
209 - | type Unconstrained = crate::model::unit::Builder;
|
252 + | impl ClientOptionalDefaults {
|
253 + | /// Creates a new builder-style object to manufacture [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
254 + | pub fn builder() -> crate::model::client_optional_defaults::Builder {
|
255 + | crate::model::client_optional_defaults::Builder::default()
|
256 + | }
|
257 + | }
|
258 + | impl crate::constrained::Constrained for crate::model::ClientOptionalDefaults {
|
259 + | type Unconstrained = crate::model::client_optional_defaults::Builder;
|
210 260 | }
|
211 261 |
|
212 - | /// A union with a representative set of types for members.
|
213 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
214 - | pub enum MyUnion {
|
262 + | #[allow(missing_docs)] // documentation missing in model
|
263 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
264 + | pub struct Defaults {
|
215 265 | #[allow(missing_docs)] // documentation missing in model
|
216 - | BlobValue(::aws_smithy_types::Blob),
|
266 + | pub default_string: ::std::string::String,
|
217 267 | #[allow(missing_docs)] // documentation missing in model
|
218 - | BooleanValue(bool),
|
268 + | pub default_boolean: bool,
|
219 269 | #[allow(missing_docs)] // documentation missing in model
|
220 - | EnumValue(crate::model::FooEnum),
|
270 + | pub default_list: ::std::vec::Vec<::std::string::String>,
|
221 271 | #[allow(missing_docs)] // documentation missing in model
|
222 - | ListValue(::std::vec::Vec<::std::string::String>),
|
272 + | pub default_document_map: ::aws_smithy_types::Document,
|
223 273 | #[allow(missing_docs)] // documentation missing in model
|
224 - | MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
274 + | pub default_document_string: ::aws_smithy_types::Document,
|
225 275 | #[allow(missing_docs)] // documentation missing in model
|
226 - | NumberValue(i32),
|
276 + | pub default_document_boolean: ::aws_smithy_types::Document,
|
227 277 | #[allow(missing_docs)] // documentation missing in model
|
228 - | RenamedStructureValue(crate::model::RenamedGreeting),
|
278 + | pub default_document_list: ::aws_smithy_types::Document,
|
229 279 | #[allow(missing_docs)] // documentation missing in model
|
230 - | StringValue(::std::string::String),
|
280 + | pub default_null_document: ::std::option::Option<::aws_smithy_types::Document>,
|
231 281 | #[allow(missing_docs)] // documentation missing in model
|
232 - | StructureValue(crate::model::GreetingStruct),
|
282 + | pub default_timestamp: ::aws_smithy_types::DateTime,
|
233 283 | #[allow(missing_docs)] // documentation missing in model
|
234 - | TimestampValue(::aws_smithy_types::DateTime),
|
284 + | pub default_blob: ::aws_smithy_types::Blob,
|
285 + | #[allow(missing_docs)] // documentation missing in model
|
286 + | pub default_byte: i8,
|
287 + | #[allow(missing_docs)] // documentation missing in model
|
288 + | pub default_short: i16,
|
289 + | #[allow(missing_docs)] // documentation missing in model
|
290 + | pub default_integer: i32,
|
291 + | #[allow(missing_docs)] // documentation missing in model
|
292 + | pub default_long: i64,
|
293 + | #[allow(missing_docs)] // documentation missing in model
|
294 + | pub default_float: f32,
|
295 + | #[allow(missing_docs)] // documentation missing in model
|
296 + | pub default_double: f64,
|
297 + | #[allow(missing_docs)] // documentation missing in model
|
298 + | pub default_map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
299 + | #[allow(missing_docs)] // documentation missing in model
|
300 + | pub default_enum: crate::model::TestEnum,
|
301 + | #[allow(missing_docs)] // documentation missing in model
|
302 + | pub default_int_enum: i32,
|
303 + | #[allow(missing_docs)] // documentation missing in model
|
304 + | pub empty_string: ::std::string::String,
|
305 + | #[allow(missing_docs)] // documentation missing in model
|
306 + | pub false_boolean: bool,
|
307 + | #[allow(missing_docs)] // documentation missing in model
|
308 + | pub empty_blob: ::aws_smithy_types::Blob,
|
309 + | #[allow(missing_docs)] // documentation missing in model
|
310 + | pub zero_byte: i8,
|
311 + | #[allow(missing_docs)] // documentation missing in model
|
312 + | pub zero_short: i16,
|
313 + | #[allow(missing_docs)] // documentation missing in model
|
314 + | pub zero_integer: i32,
|
315 + | #[allow(missing_docs)] // documentation missing in model
|
316 + | pub zero_long: i64,
|
317 + | #[allow(missing_docs)] // documentation missing in model
|
318 + | pub zero_float: f32,
|
319 + | #[allow(missing_docs)] // documentation missing in model
|
320 + | pub zero_double: f64,
|
235 321 | }
|
236 - | impl MyUnion {
|
237 - | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_types::Blob).
|
238 - | /// Returns `Err(&Self)` if it can't be converted.
|
239 - | pub fn as_blob_value(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
|
240 - | if let MyUnion::BlobValue(val) = &self {
|
241 - | ::std::result::Result::Ok(val)
|
242 - | } else {
|
243 - | ::std::result::Result::Err(self)
|
244 - | }
|
322 + | impl Defaults {
|
323 + | #[allow(missing_docs)] // documentation missing in model
|
324 + | pub fn default_string(&self) -> &str {
|
325 + | use std::ops::Deref;
|
326 + | self.default_string.deref()
|
245 327 | }
|
246 - | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
247 - | pub fn is_blob_value(&self) -> bool {
|
248 - | self.as_blob_value().is_ok()
|
328 + | #[allow(missing_docs)] // documentation missing in model
|
329 + | pub fn default_boolean(&self) -> bool {
|
330 + | self.default_boolean
|
249 331 | }
|
250 - | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
251 - | /// Returns `Err(&Self)` if it can't be converted.
|
252 - | pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
|
253 - | if let MyUnion::BooleanValue(val) = &self {
|
254 - | ::std::result::Result::Ok(val)
|
255 - | } else {
|
256 - | ::std::result::Result::Err(self)
|
257 - | }
|
332 + | #[allow(missing_docs)] // documentation missing in model
|
333 + | pub fn default_list(&self) -> &[::std::string::String] {
|
334 + | use std::ops::Deref;
|
335 + | self.default_list.deref()
|
258 336 | }
|
259 - | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
260 - | pub fn is_boolean_value(&self) -> bool {
|
261 - | self.as_boolean_value().is_ok()
|
337 + | #[allow(missing_docs)] // documentation missing in model
|
338 + | pub fn default_document_map(&self) -> &::aws_smithy_types::Document {
|
339 + | &self.default_document_map
|
262 340 | }
|
263 - | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
264 - | /// Returns `Err(&Self)` if it can't be converted.
|
265 - | pub fn as_enum_value(&self) -> ::std::result::Result<&crate::model::FooEnum, &Self> {
|
266 - | if let MyUnion::EnumValue(val) = &self {
|
267 - | ::std::result::Result::Ok(val)
|
268 - | } else {
|
269 - | ::std::result::Result::Err(self)
|
270 - | }
|
341 + | #[allow(missing_docs)] // documentation missing in model
|
342 + | pub fn default_document_string(&self) -> &::aws_smithy_types::Document {
|
343 + | &self.default_document_string
|
271 344 | }
|
272 - | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
273 - | pub fn is_enum_value(&self) -> bool {
|
274 - | self.as_enum_value().is_ok()
|
345 + | #[allow(missing_docs)] // documentation missing in model
|
346 + | pub fn default_document_boolean(&self) -> &::aws_smithy_types::Document {
|
347 + | &self.default_document_boolean
|
275 348 | }
|
276 - | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
277 - | /// Returns `Err(&Self)` if it can't be converted.
|
278 - | pub fn as_list_value(
|
279 - | &self,
|
280 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
|
281 - | if let MyUnion::ListValue(val) = &self {
|
282 - | ::std::result::Result::Ok(val)
|
283 - | } else {
|
284 - | ::std::result::Result::Err(self)
|
285 - | }
|
349 + | #[allow(missing_docs)] // documentation missing in model
|
350 + | pub fn default_document_list(&self) -> &::aws_smithy_types::Document {
|
351 + | &self.default_document_list
|
286 352 | }
|
287 - | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
288 - | pub fn is_list_value(&self) -> bool {
|
289 - | self.as_list_value().is_ok()
|
353 + | #[allow(missing_docs)] // documentation missing in model
|
354 + | pub fn default_null_document(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
|
355 + | self.default_null_document.as_ref()
|
290 356 | }
|
291 - | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
292 - | /// Returns `Err(&Self)` if it can't be converted.
|
293 - | pub fn as_map_value(
|
294 - | &self,
|
295 - | ) -> ::std::result::Result<
|
296 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
297 - | &Self,
|
298 - | > {
|
299 - | if let MyUnion::MapValue(val) = &self {
|
300 - | ::std::result::Result::Ok(val)
|
301 - | } else {
|
302 - | ::std::result::Result::Err(self)
|
303 - | }
|
357 + | #[allow(missing_docs)] // documentation missing in model
|
358 + | pub fn default_timestamp(&self) -> &::aws_smithy_types::DateTime {
|
359 + | &self.default_timestamp
|
304 360 | }
|
305 - | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
306 - | pub fn is_map_value(&self) -> bool {
|
307 - | self.as_map_value().is_ok()
|
361 + | #[allow(missing_docs)] // documentation missing in model
|
362 + | pub fn default_blob(&self) -> &::aws_smithy_types::Blob {
|
363 + | &self.default_blob
|
308 364 | }
|
309 - | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
310 - | /// Returns `Err(&Self)` if it can't be converted.
|
311 - | pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
|
312 - | if let MyUnion::NumberValue(val) = &self {
|
313 - | ::std::result::Result::Ok(val)
|
314 - | } else {
|
315 - | ::std::result::Result::Err(self)
|
316 - | }
|
365 + | #[allow(missing_docs)] // documentation missing in model
|
366 + | pub fn default_byte(&self) -> i8 {
|
367 + | self.default_byte
|
317 368 | }
|
318 - | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
319 - | pub fn is_number_value(&self) -> bool {
|
320 - | self.as_number_value().is_ok()
|
369 + | #[allow(missing_docs)] // documentation missing in model
|
370 + | pub fn default_short(&self) -> i16 {
|
371 + | self.default_short
|
321 372 | }
|
322 - | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
323 - | /// Returns `Err(&Self)` if it can't be converted.
|
324 - | pub fn as_renamed_structure_value(
|
325 - | &self,
|
326 - | ) -> ::std::result::Result<&crate::model::RenamedGreeting, &Self> {
|
327 - | if let MyUnion::RenamedStructureValue(val) = &self {
|
328 - | ::std::result::Result::Ok(val)
|
329 - | } else {
|
330 - | ::std::result::Result::Err(self)
|
331 - | }
|
373 + | #[allow(missing_docs)] // documentation missing in model
|
374 + | pub fn default_integer(&self) -> i32 {
|
375 + | self.default_integer
|
332 376 | }
|
333 - | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
334 - | pub fn is_renamed_structure_value(&self) -> bool {
|
335 - | self.as_renamed_structure_value().is_ok()
|
377 + | #[allow(missing_docs)] // documentation missing in model
|
378 + | pub fn default_long(&self) -> i64 {
|
379 + | self.default_long
|
336 380 | }
|
337 - | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
338 - | /// Returns `Err(&Self)` if it can't be converted.
|
339 - | pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
340 - | if let MyUnion::StringValue(val) = &self {
|
341 - | ::std::result::Result::Ok(val)
|
342 - | } else {
|
343 - | ::std::result::Result::Err(self)
|
344 - | }
|
381 + | #[allow(missing_docs)] // documentation missing in model
|
382 + | pub fn default_float(&self) -> f32 {
|
383 + | self.default_float
|
345 384 | }
|
346 - | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
347 - | pub fn is_string_value(&self) -> bool {
|
348 - | self.as_string_value().is_ok()
|
385 + | #[allow(missing_docs)] // documentation missing in model
|
386 + | pub fn default_double(&self) -> f64 {
|
387 + | self.default_double
|
349 388 | }
|
350 - | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
351 - | /// Returns `Err(&Self)` if it can't be converted.
|
352 - | pub fn as_structure_value(
|
389 + | #[allow(missing_docs)] // documentation missing in model
|
390 + | pub fn default_map(
|
353 391 | &self,
|
354 - | ) -> ::std::result::Result<&crate::model::GreetingStruct, &Self> {
|
355 - | if let MyUnion::StructureValue(val) = &self {
|
356 - | ::std::result::Result::Ok(val)
|
357 - | } else {
|
358 - | ::std::result::Result::Err(self)
|
359 - | }
|
392 + | ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
393 + | &self.default_map
|
360 394 | }
|
361 - | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
362 - | pub fn is_structure_value(&self) -> bool {
|
363 - | self.as_structure_value().is_ok()
|
395 + | #[allow(missing_docs)] // documentation missing in model
|
396 + | pub fn default_enum(&self) -> &crate::model::TestEnum {
|
397 + | &self.default_enum
|
364 398 | }
|
365 - | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
|
366 - | /// Returns `Err(&Self)` if it can't be converted.
|
367 - | pub fn as_timestamp_value(
|
368 - | &self,
|
369 - | ) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
|
370 - | if let MyUnion::TimestampValue(val) = &self {
|
371 - | ::std::result::Result::Ok(val)
|
372 - | } else {
|
373 - | ::std::result::Result::Err(self)
|
374 - | }
|
399 + | #[allow(missing_docs)] // documentation missing in model
|
400 + | pub fn default_int_enum(&self) -> i32 {
|
401 + | self.default_int_enum
|
375 402 | }
|
376 - | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
377 - | pub fn is_timestamp_value(&self) -> bool {
|
378 - | self.as_timestamp_value().is_ok()
|
403 + | #[allow(missing_docs)] // documentation missing in model
|
404 + | pub fn empty_string(&self) -> &str {
|
405 + | use std::ops::Deref;
|
406 + | self.empty_string.deref()
|
407 + | }
|
408 + | #[allow(missing_docs)] // documentation missing in model
|
409 + | pub fn false_boolean(&self) -> bool {
|
410 + | self.false_boolean
|
411 + | }
|
412 + | #[allow(missing_docs)] // documentation missing in model
|
413 + | pub fn empty_blob(&self) -> &::aws_smithy_types::Blob {
|
414 + | &self.empty_blob
|
415 + | }
|
416 + | #[allow(missing_docs)] // documentation missing in model
|
417 + | pub fn zero_byte(&self) -> i8 {
|
418 + | self.zero_byte
|
419 + | }
|
420 + | #[allow(missing_docs)] // documentation missing in model
|
421 + | pub fn zero_short(&self) -> i16 {
|
422 + | self.zero_short
|
423 + | }
|
424 + | #[allow(missing_docs)] // documentation missing in model
|
425 + | pub fn zero_integer(&self) -> i32 {
|
426 + | self.zero_integer
|
427 + | }
|
428 + | #[allow(missing_docs)] // documentation missing in model
|
429 + | pub fn zero_long(&self) -> i64 {
|
430 + | self.zero_long
|
431 + | }
|
432 + | #[allow(missing_docs)] // documentation missing in model
|
433 + | pub fn zero_float(&self) -> f32 {
|
434 + | self.zero_float
|
435 + | }
|
436 + | #[allow(missing_docs)] // documentation missing in model
|
437 + | pub fn zero_double(&self) -> f64 {
|
438 + | self.zero_double
|
379 439 | }
|
380 440 | }
|
441 + | impl Defaults {
|
442 + | /// Creates a new builder-style object to manufacture [`Defaults`](crate::model::Defaults).
|
443 + | pub fn builder() -> crate::model::defaults::Builder {
|
444 + | crate::model::defaults::Builder::default()
|
445 + | }
|
446 + | }
|
447 + | impl crate::constrained::Constrained for crate::model::Defaults {
|
448 + | type Unconstrained = crate::model::defaults::Builder;
|
449 + | }
|
381 450 |
|
382 451 | #[allow(missing_docs)] // documentation missing in model
|
383 452 | #[derive(
|
384 453 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
385 454 | )]
|
386 - | pub struct RenamedGreeting {
|
455 + | pub struct PayloadConfig {
|
387 456 | #[allow(missing_docs)] // documentation missing in model
|
388 - | pub salutation: ::std::option::Option<::std::string::String>,
|
457 + | pub data: ::std::option::Option<i32>,
|
389 458 | }
|
390 - | impl RenamedGreeting {
|
459 + | impl PayloadConfig {
|
391 460 | #[allow(missing_docs)] // documentation missing in model
|
392 - | pub fn salutation(&self) -> ::std::option::Option<&str> {
|
393 - | self.salutation.as_deref()
|
461 + | pub fn data(&self) -> ::std::option::Option<i32> {
|
462 + | self.data
|
394 463 | }
|
395 464 | }
|
396 - | impl RenamedGreeting {
|
397 - | /// Creates a new builder-style object to manufacture [`RenamedGreeting`](crate::model::RenamedGreeting).
|
398 - | pub fn builder() -> crate::model::renamed_greeting::Builder {
|
399 - | crate::model::renamed_greeting::Builder::default()
|
465 + | impl PayloadConfig {
|
466 + | /// Creates a new builder-style object to manufacture [`PayloadConfig`](crate::model::PayloadConfig).
|
467 + | pub fn builder() -> crate::model::payload_config::Builder {
|
468 + | crate::model::payload_config::Builder::default()
|
400 469 | }
|
401 470 | }
|
402 - | impl crate::constrained::Constrained for crate::model::RenamedGreeting {
|
403 - | type Unconstrained = crate::model::renamed_greeting::Builder;
|
471 + | impl crate::constrained::Constrained for crate::model::PayloadConfig {
|
472 + | type Unconstrained = crate::model::payload_config::Builder;
|
404 473 | }
|
405 474 |
|
406 475 | #[allow(missing_docs)] // documentation missing in model
|
407 476 | #[derive(
|
408 477 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
409 478 | )]
|
410 - | pub struct GreetingStruct {
|
479 + | pub struct TestConfig {
|
411 480 | #[allow(missing_docs)] // documentation missing in model
|
412 - | pub hi: ::std::option::Option<::std::string::String>,
|
481 + | pub timeout: ::std::option::Option<i32>,
|
413 482 | }
|
414 - | impl GreetingStruct {
|
483 + | impl TestConfig {
|
415 484 | #[allow(missing_docs)] // documentation missing in model
|
416 - | pub fn hi(&self) -> ::std::option::Option<&str> {
|
417 - | self.hi.as_deref()
|
485 + | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
486 + | self.timeout
|
418 487 | }
|
419 488 | }
|
420 - | impl GreetingStruct {
|
421 - | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
422 - | pub fn builder() -> crate::model::greeting_struct::Builder {
|
423 - | crate::model::greeting_struct::Builder::default()
|
489 + | impl TestConfig {
|
490 + | /// Creates a new builder-style object to manufacture [`TestConfig`](crate::model::TestConfig).
|
491 + | pub fn builder() -> crate::model::test_config::Builder {
|
492 + | crate::model::test_config::Builder::default()
|
424 493 | }
|
425 494 | }
|
426 - | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
427 - | type Unconstrained = crate::model::greeting_struct::Builder;
|
495 + | impl crate::constrained::Constrained for crate::model::TestConfig {
|
496 + | type Unconstrained = crate::model::test_config::Builder;
|
428 497 | }
|
429 498 |
|
430 499 | #[allow(missing_docs)] // documentation missing in model
|
431 500 | #[derive(
|
432 - | ::std::clone::Clone,
|
433 - | ::std::cmp::Eq,
|
434 - | ::std::cmp::Ord,
|
435 - | ::std::cmp::PartialEq,
|
436 - | ::std::cmp::PartialOrd,
|
437 - | ::std::fmt::Debug,
|
438 - | ::std::hash::Hash,
|
501 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
439 502 | )]
|
440 - | pub enum FooEnum {
|
441 - | #[allow(missing_docs)] // documentation missing in model
|
442 - | Zero,
|
443 - | #[allow(missing_docs)] // documentation missing in model
|
444 - | One,
|
445 - | #[allow(missing_docs)] // documentation missing in model
|
446 - | Bar,
|
503 + | pub enum SimpleUnion {
|
447 504 | #[allow(missing_docs)] // documentation missing in model
|
448 - | Baz,
|
505 + | Int(i32),
|
449 506 | #[allow(missing_docs)] // documentation missing in model
|
450 - | Foo,
|
507 + | String(::std::string::String),
|
451 508 | }
|
452 - | /// See [`FooEnum`](crate::model::FooEnum).
|
453 - | pub mod foo_enum {
|
454 - | #[derive(Debug, PartialEq)]
|
455 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
456 - |
|
457 - | impl ::std::fmt::Display for ConstraintViolation {
|
458 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
459 - | write!(
|
460 - | f,
|
461 - | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
462 - | )
|
463 - | }
|
464 - | }
|
465 - |
|
466 - | impl ::std::error::Error for ConstraintViolation {}
|
467 - | impl ConstraintViolation {
|
468 - | pub(crate) fn as_validation_exception_field(
|
469 - | self,
|
470 - | path: ::std::string::String,
|
471 - | ) -> crate::model::ValidationExceptionField {
|
472 - | crate::model::ValidationExceptionField {
|
473 - | message: format!(
|
474 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
475 - | &path
|
476 - | ),
|
477 - | path,
|
478 - | }
|
479 - | }
|
480 - | }
|
481 - | }
|
482 - | impl ::std::convert::TryFrom<&str> for FooEnum {
|
483 - | type Error = crate::model::foo_enum::ConstraintViolation;
|
484 - | fn try_from(
|
485 - | s: &str,
|
486 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
487 - | match s {
|
488 - | "0" => Ok(FooEnum::Zero),
|
489 - | "1" => Ok(FooEnum::One),
|
490 - | "Bar" => Ok(FooEnum::Bar),
|
491 - | "Baz" => Ok(FooEnum::Baz),
|
492 - | "Foo" => Ok(FooEnum::Foo),
|
493 - | _ => Err(crate::model::foo_enum::ConstraintViolation(s.to_owned())),
|
509 + | impl SimpleUnion {
|
510 + | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
511 + | /// Returns `Err(&Self)` if it can't be converted.
|
512 + | pub fn as_int(&self) -> ::std::result::Result<&i32, &Self> {
|
513 + | if let SimpleUnion::Int(val) = &self {
|
514 + | ::std::result::Result::Ok(val)
|
515 + | } else {
|
516 + | ::std::result::Result::Err(self)
|
494 517 | }
|
495 518 | }
|
496 - | }
|
497 - | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
498 - | type Error = crate::model::foo_enum::ConstraintViolation;
|
499 - | fn try_from(
|
500 - | s: ::std::string::String,
|
501 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
502 - | {
|
503 - | s.as_str().try_into()
|
504 - | }
|
505 - | }
|
506 - | impl std::str::FromStr for FooEnum {
|
507 - | type Err = crate::model::foo_enum::ConstraintViolation;
|
508 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
509 - | Self::try_from(s)
|
519 + | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
520 + | pub fn is_int(&self) -> bool {
|
521 + | self.as_int().is_ok()
|
510 522 | }
|
511 - | }
|
512 - | impl FooEnum {
|
513 - | /// Returns the `&str` value of the enum member.
|
514 - | pub fn as_str(&self) -> &str {
|
515 - | match self {
|
516 - | FooEnum::Zero => "0",
|
517 - | FooEnum::One => "1",
|
518 - | FooEnum::Bar => "Bar",
|
519 - | FooEnum::Baz => "Baz",
|
520 - | FooEnum::Foo => "Foo",
|
523 + | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
524 + | /// Returns `Err(&Self)` if it can't be converted.
|
525 + | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
526 + | if let SimpleUnion::String(val) = &self {
|
527 + | ::std::result::Result::Ok(val)
|
528 + | } else {
|
529 + | ::std::result::Result::Err(self)
|
521 530 | }
|
522 531 | }
|
523 - | /// Returns all the `&str` representations of the enum members.
|
524 - | pub const fn values() -> &'static [&'static str] {
|
525 - | &["0", "1", "Bar", "Baz", "Foo"]
|
526 - | }
|
527 - | }
|
528 - | impl ::std::convert::AsRef<str> for FooEnum {
|
529 - | fn as_ref(&self) -> &str {
|
530 - | self.as_str()
|
531 - | }
|
532 - | }
|
533 - | impl crate::constrained::Constrained for FooEnum {
|
534 - | type Unconstrained = ::std::string::String;
|
535 - | }
|
536 - |
|
537 - | impl ::std::convert::From<::std::string::String>
|
538 - | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
539 - | {
|
540 - | fn from(value: ::std::string::String) -> Self {
|
541 - | Self::Unconstrained(value)
|
532 + | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
533 + | pub fn is_string(&self) -> bool {
|
534 + | self.as_string().is_ok()
|
542 535 | }
|
543 536 | }
|
544 537 |
|
545 538 | #[allow(missing_docs)] // documentation missing in model
|
546 - | ///
|
547 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
548 - | /// [constraint traits]. Use [`StringSet::try_from`] to construct values of this type.
|
549 - | ///
|
550 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
551 - | ///
|
552 539 | #[derive(
|
553 540 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
554 541 | )]
|
555 - | pub struct StringSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
556 - | impl StringSet {
|
557 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
558 - | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
559 - | &self.0
|
542 + | pub enum UnionWithJsonName {
|
543 + | #[allow(missing_docs)] // documentation missing in model
|
544 + | Bar(::std::string::String),
|
545 + | #[allow(missing_docs)] // documentation missing in model
|
546 + | Baz(::std::string::String),
|
547 + | #[allow(missing_docs)] // documentation missing in model
|
548 + | Foo(::std::string::String),
|
549 + | }
|
550 + | impl UnionWithJsonName {
|
551 + | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
552 + | /// Returns `Err(&Self)` if it can't be converted.
|
553 + | pub fn as_bar(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
554 + | if let UnionWithJsonName::Bar(val) = &self {
|
555 + | ::std::result::Result::Ok(val)
|
556 + | } else {
|
557 + | ::std::result::Result::Err(self)
|
558 + | }
|
560 559 | }
|
561 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
562 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
563 - | self.0
|
560 + | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
561 + | pub fn is_bar(&self) -> bool {
|
562 + | self.as_bar().is_ok()
|
564 563 | }
|
565 - |
|
566 - | fn check_unique_items(
|
567 - | items: ::std::vec::Vec<::std::string::String>,
|
568 - | ) -> Result<::std::vec::Vec<::std::string::String>, crate::model::string_set::ConstraintViolation>
|
569 - | {
|
570 - | let mut seen = ::std::collections::HashMap::new();
|
571 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
572 - | for (idx, item) in items.iter().enumerate() {
|
573 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
574 - | duplicate_indices.push(prev_idx);
|
575 - | }
|
576 - | }
|
577 - |
|
578 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
579 - | for idx in &duplicate_indices {
|
580 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
581 - | last_duplicate_indices.push(prev_idx);
|
582 - | }
|
583 - | }
|
584 - | duplicate_indices.extend(last_duplicate_indices);
|
585 - |
|
586 - | if !duplicate_indices.is_empty() {
|
587 - | debug_assert!(duplicate_indices.len() >= 2);
|
588 - | Err(crate::model::string_set::ConstraintViolation::UniqueItems {
|
589 - | duplicate_indices,
|
590 - | original: items,
|
591 - | })
|
564 + | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
565 + | /// Returns `Err(&Self)` if it can't be converted.
|
566 + | pub fn as_baz(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
567 + | if let UnionWithJsonName::Baz(val) = &self {
|
568 + | ::std::result::Result::Ok(val)
|
592 569 | } else {
|
593 - | Ok(items)
|
570 + | ::std::result::Result::Err(self)
|
594 571 | }
|
595 572 | }
|
596 - | }
|
597 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for StringSet {
|
598 - | type Error = crate::model::string_set::ConstraintViolation;
|
599 - |
|
600 - | /// Constructs a `StringSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
601 - | fn try_from(value: ::std::vec::Vec<::std::string::String>) -> Result<Self, Self::Error> {
|
602 - | let value = Self::check_unique_items(value)?;
|
603 - |
|
604 - | Ok(Self(value))
|
573 + | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
574 + | pub fn is_baz(&self) -> bool {
|
575 + | self.as_baz().is_ok()
|
605 576 | }
|
606 - | }
|
607 - |
|
608 - | impl ::std::convert::From<StringSet> for ::std::vec::Vec<::std::string::String> {
|
609 - | fn from(value: StringSet) -> Self {
|
610 - | value.into_inner()
|
577 + | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
578 + | /// Returns `Err(&Self)` if it can't be converted.
|
579 + | pub fn as_foo(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
580 + | if let UnionWithJsonName::Foo(val) = &self {
|
581 + | ::std::result::Result::Ok(val)
|
582 + | } else {
|
583 + | ::std::result::Result::Err(self)
|
584 + | }
|
585 + | }
|
586 + | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
587 + | pub fn is_foo(&self) -> bool {
|
588 + | self.as_foo().is_ok()
|
611 589 | }
|
612 - | }
|
613 - | impl crate::constrained::Constrained for StringSet {
|
614 - | type Unconstrained = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained;
|
615 590 | }
|
616 591 |
|
617 592 | #[allow(missing_docs)] // documentation missing in model
|
618 593 | #[derive(
|
619 594 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
620 595 | )]
|
621 - | pub struct StructureListMember {
|
622 - | #[allow(missing_docs)] // documentation missing in model
|
623 - | pub a: ::std::option::Option<::std::string::String>,
|
624 - | #[allow(missing_docs)] // documentation missing in model
|
625 - | pub b: ::std::option::Option<::std::string::String>,
|
596 + | pub enum PlayerAction {
|
597 + | /// Quit the game.
|
598 + | Quit,
|
626 599 | }
|
627 - | impl StructureListMember {
|
628 - | #[allow(missing_docs)] // documentation missing in model
|
629 - | pub fn a(&self) -> ::std::option::Option<&str> {
|
630 - | self.a.as_deref()
|
631 - | }
|
632 - | #[allow(missing_docs)] // documentation missing in model
|
633 - | pub fn b(&self) -> ::std::option::Option<&str> {
|
634 - | self.b.as_deref()
|
600 + | impl PlayerAction {
|
601 + | #[allow(irrefutable_let_patterns)]
|
602 + | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
603 + | /// Returns `Err(&Self)` if it can't be converted.
|
604 + | pub fn as_quit(&self) -> ::std::result::Result<(), &Self> {
|
605 + | if let PlayerAction::Quit = &self {
|
606 + | ::std::result::Result::Ok(())
|
607 + | } else {
|
608 + | ::std::result::Result::Err(self)
|
609 + | }
|
635 610 | }
|
636 - | }
|
637 - | impl StructureListMember {
|
638 - | /// Creates a new builder-style object to manufacture [`StructureListMember`](crate::model::StructureListMember).
|
639 - | pub fn builder() -> crate::model::structure_list_member::Builder {
|
640 - | crate::model::structure_list_member::Builder::default()
|
611 + | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
612 + | pub fn is_quit(&self) -> bool {
|
613 + | self.as_quit().is_ok()
|
641 614 | }
|
642 615 | }
|
643 - | impl crate::constrained::Constrained for crate::model::StructureListMember {
|
644 - | type Unconstrained = crate::model::structure_list_member::Builder;
|
645 - | }
|
646 616 |
|
647 617 | #[allow(missing_docs)] // documentation missing in model
|
648 618 | #[derive(
|
649 619 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
650 620 | )]
|
651 - | pub struct RecursiveShapesInputOutputNested1 {
|
621 + | pub struct Unit {}
|
622 + | impl Unit {
|
623 + | /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit).
|
624 + | pub fn builder() -> crate::model::unit::Builder {
|
625 + | crate::model::unit::Builder::default()
|
626 + | }
|
627 + | }
|
628 + | impl crate::constrained::Constrained for crate::model::Unit {
|
629 + | type Unconstrained = crate::model::unit::Builder;
|
630 + | }
|
631 + |
|
632 + | /// A union with a representative set of types for members.
|
633 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
634 + | pub enum MyUnion {
|
652 635 | #[allow(missing_docs)] // documentation missing in model
|
653 - | pub foo: ::std::option::Option<::std::string::String>,
|
636 + | BlobValue(::aws_smithy_types::Blob),
|
654 637 | #[allow(missing_docs)] // documentation missing in model
|
655 - | pub nested:
|
656 - | ::std::option::Option<::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>>,
|
657 - | }
|
658 - | impl RecursiveShapesInputOutputNested1 {
|
638 + | BooleanValue(bool),
|
659 639 | #[allow(missing_docs)] // documentation missing in model
|
660 - | pub fn foo(&self) -> ::std::option::Option<&str> {
|
661 - | self.foo.as_deref()
|
662 - | }
|
640 + | EnumValue(crate::model::FooEnum),
|
663 641 | #[allow(missing_docs)] // documentation missing in model
|
664 - | pub fn nested(
|
642 + | ListValue(::std::vec::Vec<::std::string::String>),
|
643 + | #[allow(missing_docs)] // documentation missing in model
|
644 + | MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
645 + | #[allow(missing_docs)] // documentation missing in model
|
646 + | NumberValue(i32),
|
647 + | #[allow(missing_docs)] // documentation missing in model
|
648 + | RenamedStructureValue(crate::model::RenamedGreeting),
|
649 + | #[allow(missing_docs)] // documentation missing in model
|
650 + | StringValue(::std::string::String),
|
651 + | #[allow(missing_docs)] // documentation missing in model
|
652 + | StructureValue(crate::model::GreetingStruct),
|
653 + | #[allow(missing_docs)] // documentation missing in model
|
654 + | TimestampValue(::aws_smithy_types::DateTime),
|
655 + | }
|
656 + | impl MyUnion {
|
657 + | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_types::Blob).
|
658 + | /// Returns `Err(&Self)` if it can't be converted.
|
659 + | pub fn as_blob_value(&self) -> ::std::result::Result<&::aws_smithy_types::Blob, &Self> {
|
660 + | if let MyUnion::BlobValue(val) = &self {
|
661 + | ::std::result::Result::Ok(val)
|
662 + | } else {
|
663 + | ::std::result::Result::Err(self)
|
664 + | }
|
665 + | }
|
666 + | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
667 + | pub fn is_blob_value(&self) -> bool {
|
668 + | self.as_blob_value().is_ok()
|
669 + | }
|
670 + | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
671 + | /// Returns `Err(&Self)` if it can't be converted.
|
672 + | pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
|
673 + | if let MyUnion::BooleanValue(val) = &self {
|
674 + | ::std::result::Result::Ok(val)
|
675 + | } else {
|
676 + | ::std::result::Result::Err(self)
|
677 + | }
|
678 + | }
|
679 + | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
680 + | pub fn is_boolean_value(&self) -> bool {
|
681 + | self.as_boolean_value().is_ok()
|
682 + | }
|
683 + | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
684 + | /// Returns `Err(&Self)` if it can't be converted.
|
685 + | pub fn as_enum_value(&self) -> ::std::result::Result<&crate::model::FooEnum, &Self> {
|
686 + | if let MyUnion::EnumValue(val) = &self {
|
687 + | ::std::result::Result::Ok(val)
|
688 + | } else {
|
689 + | ::std::result::Result::Err(self)
|
690 + | }
|
691 + | }
|
692 + | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
693 + | pub fn is_enum_value(&self) -> bool {
|
694 + | self.as_enum_value().is_ok()
|
695 + | }
|
696 + | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
697 + | /// Returns `Err(&Self)` if it can't be converted.
|
698 + | pub fn as_list_value(
|
665 699 | &self,
|
666 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested2> {
|
667 - | self.nested.as_deref()
|
700 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
|
701 + | if let MyUnion::ListValue(val) = &self {
|
702 + | ::std::result::Result::Ok(val)
|
703 + | } else {
|
704 + | ::std::result::Result::Err(self)
|
705 + | }
|
668 706 | }
|
669 - | }
|
670 - | impl RecursiveShapesInputOutputNested1 {
|
671 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
672 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
673 - | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
707 + | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
708 + | pub fn is_list_value(&self) -> bool {
|
709 + | self.as_list_value().is_ok()
|
710 + | }
|
711 + | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
712 + | /// Returns `Err(&Self)` if it can't be converted.
|
713 + | pub fn as_map_value(
|
714 + | &self,
|
715 + | ) -> ::std::result::Result<
|
716 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
717 + | &Self,
|
718 + | > {
|
719 + | if let MyUnion::MapValue(val) = &self {
|
720 + | ::std::result::Result::Ok(val)
|
721 + | } else {
|
722 + | ::std::result::Result::Err(self)
|
723 + | }
|
724 + | }
|
725 + | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
726 + | pub fn is_map_value(&self) -> bool {
|
727 + | self.as_map_value().is_ok()
|
728 + | }
|
729 + | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
730 + | /// Returns `Err(&Self)` if it can't be converted.
|
731 + | pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
|
732 + | if let MyUnion::NumberValue(val) = &self {
|
733 + | ::std::result::Result::Ok(val)
|
734 + | } else {
|
735 + | ::std::result::Result::Err(self)
|
736 + | }
|
737 + | }
|
738 + | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
739 + | pub fn is_number_value(&self) -> bool {
|
740 + | self.as_number_value().is_ok()
|
741 + | }
|
742 + | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
743 + | /// Returns `Err(&Self)` if it can't be converted.
|
744 + | pub fn as_renamed_structure_value(
|
745 + | &self,
|
746 + | ) -> ::std::result::Result<&crate::model::RenamedGreeting, &Self> {
|
747 + | if let MyUnion::RenamedStructureValue(val) = &self {
|
748 + | ::std::result::Result::Ok(val)
|
749 + | } else {
|
750 + | ::std::result::Result::Err(self)
|
751 + | }
|
752 + | }
|
753 + | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
754 + | pub fn is_renamed_structure_value(&self) -> bool {
|
755 + | self.as_renamed_structure_value().is_ok()
|
756 + | }
|
757 + | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
758 + | /// Returns `Err(&Self)` if it can't be converted.
|
759 + | pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
760 + | if let MyUnion::StringValue(val) = &self {
|
761 + | ::std::result::Result::Ok(val)
|
762 + | } else {
|
763 + | ::std::result::Result::Err(self)
|
764 + | }
|
765 + | }
|
766 + | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
767 + | pub fn is_string_value(&self) -> bool {
|
768 + | self.as_string_value().is_ok()
|
769 + | }
|
770 + | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
771 + | /// Returns `Err(&Self)` if it can't be converted.
|
772 + | pub fn as_structure_value(
|
773 + | &self,
|
774 + | ) -> ::std::result::Result<&crate::model::GreetingStruct, &Self> {
|
775 + | if let MyUnion::StructureValue(val) = &self {
|
776 + | ::std::result::Result::Ok(val)
|
777 + | } else {
|
778 + | ::std::result::Result::Err(self)
|
779 + | }
|
780 + | }
|
781 + | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
782 + | pub fn is_structure_value(&self) -> bool {
|
783 + | self.as_structure_value().is_ok()
|
784 + | }
|
785 + | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
|
786 + | /// Returns `Err(&Self)` if it can't be converted.
|
787 + | pub fn as_timestamp_value(
|
788 + | &self,
|
789 + | ) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
|
790 + | if let MyUnion::TimestampValue(val) = &self {
|
791 + | ::std::result::Result::Ok(val)
|
792 + | } else {
|
793 + | ::std::result::Result::Err(self)
|
794 + | }
|
795 + | }
|
796 + | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
797 + | pub fn is_timestamp_value(&self) -> bool {
|
798 + | self.as_timestamp_value().is_ok()
|
674 799 | }
|
675 - | }
|
676 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
677 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested1::Builder;
|
678 800 | }
|
679 801 |
|
680 802 | #[allow(missing_docs)] // documentation missing in model
|
681 803 | #[derive(
|
682 804 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
683 805 | )]
|
684 - | pub struct RecursiveShapesInputOutputNested2 {
|
685 - | #[allow(missing_docs)] // documentation missing in model
|
686 - | pub bar: ::std::option::Option<::std::string::String>,
|
806 + | pub struct RenamedGreeting {
|
687 807 | #[allow(missing_docs)] // documentation missing in model
|
688 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
808 + | pub salutation: ::std::option::Option<::std::string::String>,
|
689 809 | }
|
690 - | impl RecursiveShapesInputOutputNested2 {
|
691 - | #[allow(missing_docs)] // documentation missing in model
|
692 - | pub fn bar(&self) -> ::std::option::Option<&str> {
|
693 - | self.bar.as_deref()
|
694 - | }
|
810 + | impl RenamedGreeting {
|
695 811 | #[allow(missing_docs)] // documentation missing in model
|
696 - | pub fn recursive_member(
|
697 - | &self,
|
698 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
699 - | self.recursive_member.as_ref()
|
812 + | pub fn salutation(&self) -> ::std::option::Option<&str> {
|
813 + | self.salutation.as_deref()
|
700 814 | }
|
701 815 | }
|
702 - | impl RecursiveShapesInputOutputNested2 {
|
703 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
704 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
705 - | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
816 + | impl RenamedGreeting {
|
817 + | /// Creates a new builder-style object to manufacture [`RenamedGreeting`](crate::model::RenamedGreeting).
|
818 + | pub fn builder() -> crate::model::renamed_greeting::Builder {
|
819 + | crate::model::renamed_greeting::Builder::default()
|
706 820 | }
|
707 821 | }
|
708 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
709 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested2::Builder;
|
822 + | impl crate::constrained::Constrained for crate::model::RenamedGreeting {
|
823 + | type Unconstrained = crate::model::renamed_greeting::Builder;
|
710 824 | }
|
711 825 |
|
712 826 | #[allow(missing_docs)] // documentation missing in model
|
713 - | ///
|
714 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
715 - | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
716 - | ///
|
717 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
718 - | ///
|
719 827 | #[derive(
|
720 828 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
721 829 | )]
|
722 - | pub struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
723 - | impl IntegerEnumSet {
|
724 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
725 - | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
726 - | &self.0
|
830 + | pub struct GreetingStruct {
|
831 + | #[allow(missing_docs)] // documentation missing in model
|
832 + | pub hi: ::std::option::Option<::std::string::String>,
|
833 + | }
|
834 + | impl GreetingStruct {
|
835 + | #[allow(missing_docs)] // documentation missing in model
|
836 + | pub fn hi(&self) -> ::std::option::Option<&str> {
|
837 + | self.hi.as_deref()
|
727 838 | }
|
728 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
729 - | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
730 - | self.0
|
839 + | }
|
840 + | impl GreetingStruct {
|
841 + | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
842 + | pub fn builder() -> crate::model::greeting_struct::Builder {
|
843 + | crate::model::greeting_struct::Builder::default()
|
731 844 | }
|
845 + | }
|
846 + | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
847 + | type Unconstrained = crate::model::greeting_struct::Builder;
|
848 + | }
|
732 849 |
|
733 - | fn check_unique_items(
|
734 - | items: ::std::vec::Vec<i32>,
|
735 - | ) -> Result<::std::vec::Vec<i32>, crate::model::integer_enum_set::ConstraintViolation> {
|
736 - | let mut seen = ::std::collections::HashMap::new();
|
737 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
738 - | for (idx, item) in items.iter().enumerate() {
|
739 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
740 - | duplicate_indices.push(prev_idx);
|
741 - | }
|
742 - | }
|
743 - |
|
744 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
745 - | for idx in &duplicate_indices {
|
746 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
747 - | last_duplicate_indices.push(prev_idx);
|
748 - | }
|
749 - | }
|
750 - | duplicate_indices.extend(last_duplicate_indices);
|
751 - |
|
752 - | if !duplicate_indices.is_empty() {
|
753 - | debug_assert!(duplicate_indices.len() >= 2);
|
754 - | Err(
|
755 - | crate::model::integer_enum_set::ConstraintViolation::UniqueItems {
|
756 - | duplicate_indices,
|
757 - | original: items,
|
758 - | },
|
850 + | #[allow(missing_docs)] // documentation missing in model
|
851 + | #[derive(
|
852 + | ::std::clone::Clone,
|
853 + | ::std::cmp::Eq,
|
854 + | ::std::cmp::Ord,
|
855 + | ::std::cmp::PartialEq,
|
856 + | ::std::cmp::PartialOrd,
|
857 + | ::std::fmt::Debug,
|
858 + | ::std::hash::Hash,
|
859 + | )]
|
860 + | pub enum FooEnum {
|
861 + | #[allow(missing_docs)] // documentation missing in model
|
862 + | Zero,
|
863 + | #[allow(missing_docs)] // documentation missing in model
|
864 + | One,
|
865 + | #[allow(missing_docs)] // documentation missing in model
|
866 + | Bar,
|
867 + | #[allow(missing_docs)] // documentation missing in model
|
868 + | Baz,
|
869 + | #[allow(missing_docs)] // documentation missing in model
|
870 + | Foo,
|
871 + | }
|
872 + | /// See [`FooEnum`](crate::model::FooEnum).
|
873 + | pub mod foo_enum {
|
874 + | #[derive(Debug, PartialEq)]
|
875 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
876 + |
|
877 + | impl ::std::fmt::Display for ConstraintViolation {
|
878 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
879 + | write!(
|
880 + | f,
|
881 + | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
759 882 | )
|
760 - | } else {
|
761 - | Ok(items)
|
762 883 | }
|
763 884 | }
|
764 - | }
|
765 - | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
766 - | type Error = crate::model::integer_enum_set::ConstraintViolation;
|
767 - |
|
768 - | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
769 - | fn try_from(value: ::std::vec::Vec<i32>) -> Result<Self, Self::Error> {
|
770 - | let value = Self::check_unique_items(value)?;
|
771 885 |
|
772 - | Ok(Self(value))
|
886 + | impl ::std::error::Error for ConstraintViolation {}
|
887 + | impl ConstraintViolation {
|
888 + | pub(crate) fn as_validation_exception_field(
|
889 + | self,
|
890 + | path: ::std::string::String,
|
891 + | ) -> crate::model::ValidationExceptionField {
|
892 + | crate::model::ValidationExceptionField {
|
893 + | message: format!(
|
894 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
895 + | &path
|
896 + | ),
|
897 + | path,
|
898 + | }
|
899 + | }
|
773 900 | }
|
774 901 | }
|
775 - |
|
776 - | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
777 - | fn from(value: IntegerEnumSet) -> Self {
|
778 - | value.into_inner()
|
902 + | impl ::std::convert::TryFrom<&str> for FooEnum {
|
903 + | type Error = crate::model::foo_enum::ConstraintViolation;
|
904 + | fn try_from(
|
905 + | s: &str,
|
906 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
907 + | match s {
|
908 + | "0" => Ok(FooEnum::Zero),
|
909 + | "1" => Ok(FooEnum::One),
|
910 + | "Bar" => Ok(FooEnum::Bar),
|
911 + | "Baz" => Ok(FooEnum::Baz),
|
912 + | "Foo" => Ok(FooEnum::Foo),
|
913 + | _ => Err(crate::model::foo_enum::ConstraintViolation(s.to_owned())),
|
914 + | }
|
779 915 | }
|
780 916 | }
|
781 - | impl crate::constrained::Constrained for IntegerEnumSet {
|
782 - | type Unconstrained =
|
783 - | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
917 + | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
918 + | type Error = crate::model::foo_enum::ConstraintViolation;
|
919 + | fn try_from(
|
920 + | s: ::std::string::String,
|
921 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
922 + | {
|
923 + | s.as_str().try_into()
|
924 + | }
|
925 + | }
|
926 + | impl std::str::FromStr for FooEnum {
|
927 + | type Err = crate::model::foo_enum::ConstraintViolation;
|
928 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
929 + | Self::try_from(s)
|
930 + | }
|
931 + | }
|
932 + | impl FooEnum {
|
933 + | /// Returns the `&str` value of the enum member.
|
934 + | pub fn as_str(&self) -> &str {
|
935 + | match self {
|
936 + | FooEnum::Zero => "0",
|
937 + | FooEnum::One => "1",
|
938 + | FooEnum::Bar => "Bar",
|
939 + | FooEnum::Baz => "Baz",
|
940 + | FooEnum::Foo => "Foo",
|
941 + | }
|
942 + | }
|
943 + | /// Returns all the `&str` representations of the enum members.
|
944 + | pub const fn values() -> &'static [&'static str] {
|
945 + | &["0", "1", "Bar", "Baz", "Foo"]
|
946 + | }
|
947 + | }
|
948 + | impl ::std::convert::AsRef<str> for FooEnum {
|
949 + | fn as_ref(&self) -> &str {
|
950 + | self.as_str()
|
951 + | }
|
952 + | }
|
953 + | impl crate::constrained::Constrained for FooEnum {
|
954 + | type Unconstrained = ::std::string::String;
|
955 + | }
|
956 + |
|
957 + | impl ::std::convert::From<::std::string::String>
|
958 + | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
959 + | {
|
960 + | fn from(value: ::std::string::String) -> Self {
|
961 + | Self::Unconstrained(value)
|
962 + | }
|
784 963 | }
|
785 964 |
|
786 965 | #[allow(missing_docs)] // documentation missing in model
|
787 966 | ///
|
788 967 | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
789 - | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
968 + | /// [constraint traits]. Use [`StringSet::try_from`] to construct values of this type.
|
790 969 | ///
|
791 970 | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
792 971 | ///
|
793 972 | #[derive(
|
794 973 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
795 974 | )]
|
796 - | pub struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
797 - | impl FooEnumSet {
|
798 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
799 - | pub fn inner(&self) -> &::std::vec::Vec<crate::model::FooEnum> {
|
975 + | pub struct StringSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
976 + | impl StringSet {
|
977 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<::std::string::String>`].
|
978 + | pub fn inner(&self) -> &::std::vec::Vec<::std::string::String> {
|
800 979 | &self.0
|
801 980 | }
|
802 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
803 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
981 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
982 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
804 983 | self.0
|
805 984 | }
|
806 985 |
|
807 986 | fn check_unique_items(
|
808 - | items: ::std::vec::Vec<crate::model::FooEnum>,
|
809 - | ) -> Result<
|
810 - | ::std::vec::Vec<crate::model::FooEnum>,
|
811 - | crate::model::foo_enum_set::ConstraintViolation,
|
812 - | > {
|
987 + | items: ::std::vec::Vec<::std::string::String>,
|
988 + | ) -> Result<::std::vec::Vec<::std::string::String>, crate::model::string_set::ConstraintViolation>
|
989 + | {
|
813 990 | let mut seen = ::std::collections::HashMap::new();
|
814 991 | let mut duplicate_indices = ::std::vec::Vec::new();
|
815 992 | for (idx, item) in items.iter().enumerate() {
|
816 993 | if let Some(prev_idx) = seen.insert(item, idx) {
|
817 994 | duplicate_indices.push(prev_idx);
|
818 995 | }
|
819 996 | }
|
820 997 |
|
821 998 | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
822 999 | for idx in &duplicate_indices {
|
823 1000 | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
824 1001 | last_duplicate_indices.push(prev_idx);
|
825 1002 | }
|
826 1003 | }
|
827 1004 | duplicate_indices.extend(last_duplicate_indices);
|
828 1005 |
|
829 1006 | if !duplicate_indices.is_empty() {
|
830 1007 | debug_assert!(duplicate_indices.len() >= 2);
|
831 - | Err(
|
832 - | crate::model::foo_enum_set::ConstraintViolation::UniqueItems {
|
833 - | duplicate_indices,
|
834 - | original: items,
|
835 - | },
|
836 - | )
|
1008 + | Err(crate::model::string_set::ConstraintViolation::UniqueItems {
|
1009 + | duplicate_indices,
|
1010 + | original: items,
|
1011 + | })
|
837 1012 | } else {
|
838 1013 | Ok(items)
|
839 1014 | }
|
840 1015 | }
|
841 1016 | }
|
842 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
843 - | type Error = crate::model::foo_enum_set::ConstraintViolation;
|
1017 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for StringSet {
|
1018 + | type Error = crate::model::string_set::ConstraintViolation;
|
844 1019 |
|
845 - | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
846 - | fn try_from(value: ::std::vec::Vec<crate::model::FooEnum>) -> Result<Self, Self::Error> {
|
1020 + | /// Constructs a `StringSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
1021 + | fn try_from(value: ::std::vec::Vec<::std::string::String>) -> Result<Self, Self::Error> {
|
847 1022 | let value = Self::check_unique_items(value)?;
|
848 1023 |
|
849 1024 | Ok(Self(value))
|
850 1025 | }
|
851 1026 | }
|
852 1027 |
|
853 - | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
854 - | fn from(value: FooEnumSet) -> Self {
|
1028 + | impl ::std::convert::From<StringSet> for ::std::vec::Vec<::std::string::String> {
|
1029 + | fn from(value: StringSet) -> Self {
|
855 1030 | value.into_inner()
|
856 1031 | }
|
857 1032 | }
|
858 - | impl crate::constrained::Constrained for FooEnumSet {
|
859 - | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
1033 + | impl crate::constrained::Constrained for StringSet {
|
1034 + | type Unconstrained = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained;
|
860 1035 | }
|
861 1036 |
|
862 1037 | #[allow(missing_docs)] // documentation missing in model
|
863 1038 | #[derive(
|
864 1039 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
865 1040 | )]
|
866 - | pub struct ComplexNestedErrorData {
|
1041 + | pub struct StructureListMember {
|
867 1042 | #[allow(missing_docs)] // documentation missing in model
|
868 - | pub foo: ::std::option::Option<::std::string::String>,
|
1043 + | pub a: ::std::option::Option<::std::string::String>,
|
1044 + | #[allow(missing_docs)] // documentation missing in model
|
1045 + | pub b: ::std::option::Option<::std::string::String>,
|
869 1046 | }
|
870 - | impl ComplexNestedErrorData {
|
1047 + | impl StructureListMember {
|
871 1048 | #[allow(missing_docs)] // documentation missing in model
|
872 - | pub fn foo(&self) -> ::std::option::Option<&str> {
|
873 - | self.foo.as_deref()
|
1049 + | pub fn a(&self) -> ::std::option::Option<&str> {
|
1050 + | self.a.as_deref()
|
1051 + | }
|
1052 + | #[allow(missing_docs)] // documentation missing in model
|
1053 + | pub fn b(&self) -> ::std::option::Option<&str> {
|
1054 + | self.b.as_deref()
|
874 1055 | }
|
875 1056 | }
|
876 - | impl ComplexNestedErrorData {
|
877 - | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
878 - | pub fn builder() -> crate::model::complex_nested_error_data::Builder {
|
879 - | crate::model::complex_nested_error_data::Builder::default()
|
1057 + | impl StructureListMember {
|
1058 + | /// Creates a new builder-style object to manufacture [`StructureListMember`](crate::model::StructureListMember).
|
1059 + | pub fn builder() -> crate::model::structure_list_member::Builder {
|
1060 + | crate::model::structure_list_member::Builder::default()
|
880 1061 | }
|
881 1062 | }
|
1063 + | impl crate::constrained::Constrained for crate::model::StructureListMember {
|
1064 + | type Unconstrained = crate::model::structure_list_member::Builder;
|
1065 + | }
|
882 1066 |
|
883 1067 | #[allow(missing_docs)] // documentation missing in model
|
884 1068 | #[derive(
|
885 1069 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
886 1070 | )]
|
887 - | pub enum UnionPayload {
|
1071 + | pub struct RecursiveShapesInputOutputNested1 {
|
888 1072 | #[allow(missing_docs)] // documentation missing in model
|
889 - | Greeting(::std::string::String),
|
1073 + | pub foo: ::std::option::Option<::std::string::String>,
|
1074 + | #[allow(missing_docs)] // documentation missing in model
|
1075 + | pub nested:
|
1076 + | ::std::option::Option<::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>>,
|
890 1077 | }
|
891 - | impl UnionPayload {
|
892 - | #[allow(irrefutable_let_patterns)]
|
893 - | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
894 - | /// Returns `Err(&Self)` if it can't be converted.
|
895 - | pub fn as_greeting(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
896 - | if let UnionPayload::Greeting(val) = &self {
|
897 - | ::std::result::Result::Ok(val)
|
898 - | } else {
|
899 - | ::std::result::Result::Err(self)
|
900 - | }
|
1078 + | impl RecursiveShapesInputOutputNested1 {
|
1079 + | #[allow(missing_docs)] // documentation missing in model
|
1080 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
1081 + | self.foo.as_deref()
|
901 1082 | }
|
902 - | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
903 - | pub fn is_greeting(&self) -> bool {
|
904 - | self.as_greeting().is_ok()
|
1083 + | #[allow(missing_docs)] // documentation missing in model
|
1084 + | pub fn nested(
|
1085 + | &self,
|
1086 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested2> {
|
1087 + | self.nested.as_deref()
|
1088 + | }
|
1089 + | }
|
1090 + | impl RecursiveShapesInputOutputNested1 {
|
1091 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
1092 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
1093 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
905 1094 | }
|
906 1095 | }
|
1096 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
1097 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1::Builder;
|
1098 + | }
|
907 1099 |
|
908 1100 | #[allow(missing_docs)] // documentation missing in model
|
909 1101 | #[derive(
|
910 - | ::std::clone::Clone,
|
911 - | ::std::cmp::Eq,
|
912 - | ::std::cmp::Ord,
|
913 - | ::std::cmp::PartialEq,
|
914 - | ::std::cmp::PartialOrd,
|
915 - | ::std::fmt::Debug,
|
916 - | ::std::hash::Hash,
|
1102 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
917 1103 | )]
|
918 - | pub enum StringEnum {
|
1104 + | pub struct RecursiveShapesInputOutputNested2 {
|
919 1105 | #[allow(missing_docs)] // documentation missing in model
|
920 - | V,
|
1106 + | pub bar: ::std::option::Option<::std::string::String>,
|
1107 + | #[allow(missing_docs)] // documentation missing in model
|
1108 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
921 1109 | }
|
922 - | /// See [`StringEnum`](crate::model::StringEnum).
|
923 - | pub mod string_enum {
|
924 - | #[derive(Debug, PartialEq)]
|
925 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
926 - |
|
927 - | impl ::std::fmt::Display for ConstraintViolation {
|
1110 + | impl RecursiveShapesInputOutputNested2 {
|
1111 + | #[allow(missing_docs)] // documentation missing in model
|
1112 + | pub fn bar(&self) -> ::std::option::Option<&str> {
|
1113 + | self.bar.as_deref()
|
1114 + | }
|
1115 + | #[allow(missing_docs)] // documentation missing in model
|
1116 + | pub fn recursive_member(
|
1117 + | &self,
|
1118 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
1119 + | self.recursive_member.as_ref()
|
1120 + | }
|
1121 + | }
|
1122 + | impl RecursiveShapesInputOutputNested2 {
|
1123 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
1124 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
1125 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
1126 + | }
|
1127 + | }
|
1128 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
1129 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2::Builder;
|
1130 + | }
|
1131 + |
|
1132 + | #[allow(missing_docs)] // documentation missing in model
|
1133 + | ///
|
1134 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1135 + | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
1136 + | ///
|
1137 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1138 + | ///
|
1139 + | #[derive(
|
1140 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1141 + | )]
|
1142 + | pub struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
1143 + | impl IntegerEnumSet {
|
1144 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
1145 + | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
1146 + | &self.0
|
1147 + | }
|
1148 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
1149 + | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
1150 + | self.0
|
1151 + | }
|
1152 + |
|
1153 + | fn check_unique_items(
|
1154 + | items: ::std::vec::Vec<i32>,
|
1155 + | ) -> Result<::std::vec::Vec<i32>, crate::model::integer_enum_set::ConstraintViolation> {
|
1156 + | let mut seen = ::std::collections::HashMap::new();
|
1157 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1158 + | for (idx, item) in items.iter().enumerate() {
|
1159 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1160 + | duplicate_indices.push(prev_idx);
|
1161 + | }
|
1162 + | }
|
1163 + |
|
1164 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1165 + | for idx in &duplicate_indices {
|
1166 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1167 + | last_duplicate_indices.push(prev_idx);
|
1168 + | }
|
1169 + | }
|
1170 + | duplicate_indices.extend(last_duplicate_indices);
|
1171 + |
|
1172 + | if !duplicate_indices.is_empty() {
|
1173 + | debug_assert!(duplicate_indices.len() >= 2);
|
1174 + | Err(
|
1175 + | crate::model::integer_enum_set::ConstraintViolation::UniqueItems {
|
1176 + | duplicate_indices,
|
1177 + | original: items,
|
1178 + | },
|
1179 + | )
|
1180 + | } else {
|
1181 + | Ok(items)
|
1182 + | }
|
1183 + | }
|
1184 + | }
|
1185 + | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
1186 + | type Error = crate::model::integer_enum_set::ConstraintViolation;
|
1187 + |
|
1188 + | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
1189 + | fn try_from(value: ::std::vec::Vec<i32>) -> Result<Self, Self::Error> {
|
1190 + | let value = Self::check_unique_items(value)?;
|
1191 + |
|
1192 + | Ok(Self(value))
|
1193 + | }
|
1194 + | }
|
1195 + |
|
1196 + | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
1197 + | fn from(value: IntegerEnumSet) -> Self {
|
1198 + | value.into_inner()
|
1199 + | }
|
1200 + | }
|
1201 + | impl crate::constrained::Constrained for IntegerEnumSet {
|
1202 + | type Unconstrained =
|
1203 + | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
1204 + | }
|
1205 + |
|
1206 + | #[allow(missing_docs)] // documentation missing in model
|
1207 + | ///
|
1208 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1209 + | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
1210 + | ///
|
1211 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1212 + | ///
|
1213 + | #[derive(
|
1214 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1215 + | )]
|
1216 + | pub struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
1217 + | impl FooEnumSet {
|
1218 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
1219 + | pub fn inner(&self) -> &::std::vec::Vec<crate::model::FooEnum> {
|
1220 + | &self.0
|
1221 + | }
|
1222 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
1223 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
1224 + | self.0
|
1225 + | }
|
1226 + |
|
1227 + | fn check_unique_items(
|
1228 + | items: ::std::vec::Vec<crate::model::FooEnum>,
|
1229 + | ) -> Result<
|
1230 + | ::std::vec::Vec<crate::model::FooEnum>,
|
1231 + | crate::model::foo_enum_set::ConstraintViolation,
|
1232 + | > {
|
1233 + | let mut seen = ::std::collections::HashMap::new();
|
1234 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
1235 + | for (idx, item) in items.iter().enumerate() {
|
1236 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
1237 + | duplicate_indices.push(prev_idx);
|
1238 + | }
|
1239 + | }
|
1240 + |
|
1241 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1242 + | for idx in &duplicate_indices {
|
1243 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1244 + | last_duplicate_indices.push(prev_idx);
|
1245 + | }
|
1246 + | }
|
1247 + | duplicate_indices.extend(last_duplicate_indices);
|
1248 + |
|
1249 + | if !duplicate_indices.is_empty() {
|
1250 + | debug_assert!(duplicate_indices.len() >= 2);
|
1251 + | Err(
|
1252 + | crate::model::foo_enum_set::ConstraintViolation::UniqueItems {
|
1253 + | duplicate_indices,
|
1254 + | original: items,
|
1255 + | },
|
1256 + | )
|
1257 + | } else {
|
1258 + | Ok(items)
|
1259 + | }
|
1260 + | }
|
1261 + | }
|
1262 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
1263 + | type Error = crate::model::foo_enum_set::ConstraintViolation;
|
1264 + |
|
1265 + | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
1266 + | fn try_from(value: ::std::vec::Vec<crate::model::FooEnum>) -> Result<Self, Self::Error> {
|
1267 + | let value = Self::check_unique_items(value)?;
|
1268 + |
|
1269 + | Ok(Self(value))
|
1270 + | }
|
1271 + | }
|
1272 + |
|
1273 + | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
1274 + | fn from(value: FooEnumSet) -> Self {
|
1275 + | value.into_inner()
|
1276 + | }
|
1277 + | }
|
1278 + | impl crate::constrained::Constrained for FooEnumSet {
|
1279 + | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
1280 + | }
|
1281 + |
|
1282 + | #[allow(missing_docs)] // documentation missing in model
|
1283 + | #[derive(
|
1284 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1285 + | )]
|
1286 + | pub struct ComplexNestedErrorData {
|
1287 + | #[allow(missing_docs)] // documentation missing in model
|
1288 + | pub foo: ::std::option::Option<::std::string::String>,
|
1289 + | }
|
1290 + | impl ComplexNestedErrorData {
|
1291 + | #[allow(missing_docs)] // documentation missing in model
|
1292 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
1293 + | self.foo.as_deref()
|
1294 + | }
|
1295 + | }
|
1296 + | impl ComplexNestedErrorData {
|
1297 + | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
1298 + | pub fn builder() -> crate::model::complex_nested_error_data::Builder {
|
1299 + | crate::model::complex_nested_error_data::Builder::default()
|
1300 + | }
|
1301 + | }
|
1302 + |
|
1303 + | #[allow(missing_docs)] // documentation missing in model
|
1304 + | #[derive(
|
1305 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1306 + | )]
|
1307 + | pub enum UnionPayload {
|
1308 + | #[allow(missing_docs)] // documentation missing in model
|
1309 + | Greeting(::std::string::String),
|
1310 + | }
|
1311 + | impl UnionPayload {
|
1312 + | #[allow(irrefutable_let_patterns)]
|
1313 + | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
1314 + | /// Returns `Err(&Self)` if it can't be converted.
|
1315 + | pub fn as_greeting(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1316 + | if let UnionPayload::Greeting(val) = &self {
|
1317 + | ::std::result::Result::Ok(val)
|
1318 + | } else {
|
1319 + | ::std::result::Result::Err(self)
|
1320 + | }
|
1321 + | }
|
1322 + | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
1323 + | pub fn is_greeting(&self) -> bool {
|
1324 + | self.as_greeting().is_ok()
|
1325 + | }
|
1326 + | }
|
1327 + |
|
1328 + | #[allow(missing_docs)] // documentation missing in model
|
1329 + | #[derive(
|
1330 + | ::std::clone::Clone,
|
1331 + | ::std::cmp::Eq,
|
1332 + | ::std::cmp::Ord,
|
1333 + | ::std::cmp::PartialEq,
|
1334 + | ::std::cmp::PartialOrd,
|
1335 + | ::std::fmt::Debug,
|
1336 + | ::std::hash::Hash,
|
1337 + | )]
|
1338 + | pub enum StringEnum {
|
1339 + | #[allow(missing_docs)] // documentation missing in model
|
1340 + | V,
|
1341 + | }
|
1342 + | /// See [`StringEnum`](crate::model::StringEnum).
|
1343 + | pub mod string_enum {
|
1344 + | #[derive(Debug, PartialEq)]
|
1345 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
1346 + |
|
1347 + | impl ::std::fmt::Display for ConstraintViolation {
|
928 1348 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
929 1349 | write!(
|
930 1350 | f,
|
931 1351 | r#"Value provided for 'aws.protocoltests.restjson#StringEnum' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#
|
932 1352 | )
|
933 1353 | }
|
934 1354 | }
|
935 1355 |
|
936 1356 | impl ::std::error::Error for ConstraintViolation {}
|
937 1357 | impl ConstraintViolation {
|
938 1358 | pub(crate) fn as_validation_exception_field(
|
939 1359 | self,
|
940 1360 | path: ::std::string::String,
|
941 1361 | ) -> crate::model::ValidationExceptionField {
|
942 1362 | crate::model::ValidationExceptionField {
|
943 1363 | message: format!(
|
944 1364 | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#,
|
945 1365 | &path
|
946 1366 | ),
|
947 1367 | path,
|
948 1368 | }
|
949 1369 | }
|
950 - | }
|
951 - | }
|
952 - | impl ::std::convert::TryFrom<&str> for StringEnum {
|
953 - | type Error = crate::model::string_enum::ConstraintViolation;
|
954 - | fn try_from(
|
955 - | s: &str,
|
956 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
957 - | match s {
|
958 - | "enumvalue" => Ok(StringEnum::V),
|
959 - | _ => Err(crate::model::string_enum::ConstraintViolation(s.to_owned())),
|
1370 + | }
|
1371 + | }
|
1372 + | impl ::std::convert::TryFrom<&str> for StringEnum {
|
1373 + | type Error = crate::model::string_enum::ConstraintViolation;
|
1374 + | fn try_from(
|
1375 + | s: &str,
|
1376 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1377 + | match s {
|
1378 + | "enumvalue" => Ok(StringEnum::V),
|
1379 + | _ => Err(crate::model::string_enum::ConstraintViolation(s.to_owned())),
|
1380 + | }
|
1381 + | }
|
1382 + | }
|
1383 + | impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
|
1384 + | type Error = crate::model::string_enum::ConstraintViolation;
|
1385 + | fn try_from(
|
1386 + | s: ::std::string::String,
|
1387 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1388 + | {
|
1389 + | s.as_str().try_into()
|
1390 + | }
|
1391 + | }
|
1392 + | impl std::str::FromStr for StringEnum {
|
1393 + | type Err = crate::model::string_enum::ConstraintViolation;
|
1394 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1395 + | Self::try_from(s)
|
1396 + | }
|
1397 + | }
|
1398 + | impl StringEnum {
|
1399 + | /// Returns the `&str` value of the enum member.
|
1400 + | pub fn as_str(&self) -> &str {
|
1401 + | match self {
|
1402 + | StringEnum::V => "enumvalue",
|
1403 + | }
|
1404 + | }
|
1405 + | /// Returns all the `&str` representations of the enum members.
|
1406 + | pub const fn values() -> &'static [&'static str] {
|
1407 + | &["enumvalue"]
|
1408 + | }
|
1409 + | }
|
1410 + | impl ::std::convert::AsRef<str> for StringEnum {
|
1411 + | fn as_ref(&self) -> &str {
|
1412 + | self.as_str()
|
1413 + | }
|
1414 + | }
|
1415 + | impl crate::constrained::Constrained for StringEnum {
|
1416 + | type Unconstrained = ::std::string::String;
|
1417 + | }
|
1418 + |
|
1419 + | impl ::std::convert::From<::std::string::String>
|
1420 + | for crate::constrained::MaybeConstrained<crate::model::StringEnum>
|
1421 + | {
|
1422 + | fn from(value: ::std::string::String) -> Self {
|
1423 + | Self::Unconstrained(value)
|
1424 + | }
|
1425 + | }
|
1426 + |
|
1427 + | #[allow(missing_docs)] // documentation missing in model
|
1428 + | #[derive(
|
1429 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1430 + | )]
|
1431 + | pub struct NestedPayload {
|
1432 + | #[allow(missing_docs)] // documentation missing in model
|
1433 + | pub greeting: ::std::option::Option<::std::string::String>,
|
1434 + | #[allow(missing_docs)] // documentation missing in model
|
1435 + | pub name: ::std::option::Option<::std::string::String>,
|
1436 + | }
|
1437 + | impl NestedPayload {
|
1438 + | #[allow(missing_docs)] // documentation missing in model
|
1439 + | pub fn greeting(&self) -> ::std::option::Option<&str> {
|
1440 + | self.greeting.as_deref()
|
1441 + | }
|
1442 + | #[allow(missing_docs)] // documentation missing in model
|
1443 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
1444 + | self.name.as_deref()
|
1445 + | }
|
1446 + | }
|
1447 + | impl NestedPayload {
|
1448 + | /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::model::NestedPayload).
|
1449 + | pub fn builder() -> crate::model::nested_payload::Builder {
|
1450 + | crate::model::nested_payload::Builder::default()
|
1451 + | }
|
1452 + | }
|
1453 + | impl crate::constrained::Constrained for crate::model::NestedPayload {
|
1454 + | type Unconstrained = crate::model::nested_payload::Builder;
|
1455 + | }
|
1456 + |
|
1457 + | #[allow(missing_docs)] // documentation missing in model
|
1458 + | ///
|
1459 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1460 + | /// [constraint traits]. Use [`IntegerSet::try_from`] to construct values of this type.
|
1461 + | ///
|
1462 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1463 + | ///
|
1464 + | #[derive(
|
1465 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1466 + | )]
|
1467 + | pub struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
1468 + | impl IntegerSet {
|
1469 + | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
1470 + | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
1471 + | &self.0
|
1472 + | }
|
1473 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
1474 + | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
1475 + | self.0
|
1476 + | }
|
1477 + |
|
1478 + | fn check_unique_items(
|
1479 + | items: ::std::vec::Vec<i32>,
|
1480 + | ) -> Result<::std::vec::Vec<i32>, crate::model::integer_set::ConstraintViolation> {
|
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 + | }
|
1487 + | }
|
1488 + |
|
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);
|
1496 + |
|
1497 + | if !duplicate_indices.is_empty() {
|
1498 + | debug_assert!(duplicate_indices.len() >= 2);
|
1499 + | Err(
|
1500 + | crate::model::integer_set::ConstraintViolation::UniqueItems {
|
1501 + | duplicate_indices,
|
1502 + | original: items,
|
1503 + | },
|
1504 + | )
|
1505 + | } else {
|
1506 + | Ok(items)
|
1507 + | }
|
1508 + | }
|
1509 + | }
|
1510 + | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerSet {
|
1511 + | type Error = crate::model::integer_set::ConstraintViolation;
|
1512 + |
|
1513 + | /// Constructs a `IntegerSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
1514 + | fn try_from(value: ::std::vec::Vec<i32>) -> Result<Self, Self::Error> {
|
1515 + | let value = Self::check_unique_items(value)?;
|
1516 + |
|
1517 + | Ok(Self(value))
|
1518 + | }
|
1519 + | }
|
1520 + |
|
1521 + | impl ::std::convert::From<IntegerSet> for ::std::vec::Vec<i32> {
|
1522 + | fn from(value: IntegerSet) -> Self {
|
1523 + | value.into_inner()
|
1524 + | }
|
1525 + | }
|
1526 + | impl crate::constrained::Constrained for IntegerSet {
|
1527 + | type Unconstrained = crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained;
|
1528 + | }
|
1529 + |
|
1530 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1531 + | ///
|
1532 + | pub mod validation_exception_field {
|
1533 + |
|
1534 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1535 + | /// Holds one variant for each of the ways the builder can fail.
|
1536 + | #[non_exhaustive]
|
1537 + | #[allow(clippy::enum_variant_names)]
|
1538 + | pub enum ConstraintViolation {
|
1539 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
1540 + | MissingPath,
|
1541 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
1542 + | MissingMessage,
|
1543 + | }
|
1544 + | impl ::std::fmt::Display for ConstraintViolation {
|
1545 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1546 + | match self {
|
1547 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
1548 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
1549 + | }
|
1550 + | }
|
1551 + | }
|
1552 + | impl ::std::error::Error for ConstraintViolation {}
|
1553 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
1554 + | type Error = ConstraintViolation;
|
1555 + |
|
1556 + | fn try_from(builder: Builder) -> Result<Self, Self::Error> {
|
1557 + | builder.build()
|
1558 + | }
|
1559 + | }
|
1560 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1561 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1562 + | pub struct Builder {
|
1563 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
1564 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
1565 + | }
|
1566 + | impl Builder {
|
1567 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
1568 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
1569 + | self.path = Some(input);
|
1570 + | self
|
1571 + | }
|
1572 + | /// A detailed description of the validation failure.
|
1573 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
1574 + | self.message = Some(input);
|
1575 + | self
|
1576 + | }
|
1577 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
1578 + | ///
|
1579 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
1580 + | ///
|
1581 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
1582 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
1583 + | self.build_enforcing_all_constraints()
|
1584 + | }
|
1585 + | fn build_enforcing_all_constraints(
|
1586 + | self,
|
1587 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
1588 + | Ok(crate::model::ValidationExceptionField {
|
1589 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
1590 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
1591 + | })
|
1592 + | }
|
1593 + | }
|
1594 + | }
|
1595 + | /// See [`Dialog`](crate::model::Dialog).
|
1596 + | ///
|
1597 + | pub mod dialog {
|
1598 + |
|
1599 + | impl ::std::convert::From<Builder> for crate::model::Dialog {
|
1600 + | fn from(builder: Builder) -> Self {
|
1601 + | builder.build()
|
1602 + | }
|
1603 + | }
|
1604 + | /// A builder for [`Dialog`](crate::model::Dialog).
|
1605 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1606 + | pub struct Builder {
|
1607 + | pub(crate) language: ::std::option::Option<::std::string::String>,
|
1608 + | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
1609 + | pub(crate) farewell: ::std::option::Option<crate::model::Farewell>,
|
1610 + | }
|
1611 + | impl Builder {
|
1612 + | #[allow(missing_docs)] // documentation missing in model
|
1613 + | pub fn language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
1614 + | self.language = input;
|
1615 + | self
|
1616 + | }
|
1617 + | #[allow(missing_docs)] // documentation missing in model
|
1618 + | pub(crate) fn set_language(
|
1619 + | mut self,
|
1620 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
1621 + | ) -> Self {
|
1622 + | self.language = input.map(|v| v.into());
|
1623 + | self
|
1624 + | }
|
1625 + | #[allow(missing_docs)] // documentation missing in model
|
1626 + | pub fn greeting(mut self, input: ::std::string::String) -> Self {
|
1627 + | self.greeting = Some(input);
|
1628 + | self
|
1629 + | }
|
1630 + | #[allow(missing_docs)] // documentation missing in model
|
1631 + | pub(crate) fn set_greeting(
|
1632 + | mut self,
|
1633 + | input: impl ::std::convert::Into<::std::string::String>,
|
1634 + | ) -> Self {
|
1635 + | self.greeting = Some(input.into());
|
1636 + | self
|
1637 + | }
|
1638 + | #[allow(missing_docs)] // documentation missing in model
|
1639 + | pub fn farewell(mut self, input: ::std::option::Option<crate::model::Farewell>) -> Self {
|
1640 + | self.farewell = input;
|
1641 + | self
|
1642 + | }
|
1643 + | #[allow(missing_docs)] // documentation missing in model
|
1644 + | pub(crate) fn set_farewell(
|
1645 + | mut self,
|
1646 + | input: Option<impl ::std::convert::Into<crate::model::Farewell>>,
|
1647 + | ) -> Self {
|
1648 + | self.farewell = input.map(|v| v.into());
|
1649 + | self
|
1650 + | }
|
1651 + | /// Consumes the builder and constructs a [`Dialog`](crate::model::Dialog).
|
1652 + | pub fn build(self) -> crate::model::Dialog {
|
1653 + | self.build_enforcing_all_constraints()
|
1654 + | }
|
1655 + | fn build_enforcing_all_constraints(self) -> crate::model::Dialog {
|
1656 + | crate::model::Dialog {
|
1657 + | language: self.language,
|
1658 + | greeting: self.greeting.unwrap_or_else(
|
1659 + | #[allow(clippy::redundant_closure)]
|
1660 + | || String::from("hi"),
|
1661 + | ),
|
1662 + | farewell: self.farewell,
|
1663 + | }
|
1664 + | }
|
1665 + | }
|
1666 + | }
|
1667 + | /// See [`Farewell`](crate::model::Farewell).
|
1668 + | ///
|
1669 + | pub mod farewell {
|
1670 + |
|
1671 + | impl ::std::convert::From<Builder> for crate::model::Farewell {
|
1672 + | fn from(builder: Builder) -> Self {
|
1673 + | builder.build()
|
1674 + | }
|
1675 + | }
|
1676 + | /// A builder for [`Farewell`](crate::model::Farewell).
|
1677 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1678 + | pub struct Builder {
|
1679 + | pub(crate) phrase: ::std::option::Option<::std::string::String>,
|
1680 + | }
|
1681 + | impl Builder {
|
1682 + | #[allow(missing_docs)] // documentation missing in model
|
1683 + | pub fn phrase(mut self, input: ::std::string::String) -> Self {
|
1684 + | self.phrase = Some(input);
|
1685 + | self
|
1686 + | }
|
1687 + | #[allow(missing_docs)] // documentation missing in model
|
1688 + | pub(crate) fn set_phrase(
|
1689 + | mut self,
|
1690 + | input: impl ::std::convert::Into<::std::string::String>,
|
1691 + | ) -> Self {
|
1692 + | self.phrase = Some(input.into());
|
1693 + | self
|
1694 + | }
|
1695 + | /// Consumes the builder and constructs a [`Farewell`](crate::model::Farewell).
|
1696 + | pub fn build(self) -> crate::model::Farewell {
|
1697 + | self.build_enforcing_all_constraints()
|
1698 + | }
|
1699 + | fn build_enforcing_all_constraints(self) -> crate::model::Farewell {
|
1700 + | crate::model::Farewell {
|
1701 + | phrase: self.phrase.unwrap_or_else(
|
1702 + | #[allow(clippy::redundant_closure)]
|
1703 + | || String::from("bye"),
|
1704 + | ),
|
1705 + | }
|
1706 + | }
|
1707 + | }
|
1708 + | }
|
1709 + | /// See [`TopLevel`](crate::model::TopLevel).
|
1710 + | ///
|
1711 + | pub mod top_level {
|
1712 + |
|
1713 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1714 + | /// Holds one variant for each of the ways the builder can fail.
|
1715 + | #[non_exhaustive]
|
1716 + | #[allow(clippy::enum_variant_names)]
|
1717 + | pub enum ConstraintViolation {
|
1718 + | /// `dialog` was not provided but it is required when building `TopLevel`.
|
1719 + | MissingDialog,
|
1720 + | }
|
1721 + | impl ::std::fmt::Display for ConstraintViolation {
|
1722 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1723 + | match self {
|
1724 + | ConstraintViolation::MissingDialog => write!(
|
1725 + | f,
|
1726 + | "`dialog` was not provided but it is required when building `TopLevel`"
|
1727 + | ),
|
1728 + | }
|
1729 + | }
|
1730 + | }
|
1731 + | impl ::std::error::Error for ConstraintViolation {}
|
1732 + | impl ConstraintViolation {
|
1733 + | pub(crate) fn as_validation_exception_field(
|
1734 + | self,
|
1735 + | path: ::std::string::String,
|
1736 + | ) -> crate::model::ValidationExceptionField {
|
1737 + | match self {
|
1738 + | ConstraintViolation::MissingDialog => crate::model::ValidationExceptionField {
|
1739 + | message: format!("Value at '{}/dialog' failed to satisfy constraint: Member must not be null", path),
|
1740 + | path: path + "/dialog",
|
1741 + | },
|
1742 + | }
|
1743 + | }
|
1744 + | }
|
1745 + | impl ::std::convert::From<Builder>
|
1746 + | for crate::constrained::MaybeConstrained<crate::model::TopLevel>
|
1747 + | {
|
1748 + | fn from(builder: Builder) -> Self {
|
1749 + | Self::Unconstrained(builder)
|
1750 + | }
|
1751 + | }
|
1752 + | impl ::std::convert::TryFrom<Builder> for crate::model::TopLevel {
|
1753 + | type Error = ConstraintViolation;
|
1754 + |
|
1755 + | fn try_from(builder: Builder) -> Result<Self, Self::Error> {
|
1756 + | builder.build()
|
1757 + | }
|
1758 + | }
|
1759 + | /// A builder for [`TopLevel`](crate::model::TopLevel).
|
1760 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1761 + | pub struct Builder {
|
1762 + | pub(crate) dialog: ::std::option::Option<crate::model::Dialog>,
|
1763 + | pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::model::Dialog>>,
|
1764 + | pub(crate) dialog_map: ::std::option::Option<
|
1765 + | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
1766 + | >,
|
1767 + | }
|
1768 + | impl Builder {
|
1769 + | #[allow(missing_docs)] // documentation missing in model
|
1770 + | pub fn dialog(mut self, input: crate::model::Dialog) -> Self {
|
1771 + | self.dialog = Some(input);
|
1772 + | self
|
1773 + | }
|
1774 + | #[allow(missing_docs)] // documentation missing in model
|
1775 + | pub(crate) fn set_dialog(
|
1776 + | mut self,
|
1777 + | input: impl ::std::convert::Into<crate::model::Dialog>,
|
1778 + | ) -> Self {
|
1779 + | self.dialog = Some(input.into());
|
1780 + | self
|
1781 + | }
|
1782 + | #[allow(missing_docs)] // documentation missing in model
|
1783 + | pub fn dialog_list(mut self, input: ::std::vec::Vec<crate::model::Dialog>) -> Self {
|
1784 + | self.dialog_list = Some(input);
|
1785 + | self
|
1786 + | }
|
1787 + | #[allow(missing_docs)] // documentation missing in model
|
1788 + | pub(crate) fn set_dialog_list(
|
1789 + | mut self,
|
1790 + | input: impl ::std::convert::Into<::std::vec::Vec<crate::model::Dialog>>,
|
1791 + | ) -> Self {
|
1792 + | self.dialog_list = Some(input.into());
|
1793 + | self
|
1794 + | }
|
1795 + | #[allow(missing_docs)] // documentation missing in model
|
1796 + | pub fn dialog_map(
|
1797 + | mut self,
|
1798 + | input: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
1799 + | ) -> Self {
|
1800 + | self.dialog_map = Some(input);
|
1801 + | self
|
1802 + | }
|
1803 + | #[allow(missing_docs)] // documentation missing in model
|
1804 + | pub(crate) fn set_dialog_map(
|
1805 + | mut self,
|
1806 + | input: impl ::std::convert::Into<
|
1807 + | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
1808 + | >,
|
1809 + | ) -> Self {
|
1810 + | self.dialog_map = Some(input.into());
|
1811 + | self
|
1812 + | }
|
1813 + | /// Consumes the builder and constructs a [`TopLevel`](crate::model::TopLevel).
|
1814 + | ///
|
1815 + | /// The builder fails to construct a [`TopLevel`](crate::model::TopLevel) if a [`ConstraintViolation`] occurs.
|
1816 + | ///
|
1817 + | pub fn build(self) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
1818 + | self.build_enforcing_all_constraints()
|
1819 + | }
|
1820 + | fn build_enforcing_all_constraints(
|
1821 + | self,
|
1822 + | ) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
1823 + | Ok(crate::model::TopLevel {
|
1824 + | dialog: self.dialog.ok_or(ConstraintViolation::MissingDialog)?,
|
1825 + | dialog_list: self.dialog_list.unwrap_or_else(
|
1826 + | #[allow(clippy::redundant_closure)]
|
1827 + | || ::std::vec::Vec::new(),
|
1828 + | ),
|
1829 + | dialog_map: self.dialog_map.unwrap_or_else(
|
1830 + | #[allow(clippy::redundant_closure)]
|
1831 + | || ::std::collections::HashMap::new(),
|
1832 + | ),
|
1833 + | })
|
1834 + | }
|
1835 + | }
|
1836 + | }
|
1837 + | /// See [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
1838 + | ///
|
1839 + | pub mod client_optional_defaults {
|
1840 + |
|
1841 + | impl ::std::convert::From<Builder> for crate::model::ClientOptionalDefaults {
|
1842 + | fn from(builder: Builder) -> Self {
|
1843 + | builder.build()
|
1844 + | }
|
1845 + | }
|
1846 + | /// A builder for [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
1847 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1848 + | pub struct Builder {
|
1849 + | pub(crate) member: ::std::option::Option<i32>,
|
1850 + | }
|
1851 + | impl Builder {
|
1852 + | #[allow(missing_docs)] // documentation missing in model
|
1853 + | pub fn member(mut self, input: i32) -> Self {
|
1854 + | self.member = Some(input);
|
1855 + | self
|
1856 + | }
|
1857 + | #[allow(missing_docs)] // documentation missing in model
|
1858 + | pub(crate) fn set_member(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
1859 + | self.member = Some(input.into());
|
1860 + | self
|
1861 + | }
|
1862 + | /// Consumes the builder and constructs a [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
1863 + | pub fn build(self) -> crate::model::ClientOptionalDefaults {
|
1864 + | self.build_enforcing_all_constraints()
|
1865 + | }
|
1866 + | fn build_enforcing_all_constraints(self) -> crate::model::ClientOptionalDefaults {
|
1867 + | crate::model::ClientOptionalDefaults {
|
1868 + | member: self.member.unwrap_or(0i32),
|
1869 + | }
|
1870 + | }
|
1871 + | }
|
1872 + | }
|
1873 + | /// See [`Defaults`](crate::model::Defaults).
|
1874 + | ///
|
1875 + | pub mod defaults {
|
1876 + |
|
1877 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1878 + | /// Holds one variant for each of the ways the builder can fail.
|
1879 + | #[non_exhaustive]
|
1880 + | #[allow(clippy::enum_variant_names)]
|
1881 + | pub enum ConstraintViolation {
|
1882 + | /// Constraint violation occurred building member `default_enum` when building `Defaults`.
|
1883 + | #[doc(hidden)]
|
1884 + | DefaultEnum(crate::model::test_enum::ConstraintViolation),
|
1885 + | }
|
1886 + | impl ::std::fmt::Display for ConstraintViolation {
|
1887 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1888 + | match self {
|
1889 + | ConstraintViolation::DefaultEnum(_) => write!(f, "constraint violation occurred building member `default_enum` when building `Defaults`"),
|
1890 + | }
|
1891 + | }
|
1892 + | }
|
1893 + | impl ::std::error::Error for ConstraintViolation {}
|
1894 + | impl ConstraintViolation {
|
1895 + | pub(crate) fn as_validation_exception_field(
|
1896 + | self,
|
1897 + | path: ::std::string::String,
|
1898 + | ) -> crate::model::ValidationExceptionField {
|
1899 + | match self {
|
1900 + | ConstraintViolation::DefaultEnum(inner) => {
|
1901 + | inner.as_validation_exception_field(path + "/defaultEnum")
|
1902 + | }
|
1903 + | }
|
1904 + | }
|
1905 + | }
|
1906 + | impl ::std::convert::From<Builder>
|
1907 + | for crate::constrained::MaybeConstrained<crate::model::Defaults>
|
1908 + | {
|
1909 + | fn from(builder: Builder) -> Self {
|
1910 + | Self::Unconstrained(builder)
|
1911 + | }
|
1912 + | }
|
1913 + | impl ::std::convert::TryFrom<Builder> for crate::model::Defaults {
|
1914 + | type Error = ConstraintViolation;
|
1915 + |
|
1916 + | fn try_from(builder: Builder) -> Result<Self, Self::Error> {
|
1917 + | builder.build()
|
1918 + | }
|
1919 + | }
|
1920 + | /// A builder for [`Defaults`](crate::model::Defaults).
|
1921 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
1922 + | pub struct Builder {
|
1923 + | pub(crate) default_string: ::std::option::Option<::std::string::String>,
|
1924 + | pub(crate) default_boolean: ::std::option::Option<bool>,
|
1925 + | pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
1926 + | pub(crate) default_document_map: ::std::option::Option<::aws_smithy_types::Document>,
|
1927 + | pub(crate) default_document_string: ::std::option::Option<::aws_smithy_types::Document>,
|
1928 + | pub(crate) default_document_boolean: ::std::option::Option<::aws_smithy_types::Document>,
|
1929 + | pub(crate) default_document_list: ::std::option::Option<::aws_smithy_types::Document>,
|
1930 + | pub(crate) default_null_document: ::std::option::Option<::aws_smithy_types::Document>,
|
1931 + | pub(crate) default_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
|
1932 + | pub(crate) default_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1933 + | pub(crate) default_byte: ::std::option::Option<i8>,
|
1934 + | pub(crate) default_short: ::std::option::Option<i16>,
|
1935 + | pub(crate) default_integer: ::std::option::Option<i32>,
|
1936 + | pub(crate) default_long: ::std::option::Option<i64>,
|
1937 + | pub(crate) default_float: ::std::option::Option<f32>,
|
1938 + | pub(crate) default_double: ::std::option::Option<f64>,
|
1939 + | pub(crate) default_map: ::std::option::Option<
|
1940 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1941 + | >,
|
1942 + | pub(crate) default_enum:
|
1943 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TestEnum>>,
|
1944 + | pub(crate) default_int_enum: ::std::option::Option<i32>,
|
1945 + | pub(crate) empty_string: ::std::option::Option<::std::string::String>,
|
1946 + | pub(crate) false_boolean: ::std::option::Option<bool>,
|
1947 + | pub(crate) empty_blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
1948 + | pub(crate) zero_byte: ::std::option::Option<i8>,
|
1949 + | pub(crate) zero_short: ::std::option::Option<i16>,
|
1950 + | pub(crate) zero_integer: ::std::option::Option<i32>,
|
1951 + | pub(crate) zero_long: ::std::option::Option<i64>,
|
1952 + | pub(crate) zero_float: ::std::option::Option<f32>,
|
1953 + | pub(crate) zero_double: ::std::option::Option<f64>,
|
1954 + | }
|
1955 + | impl Builder {
|
1956 + | #[allow(missing_docs)] // documentation missing in model
|
1957 + | pub fn default_string(mut self, input: ::std::string::String) -> Self {
|
1958 + | self.default_string = Some(input);
|
1959 + | self
|
1960 + | }
|
1961 + | #[allow(missing_docs)] // documentation missing in model
|
1962 + | pub(crate) fn set_default_string(
|
1963 + | mut self,
|
1964 + | input: impl ::std::convert::Into<::std::string::String>,
|
1965 + | ) -> Self {
|
1966 + | self.default_string = Some(input.into());
|
1967 + | self
|
1968 + | }
|
1969 + | #[allow(missing_docs)] // documentation missing in model
|
1970 + | pub fn default_boolean(mut self, input: bool) -> Self {
|
1971 + | self.default_boolean = Some(input);
|
1972 + | self
|
1973 + | }
|
1974 + | #[allow(missing_docs)] // documentation missing in model
|
1975 + | pub(crate) fn set_default_boolean(
|
1976 + | mut self,
|
1977 + | input: impl ::std::convert::Into<bool>,
|
1978 + | ) -> Self {
|
1979 + | self.default_boolean = Some(input.into());
|
1980 + | self
|
1981 + | }
|
1982 + | #[allow(missing_docs)] // documentation missing in model
|
1983 + | pub fn default_list(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
|
1984 + | self.default_list = Some(input);
|
1985 + | self
|
1986 + | }
|
1987 + | #[allow(missing_docs)] // documentation missing in model
|
1988 + | pub(crate) fn set_default_list(
|
1989 + | mut self,
|
1990 + | input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
|
1991 + | ) -> Self {
|
1992 + | self.default_list = Some(input.into());
|
1993 + | self
|
1994 + | }
|
1995 + | #[allow(missing_docs)] // documentation missing in model
|
1996 + | pub fn default_document_map(mut self, input: ::aws_smithy_types::Document) -> Self {
|
1997 + | self.default_document_map = Some(input);
|
1998 + | self
|
1999 + | }
|
2000 + | #[allow(missing_docs)] // documentation missing in model
|
2001 + | pub(crate) fn set_default_document_map(
|
2002 + | mut self,
|
2003 + | input: impl ::std::convert::Into<::aws_smithy_types::Document>,
|
2004 + | ) -> Self {
|
2005 + | self.default_document_map = Some(input.into());
|
2006 + | self
|
2007 + | }
|
2008 + | #[allow(missing_docs)] // documentation missing in model
|
2009 + | pub fn default_document_string(mut self, input: ::aws_smithy_types::Document) -> Self {
|
2010 + | self.default_document_string = Some(input);
|
2011 + | self
|
2012 + | }
|
2013 + | #[allow(missing_docs)] // documentation missing in model
|
2014 + | pub(crate) fn set_default_document_string(
|
2015 + | mut self,
|
2016 + | input: impl ::std::convert::Into<::aws_smithy_types::Document>,
|
2017 + | ) -> Self {
|
2018 + | self.default_document_string = Some(input.into());
|
2019 + | self
|
2020 + | }
|
2021 + | #[allow(missing_docs)] // documentation missing in model
|
2022 + | pub fn default_document_boolean(mut self, input: ::aws_smithy_types::Document) -> Self {
|
2023 + | self.default_document_boolean = Some(input);
|
2024 + | self
|
2025 + | }
|
2026 + | #[allow(missing_docs)] // documentation missing in model
|
2027 + | pub(crate) fn set_default_document_boolean(
|
2028 + | mut self,
|
2029 + | input: impl ::std::convert::Into<::aws_smithy_types::Document>,
|
2030 + | ) -> Self {
|
2031 + | self.default_document_boolean = Some(input.into());
|
2032 + | self
|
2033 + | }
|
2034 + | #[allow(missing_docs)] // documentation missing in model
|
2035 + | pub fn default_document_list(mut self, input: ::aws_smithy_types::Document) -> Self {
|
2036 + | self.default_document_list = Some(input);
|
2037 + | self
|
2038 + | }
|
2039 + | #[allow(missing_docs)] // documentation missing in model
|
2040 + | pub(crate) fn set_default_document_list(
|
2041 + | mut self,
|
2042 + | input: impl ::std::convert::Into<::aws_smithy_types::Document>,
|
2043 + | ) -> Self {
|
2044 + | self.default_document_list = Some(input.into());
|
2045 + | self
|
2046 + | }
|
2047 + | #[allow(missing_docs)] // documentation missing in model
|
2048 + | pub fn default_null_document(
|
2049 + | mut self,
|
2050 + | input: ::std::option::Option<::aws_smithy_types::Document>,
|
2051 + | ) -> Self {
|
2052 + | self.default_null_document = input;
|
2053 + | self
|
2054 + | }
|
2055 + | #[allow(missing_docs)] // documentation missing in model
|
2056 + | pub(crate) fn set_default_null_document(
|
2057 + | mut self,
|
2058 + | input: Option<impl ::std::convert::Into<::aws_smithy_types::Document>>,
|
2059 + | ) -> Self {
|
2060 + | self.default_null_document = input.map(|v| v.into());
|
2061 + | self
|
2062 + | }
|
2063 + | #[allow(missing_docs)] // documentation missing in model
|
2064 + | pub fn default_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
|
2065 + | self.default_timestamp = Some(input);
|
2066 + | self
|
2067 + | }
|
2068 + | #[allow(missing_docs)] // documentation missing in model
|
2069 + | pub(crate) fn set_default_timestamp(
|
2070 + | mut self,
|
2071 + | input: impl ::std::convert::Into<::aws_smithy_types::DateTime>,
|
2072 + | ) -> Self {
|
2073 + | self.default_timestamp = Some(input.into());
|
2074 + | self
|
2075 + | }
|
2076 + | #[allow(missing_docs)] // documentation missing in model
|
2077 + | pub fn default_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
2078 + | self.default_blob = Some(input);
|
2079 + | self
|
2080 + | }
|
2081 + | #[allow(missing_docs)] // documentation missing in model
|
2082 + | pub(crate) fn set_default_blob(
|
2083 + | mut self,
|
2084 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
2085 + | ) -> Self {
|
2086 + | self.default_blob = Some(input.into());
|
2087 + | self
|
2088 + | }
|
2089 + | #[allow(missing_docs)] // documentation missing in model
|
2090 + | pub fn default_byte(mut self, input: i8) -> Self {
|
2091 + | self.default_byte = Some(input);
|
2092 + | self
|
2093 + | }
|
2094 + | #[allow(missing_docs)] // documentation missing in model
|
2095 + | pub(crate) fn set_default_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
2096 + | self.default_byte = Some(input.into());
|
2097 + | self
|
2098 + | }
|
2099 + | #[allow(missing_docs)] // documentation missing in model
|
2100 + | pub fn default_short(mut self, input: i16) -> Self {
|
2101 + | self.default_short = Some(input);
|
2102 + | self
|
2103 + | }
|
2104 + | #[allow(missing_docs)] // documentation missing in model
|
2105 + | pub(crate) fn set_default_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
2106 + | self.default_short = Some(input.into());
|
2107 + | self
|
2108 + | }
|
2109 + | #[allow(missing_docs)] // documentation missing in model
|
2110 + | pub fn default_integer(mut self, input: i32) -> Self {
|
2111 + | self.default_integer = Some(input);
|
2112 + | self
|
2113 + | }
|
2114 + | #[allow(missing_docs)] // documentation missing in model
|
2115 + | pub(crate) fn set_default_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
2116 + | self.default_integer = Some(input.into());
|
2117 + | self
|
2118 + | }
|
2119 + | #[allow(missing_docs)] // documentation missing in model
|
2120 + | pub fn default_long(mut self, input: i64) -> Self {
|
2121 + | self.default_long = Some(input);
|
2122 + | self
|
2123 + | }
|
2124 + | #[allow(missing_docs)] // documentation missing in model
|
2125 + | pub(crate) fn set_default_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
2126 + | self.default_long = Some(input.into());
|
2127 + | self
|
2128 + | }
|
2129 + | #[allow(missing_docs)] // documentation missing in model
|
2130 + | pub fn default_float(mut self, input: f32) -> Self {
|
2131 + | self.default_float = Some(input);
|
2132 + | self
|
2133 + | }
|
2134 + | #[allow(missing_docs)] // documentation missing in model
|
2135 + | pub(crate) fn set_default_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
2136 + | self.default_float = Some(input.into());
|
2137 + | self
|
2138 + | }
|
2139 + | #[allow(missing_docs)] // documentation missing in model
|
2140 + | pub fn default_double(mut self, input: f64) -> Self {
|
2141 + | self.default_double = Some(input);
|
2142 + | self
|
2143 + | }
|
2144 + | #[allow(missing_docs)] // documentation missing in model
|
2145 + | pub(crate) fn set_default_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
2146 + | self.default_double = Some(input.into());
|
2147 + | self
|
2148 + | }
|
2149 + | #[allow(missing_docs)] // documentation missing in model
|
2150 + | pub fn default_map(
|
2151 + | mut self,
|
2152 + | input: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2153 + | ) -> Self {
|
2154 + | self.default_map = Some(input);
|
2155 + | self
|
2156 + | }
|
2157 + | #[allow(missing_docs)] // documentation missing in model
|
2158 + | pub(crate) fn set_default_map(
|
2159 + | mut self,
|
2160 + | input: impl ::std::convert::Into<
|
2161 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
2162 + | >,
|
2163 + | ) -> Self {
|
2164 + | self.default_map = Some(input.into());
|
2165 + | self
|
2166 + | }
|
2167 + | #[allow(missing_docs)] // documentation missing in model
|
2168 + | pub fn default_enum(mut self, input: crate::model::TestEnum) -> Self {
|
2169 + | self.default_enum = Some(crate::constrained::MaybeConstrained::Constrained(input));
|
2170 + | self
|
2171 + | }
|
2172 + | #[allow(missing_docs)] // documentation missing in model
|
2173 + | pub(crate) fn set_default_enum(
|
2174 + | mut self,
|
2175 + | input: impl ::std::convert::Into<
|
2176 + | crate::constrained::MaybeConstrained<crate::model::TestEnum>,
|
2177 + | >,
|
2178 + | ) -> Self {
|
2179 + | self.default_enum = Some(input.into());
|
2180 + | self
|
2181 + | }
|
2182 + | #[allow(missing_docs)] // documentation missing in model
|
2183 + | pub fn default_int_enum(mut self, input: i32) -> Self {
|
2184 + | self.default_int_enum = Some(input);
|
2185 + | self
|
2186 + | }
|
2187 + | #[allow(missing_docs)] // documentation missing in model
|
2188 + | pub(crate) fn set_default_int_enum(
|
2189 + | mut self,
|
2190 + | input: impl ::std::convert::Into<i32>,
|
2191 + | ) -> Self {
|
2192 + | self.default_int_enum = Some(input.into());
|
2193 + | self
|
2194 + | }
|
2195 + | #[allow(missing_docs)] // documentation missing in model
|
2196 + | pub fn empty_string(mut self, input: ::std::string::String) -> Self {
|
2197 + | self.empty_string = Some(input);
|
2198 + | self
|
2199 + | }
|
2200 + | #[allow(missing_docs)] // documentation missing in model
|
2201 + | pub(crate) fn set_empty_string(
|
2202 + | mut self,
|
2203 + | input: impl ::std::convert::Into<::std::string::String>,
|
2204 + | ) -> Self {
|
2205 + | self.empty_string = Some(input.into());
|
2206 + | self
|
2207 + | }
|
2208 + | #[allow(missing_docs)] // documentation missing in model
|
2209 + | pub fn false_boolean(mut self, input: bool) -> Self {
|
2210 + | self.false_boolean = Some(input);
|
2211 + | self
|
2212 + | }
|
2213 + | #[allow(missing_docs)] // documentation missing in model
|
2214 + | pub(crate) fn set_false_boolean(mut self, input: impl ::std::convert::Into<bool>) -> Self {
|
2215 + | self.false_boolean = Some(input.into());
|
2216 + | self
|
2217 + | }
|
2218 + | #[allow(missing_docs)] // documentation missing in model
|
2219 + | pub fn empty_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
|
2220 + | self.empty_blob = Some(input);
|
2221 + | self
|
2222 + | }
|
2223 + | #[allow(missing_docs)] // documentation missing in model
|
2224 + | pub(crate) fn set_empty_blob(
|
2225 + | mut self,
|
2226 + | input: impl ::std::convert::Into<::aws_smithy_types::Blob>,
|
2227 + | ) -> Self {
|
2228 + | self.empty_blob = Some(input.into());
|
2229 + | self
|
2230 + | }
|
2231 + | #[allow(missing_docs)] // documentation missing in model
|
2232 + | pub fn zero_byte(mut self, input: i8) -> Self {
|
2233 + | self.zero_byte = Some(input);
|
2234 + | self
|
2235 + | }
|
2236 + | #[allow(missing_docs)] // documentation missing in model
|
2237 + | pub(crate) fn set_zero_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
2238 + | self.zero_byte = Some(input.into());
|
2239 + | self
|
2240 + | }
|
2241 + | #[allow(missing_docs)] // documentation missing in model
|
2242 + | pub fn zero_short(mut self, input: i16) -> Self {
|
2243 + | self.zero_short = Some(input);
|
2244 + | self
|
2245 + | }
|
2246 + | #[allow(missing_docs)] // documentation missing in model
|
2247 + | pub(crate) fn set_zero_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
2248 + | self.zero_short = Some(input.into());
|
2249 + | self
|
2250 + | }
|
2251 + | #[allow(missing_docs)] // documentation missing in model
|
2252 + | pub fn zero_integer(mut self, input: i32) -> Self {
|
2253 + | self.zero_integer = Some(input);
|
2254 + | self
|
960 2255 | }
|
961 - | }
|
962 - | }
|
963 - | impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
|
964 - | type Error = crate::model::string_enum::ConstraintViolation;
|
965 - | fn try_from(
|
966 - | s: ::std::string::String,
|
967 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
968 - | {
|
969 - | s.as_str().try_into()
|
970 - | }
|
971 - | }
|
972 - | impl std::str::FromStr for StringEnum {
|
973 - | type Err = crate::model::string_enum::ConstraintViolation;
|
974 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
975 - | Self::try_from(s)
|
976 - | }
|
977 - | }
|
978 - | impl StringEnum {
|
979 - | /// Returns the `&str` value of the enum member.
|
980 - | pub fn as_str(&self) -> &str {
|
981 - | match self {
|
982 - | StringEnum::V => "enumvalue",
|
2256 + | #[allow(missing_docs)] // documentation missing in model
|
2257 + | pub(crate) fn set_zero_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
2258 + | self.zero_integer = Some(input.into());
|
2259 + | self
|
983 2260 | }
|
984 - | }
|
985 - | /// Returns all the `&str` representations of the enum members.
|
986 - | pub const fn values() -> &'static [&'static str] {
|
987 - | &["enumvalue"]
|
988 - | }
|
989 - | }
|
990 - | impl ::std::convert::AsRef<str> for StringEnum {
|
991 - | fn as_ref(&self) -> &str {
|
992 - | self.as_str()
|
993 - | }
|
994 - | }
|
995 - | impl crate::constrained::Constrained for StringEnum {
|
996 - | type Unconstrained = ::std::string::String;
|
997 - | }
|
998 - |
|
999 - | impl ::std::convert::From<::std::string::String>
|
1000 - | for crate::constrained::MaybeConstrained<crate::model::StringEnum>
|
1001 - | {
|
1002 - | fn from(value: ::std::string::String) -> Self {
|
1003 - | Self::Unconstrained(value)
|
1004 - | }
|
1005 - | }
|
1006 - |
|
1007 - | #[allow(missing_docs)] // documentation missing in model
|
1008 - | #[derive(
|
1009 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1010 - | )]
|
1011 - | pub struct NestedPayload {
|
1012 - | #[allow(missing_docs)] // documentation missing in model
|
1013 - | pub greeting: ::std::option::Option<::std::string::String>,
|
1014 - | #[allow(missing_docs)] // documentation missing in model
|
1015 - | pub name: ::std::option::Option<::std::string::String>,
|
1016 - | }
|
1017 - | impl NestedPayload {
|
1018 - | #[allow(missing_docs)] // documentation missing in model
|
1019 - | pub fn greeting(&self) -> ::std::option::Option<&str> {
|
1020 - | self.greeting.as_deref()
|
1021 - | }
|
1022 - | #[allow(missing_docs)] // documentation missing in model
|
1023 - | pub fn name(&self) -> ::std::option::Option<&str> {
|
1024 - | self.name.as_deref()
|
1025 - | }
|
1026 - | }
|
1027 - | impl NestedPayload {
|
1028 - | /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::model::NestedPayload).
|
1029 - | pub fn builder() -> crate::model::nested_payload::Builder {
|
1030 - | crate::model::nested_payload::Builder::default()
|
1031 - | }
|
1032 - | }
|
1033 - | impl crate::constrained::Constrained for crate::model::NestedPayload {
|
1034 - | type Unconstrained = crate::model::nested_payload::Builder;
|
1035 - | }
|
1036 - |
|
1037 - | #[allow(missing_docs)] // documentation missing in model
|
1038 - | ///
|
1039 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1040 - | /// [constraint traits]. Use [`IntegerSet::try_from`] to construct values of this type.
|
1041 - | ///
|
1042 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1043 - | ///
|
1044 - | #[derive(
|
1045 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1046 - | )]
|
1047 - | pub struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
1048 - | impl IntegerSet {
|
1049 - | /// Returns an immutable reference to the underlying [`::std::vec::Vec<i32>`].
|
1050 - | pub fn inner(&self) -> &::std::vec::Vec<i32> {
|
1051 - | &self.0
|
1052 - | }
|
1053 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
1054 - | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
1055 - | self.0
|
1056 - | }
|
1057 - |
|
1058 - | fn check_unique_items(
|
1059 - | items: ::std::vec::Vec<i32>,
|
1060 - | ) -> Result<::std::vec::Vec<i32>, crate::model::integer_set::ConstraintViolation> {
|
1061 - | let mut seen = ::std::collections::HashMap::new();
|
1062 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
1063 - | for (idx, item) in items.iter().enumerate() {
|
1064 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
1065 - | duplicate_indices.push(prev_idx);
|
1066 - | }
|
2261 + | #[allow(missing_docs)] // documentation missing in model
|
2262 + | pub fn zero_long(mut self, input: i64) -> Self {
|
2263 + | self.zero_long = Some(input);
|
2264 + | self
|
1067 2265 | }
|
1068 - |
|
1069 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1070 - | for idx in &duplicate_indices {
|
1071 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1072 - | last_duplicate_indices.push(prev_idx);
|
1073 - | }
|
2266 + | #[allow(missing_docs)] // documentation missing in model
|
2267 + | pub(crate) fn set_zero_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
2268 + | self.zero_long = Some(input.into());
|
2269 + | self
|
1074 2270 | }
|
1075 - | duplicate_indices.extend(last_duplicate_indices);
|
1076 - |
|
1077 - | if !duplicate_indices.is_empty() {
|
1078 - | debug_assert!(duplicate_indices.len() >= 2);
|
1079 - | Err(
|
1080 - | crate::model::integer_set::ConstraintViolation::UniqueItems {
|
1081 - | duplicate_indices,
|
1082 - | original: items,
|
1083 - | },
|
1084 - | )
|
1085 - | } else {
|
1086 - | Ok(items)
|
2271 + | #[allow(missing_docs)] // documentation missing in model
|
2272 + | pub fn zero_float(mut self, input: f32) -> Self {
|
2273 + | self.zero_float = Some(input);
|
2274 + | self
|
2275 + | }
|
2276 + | #[allow(missing_docs)] // documentation missing in model
|
2277 + | pub(crate) fn set_zero_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
2278 + | self.zero_float = Some(input.into());
|
2279 + | self
|
2280 + | }
|
2281 + | #[allow(missing_docs)] // documentation missing in model
|
2282 + | pub fn zero_double(mut self, input: f64) -> Self {
|
2283 + | self.zero_double = Some(input);
|
2284 + | self
|
2285 + | }
|
2286 + | #[allow(missing_docs)] // documentation missing in model
|
2287 + | pub(crate) fn set_zero_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
2288 + | self.zero_double = Some(input.into());
|
2289 + | self
|
2290 + | }
|
2291 + | /// Consumes the builder and constructs a [`Defaults`](crate::model::Defaults).
|
2292 + | ///
|
2293 + | /// The builder fails to construct a [`Defaults`](crate::model::Defaults) if a [`ConstraintViolation`] occurs.
|
2294 + | ///
|
2295 + | pub fn build(self) -> Result<crate::model::Defaults, ConstraintViolation> {
|
2296 + | self.build_enforcing_all_constraints()
|
2297 + | }
|
2298 + | fn build_enforcing_all_constraints(
|
2299 + | self,
|
2300 + | ) -> Result<crate::model::Defaults, ConstraintViolation> {
|
2301 + | Ok(crate::model::Defaults {
|
2302 + | default_string: self.default_string.unwrap_or_else(
|
2303 + | #[allow(clippy::redundant_closure)]
|
2304 + | || String::from("hi"),
|
2305 + | ),
|
2306 + | default_boolean: self.default_boolean.unwrap_or(true),
|
2307 + | default_list: self.default_list.unwrap_or_else(
|
2308 + | #[allow(clippy::redundant_closure)]
|
2309 + | || ::std::vec::Vec::new(),
|
2310 + | ),
|
2311 + | default_document_map: self.default_document_map.unwrap_or_else(
|
2312 + | #[allow(clippy::redundant_closure)]
|
2313 + | || ::aws_smithy_types::Document::Object(::std::collections::HashMap::new()),
|
2314 + | ),
|
2315 + | default_document_string: self.default_document_string.unwrap_or_else(
|
2316 + | #[allow(clippy::redundant_closure)]
|
2317 + | || ::aws_smithy_types::Document::String(::std::string::String::from("hi")),
|
2318 + | ),
|
2319 + | default_document_boolean: self
|
2320 + | .default_document_boolean
|
2321 + | .unwrap_or(::aws_smithy_types::Document::Bool(true)),
|
2322 + | default_document_list: self.default_document_list.unwrap_or_else(
|
2323 + | #[allow(clippy::redundant_closure)]
|
2324 + | || ::aws_smithy_types::Document::Array(::std::vec::Vec::new()),
|
2325 + | ),
|
2326 + | default_null_document: self.default_null_document,
|
2327 + | default_timestamp: self.default_timestamp.unwrap_or_else(
|
2328 + | #[allow(clippy::redundant_closure)]
|
2329 + | || ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64),
|
2330 + | ),
|
2331 + | default_blob: self.default_blob.unwrap_or_else(
|
2332 + | #[allow(clippy::redundant_closure)]
|
2333 + | || ::aws_smithy_types::Blob::new("abc"),
|
2334 + | ),
|
2335 + | default_byte: self.default_byte.unwrap_or(1i8),
|
2336 + | default_short: self.default_short.unwrap_or(1i16),
|
2337 + | default_integer: self.default_integer.unwrap_or(10i32),
|
2338 + | default_long: self.default_long.unwrap_or(100i64),
|
2339 + | default_float: self.default_float.unwrap_or(1.0f32),
|
2340 + | default_double: self.default_double.unwrap_or(1.0f64),
|
2341 + | default_map: self.default_map.unwrap_or_else(
|
2342 + | #[allow(clippy::redundant_closure)]
|
2343 + | || ::std::collections::HashMap::new(),
|
2344 + | ),
|
2345 + | default_enum: self
|
2346 + | .default_enum
|
2347 + | .map(|v| match v {
|
2348 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
2349 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
2350 + | })
|
2351 + | .map(|res| res.map_err(ConstraintViolation::DefaultEnum))
|
2352 + | .transpose()?
|
2353 + | .unwrap_or(
|
2354 + | "FOO"
|
2355 + | .parse::<crate::model::TestEnum>()
|
2356 + | .expect("static value validated to member"),
|
2357 + | ),
|
2358 + | default_int_enum: self.default_int_enum.unwrap_or(1i32),
|
2359 + | empty_string: self.empty_string.unwrap_or_else(
|
2360 + | #[allow(clippy::redundant_closure)]
|
2361 + | || String::from(""),
|
2362 + | ),
|
2363 + | false_boolean: self.false_boolean.unwrap_or(false),
|
2364 + | empty_blob: self.empty_blob.unwrap_or_else(
|
2365 + | #[allow(clippy::redundant_closure)]
|
2366 + | || ::aws_smithy_types::Blob::new(""),
|
2367 + | ),
|
2368 + | zero_byte: self.zero_byte.unwrap_or(0i8),
|
2369 + | zero_short: self.zero_short.unwrap_or(0i16),
|
2370 + | zero_integer: self.zero_integer.unwrap_or(0i32),
|
2371 + | zero_long: self.zero_long.unwrap_or(0i64),
|
2372 + | zero_float: self.zero_float.unwrap_or(0.0f32),
|
2373 + | zero_double: self.zero_double.unwrap_or(0.0f64),
|
2374 + | })
|
1087 2375 | }
|
1088 2376 | }
|
1089 2377 | }
|
1090 - | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerSet {
|
1091 - | type Error = crate::model::integer_set::ConstraintViolation;
|
1092 - |
|
1093 - | /// Constructs a `IntegerSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
1094 - | fn try_from(value: ::std::vec::Vec<i32>) -> Result<Self, Self::Error> {
|
1095 - | let value = Self::check_unique_items(value)?;
|
1096 - |
|
1097 - | Ok(Self(value))
|
1098 - | }
|
1099 - | }
|
1100 - |
|
1101 - | impl ::std::convert::From<IntegerSet> for ::std::vec::Vec<i32> {
|
1102 - | fn from(value: IntegerSet) -> Self {
|
1103 - | value.into_inner()
|
1104 - | }
|
1105 - | }
|
1106 - | impl crate::constrained::Constrained for IntegerSet {
|
1107 - | type Unconstrained = crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained;
|
1108 - | }
|
1109 - |
|
1110 2378 | /// See [`PayloadConfig`](crate::model::PayloadConfig).
|
1111 2379 | ///
|
1112 2380 | pub mod payload_config {
|
1113 2381 |
|
1114 2382 | impl ::std::convert::From<Builder> for crate::model::PayloadConfig {
|
1115 2383 | fn from(builder: Builder) -> Self {
|
1116 2384 | builder.build()
|
1117 2385 | }
|
1118 2386 | }
|
1119 2387 | /// A builder for [`PayloadConfig`](crate::model::PayloadConfig).
|