1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | #[::pyo3::pyclass]
|
3 - | /// :param path str:
|
4 - | /// :param message str:
|
5 - | /// :rtype None:
|
6 - | /// Describes one specific validation failure for an input member.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | ///
|
4 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
5 + | /// [constraint traits]. Use [`StringSet::try_from`] to construct values of this type.
|
6 + | ///
|
7 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
8 + | ///
|
7 9 | #[derive(
|
8 10 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
9 11 | )]
|
10 - | pub struct ValidationExceptionField {
|
11 - | #[pyo3(get, set)]
|
12 - | /// :type str:
|
13 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
14 - | pub path: ::std::string::String,
|
15 - | #[pyo3(get, set)]
|
16 - | /// :type str:
|
17 - | /// A detailed description of the validation failure.
|
18 - | pub message: ::std::string::String,
|
19 - | }
|
20 - | impl ValidationExceptionField {
|
21 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
22 - | pub fn path(&self) -> &str {
|
23 - | use std::ops::Deref;
|
24 - | self.path.deref()
|
12 + | pub(crate) struct StringSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
13 + | impl StringSet {
|
14 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
15 + | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
16 + | self.0
|
25 17 | }
|
26 - | /// A detailed description of the validation failure.
|
27 - | pub fn message(&self) -> &str {
|
28 - | use std::ops::Deref;
|
29 - | self.message.deref()
|
18 + |
|
19 + | fn check_unique_items(
|
20 + | items: ::std::vec::Vec<::std::string::String>,
|
21 + | ) -> ::std::result::Result<
|
22 + | ::std::vec::Vec<::std::string::String>,
|
23 + | crate::model::string_set_internal::ConstraintViolation,
|
24 + | > {
|
25 + | let mut seen = ::std::collections::HashMap::new();
|
26 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
27 + | for (idx, item) in items.iter().enumerate() {
|
28 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
29 + | duplicate_indices.push(prev_idx);
|
30 30 | }
|
31 - | }
|
32 - | #[allow(clippy::new_without_default)]
|
33 - | #[allow(clippy::too_many_arguments)]
|
34 - | #[::pyo3::pymethods]
|
35 - | impl ValidationExceptionField {
|
36 - | #[new]
|
37 - | pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
|
38 - | Self { path, message }
|
39 31 | }
|
40 - | fn __repr__(&self) -> String {
|
41 - | format!("{self:?}")
|
32 + |
|
33 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
34 + | for idx in &duplicate_indices {
|
35 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
36 + | last_duplicate_indices.push(prev_idx);
|
42 37 | }
|
43 - | fn __str__(&self) -> String {
|
44 - | format!("{self:?}")
|
45 38 | }
|
46 - | }
|
47 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
|
48 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
49 - | ob.extract::<ValidationExceptionField>().map(Box::new)
|
39 + | duplicate_indices.extend(last_duplicate_indices);
|
40 + |
|
41 + | if !duplicate_indices.is_empty() {
|
42 + | debug_assert!(duplicate_indices.len() >= 2);
|
43 + | Err(
|
44 + | crate::model::string_set_internal::ConstraintViolation::UniqueItems {
|
45 + | duplicate_indices,
|
46 + | original: items,
|
47 + | },
|
48 + | )
|
49 + | } else {
|
50 + | Ok(items)
|
51 + | }
|
50 52 | }
|
51 53 | }
|
54 + | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for StringSet {
|
55 + | type Error = crate::model::string_set_internal::ConstraintViolation;
|
52 56 |
|
53 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
|
54 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
55 - | (*self).into_py(py)
|
57 + | /// Constructs a `StringSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
58 + | fn try_from(
|
59 + | value: ::std::vec::Vec<::std::string::String>,
|
60 + | ) -> ::std::result::Result<Self, Self::Error> {
|
61 + | let value = Self::check_unique_items(value)?;
|
62 + |
|
63 + | Ok(Self(value))
|
56 64 | }
|
57 65 | }
|
58 - | impl ValidationExceptionField {
|
59 - | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
60 - | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
61 - | crate::model::validation_exception_field::Builder::default()
|
66 + |
|
67 + | impl ::std::convert::From<StringSet> for ::std::vec::Vec<::std::string::String> {
|
68 + | fn from(value: StringSet) -> Self {
|
69 + | value.into_inner()
|
62 70 | }
|
63 71 | }
|
72 + | impl crate::constrained::Constrained for StringSet {
|
73 + | type Unconstrained = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained;
|
74 + | }
|
64 75 |
|
65 76 | #[::pyo3::pyclass]
|
66 - | /// :param greeting str:
|
67 - | /// :param language typing.Optional\[str\]:
|
68 - | /// :param farewell typing.Optional\[rest_json.model.Farewell\]:
|
69 - | /// :rtype None:
|
70 77 | #[allow(missing_docs)] // documentation missing in model
|
71 78 | #[derive(
|
72 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
79 + | ::std::clone::Clone,
|
80 + | ::std::cmp::Eq,
|
81 + | ::std::cmp::Ord,
|
82 + | ::std::cmp::PartialEq,
|
83 + | ::std::cmp::PartialOrd,
|
84 + | ::std::fmt::Debug,
|
85 + | ::std::hash::Hash,
|
73 86 | )]
|
74 - | pub struct Dialog {
|
75 - | #[pyo3(get, set)]
|
76 - | /// :type typing.Optional\[str\]:
|
87 + | pub enum FooEnum {
|
77 88 | #[allow(missing_docs)] // documentation missing in model
|
78 - | pub language: ::std::option::Option<::std::string::String>,
|
79 - | #[pyo3(get, set)]
|
80 - | /// :type str:
|
89 + | Zero,
|
81 90 | #[allow(missing_docs)] // documentation missing in model
|
82 - | pub greeting: ::std::string::String,
|
83 - | #[pyo3(get, set)]
|
84 - | /// :type typing.Optional\[rest_json.model.Farewell\]:
|
91 + | One,
|
85 92 | #[allow(missing_docs)] // documentation missing in model
|
86 - | pub farewell: ::std::option::Option<crate::model::Farewell>,
|
87 - | }
|
88 - | impl Dialog {
|
93 + | Bar,
|
89 94 | #[allow(missing_docs)] // documentation missing in model
|
90 - | pub fn language(&self) -> ::std::option::Option<&str> {
|
91 - | self.language.as_deref()
|
92 - | }
|
95 + | Baz,
|
93 96 | #[allow(missing_docs)] // documentation missing in model
|
94 - | pub fn greeting(&self) -> &str {
|
95 - | use std::ops::Deref;
|
96 - | self.greeting.deref()
|
97 + | Foo,
|
98 + | }
|
99 + | pub(crate) mod foo_enum_internal {
|
100 + | #[derive(Debug, PartialEq)]
|
101 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
102 + |
|
103 + | impl ::std::fmt::Display for ConstraintViolation {
|
104 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
105 + | write!(
|
106 + | f,
|
107 + | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
108 + | )
|
97 109 | }
|
98 - | #[allow(missing_docs)] // documentation missing in model
|
99 - | pub fn farewell(&self) -> ::std::option::Option<&crate::model::Farewell> {
|
100 - | self.farewell.as_ref()
|
101 110 | }
|
102 - | }
|
103 - | #[allow(clippy::new_without_default)]
|
104 - | #[allow(clippy::too_many_arguments)]
|
105 - | #[::pyo3::pymethods]
|
106 - | impl Dialog {
|
107 - | #[new]
|
108 - | pub fn new(
|
109 - | greeting: ::std::string::String,
|
110 - | language: ::std::option::Option<::std::string::String>,
|
111 - | farewell: ::std::option::Option<crate::model::Farewell>,
|
112 - | ) -> Self {
|
113 - | Self {
|
114 - | greeting,
|
115 - | language,
|
116 - | farewell,
|
111 + |
|
112 + | impl ::std::error::Error for ConstraintViolation {}
|
113 + | impl ConstraintViolation {
|
114 + | pub(crate) fn as_validation_exception_field(
|
115 + | self,
|
116 + | path: ::std::string::String,
|
117 + | ) -> crate::model::ValidationExceptionField {
|
118 + | crate::model::ValidationExceptionField {
|
119 + | message: format!(
|
120 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
121 + | &path
|
122 + | ),
|
123 + | path,
|
117 124 | }
|
118 125 | }
|
119 - | fn __repr__(&self) -> String {
|
120 - | format!("{self:?}")
|
121 126 | }
|
122 - | fn __str__(&self) -> String {
|
123 - | format!("{self:?}")
|
127 + | }
|
128 + | impl ::std::convert::TryFrom<&str> for FooEnum {
|
129 + | type Error = crate::model::foo_enum_internal::ConstraintViolation;
|
130 + | fn try_from(
|
131 + | s: &str,
|
132 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
133 + | match s {
|
134 + | "0" => Ok(FooEnum::Zero),
|
135 + | "1" => Ok(FooEnum::One),
|
136 + | "Bar" => Ok(FooEnum::Bar),
|
137 + | "Baz" => Ok(FooEnum::Baz),
|
138 + | "Foo" => Ok(FooEnum::Foo),
|
139 + | _ => Err(crate::model::foo_enum_internal::ConstraintViolation(
|
140 + | s.to_owned(),
|
141 + | )),
|
142 + | }
|
124 143 | }
|
125 144 | }
|
126 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Dialog> {
|
127 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
128 - | ob.extract::<Dialog>().map(Box::new)
|
145 + | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
146 + | type Error = crate::model::foo_enum_internal::ConstraintViolation;
|
147 + | fn try_from(
|
148 + | s: ::std::string::String,
|
149 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
150 + | {
|
151 + | s.as_str().try_into()
|
129 152 | }
|
130 153 | }
|
131 - |
|
132 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Dialog> {
|
133 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
134 - | (*self).into_py(py)
|
154 + | impl std::str::FromStr for FooEnum {
|
155 + | type Err = crate::model::foo_enum_internal::ConstraintViolation;
|
156 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
157 + | Self::try_from(s)
|
135 158 | }
|
136 159 | }
|
137 - | impl crate::constrained::Constrained for crate::model::Dialog {
|
138 - | type Unconstrained = crate::model::dialog_internal::Builder;
|
160 + | impl FooEnum {
|
161 + | /// Returns the `&str` value of the enum member.
|
162 + | pub fn as_str(&self) -> &str {
|
163 + | match self {
|
164 + | FooEnum::Zero => "0",
|
165 + | FooEnum::One => "1",
|
166 + | FooEnum::Bar => "Bar",
|
167 + | FooEnum::Baz => "Baz",
|
168 + | FooEnum::Foo => "Foo",
|
169 + | }
|
170 + | }
|
171 + | /// Returns all the `&str` representations of the enum members.
|
172 + | pub const fn values() -> &'static [&'static str] {
|
173 + | &["0", "1", "Bar", "Baz", "Foo"]
|
174 + | }
|
139 175 | }
|
140 - | impl Dialog {
|
141 - | /// Creates a new builder-style object to manufacture [`Dialog`](crate::model::Dialog).
|
142 - | pub fn builder() -> crate::model::dialog::Builder {
|
143 - | crate::model::dialog::Builder::default()
|
176 + | impl ::std::convert::AsRef<str> for FooEnum {
|
177 + | fn as_ref(&self) -> &str {
|
178 + | self.as_str()
|
144 179 | }
|
145 180 | }
|
146 - |
|
147 - | #[::pyo3::pyclass]
|
148 - | /// :param phrase str:
|
149 - | /// :rtype None:
|
150 - | #[allow(missing_docs)] // documentation missing in model
|
151 - | #[derive(
|
152 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
153 - | )]
|
154 - | pub struct Farewell {
|
155 - | #[pyo3(get, set)]
|
156 - | /// :type str:
|
157 - | #[allow(missing_docs)] // documentation missing in model
|
158 - | pub phrase: ::std::string::String,
|
159 - | }
|
160 - | impl Farewell {
|
161 - | #[allow(missing_docs)] // documentation missing in model
|
162 - | pub fn phrase(&self) -> &str {
|
163 - | use std::ops::Deref;
|
164 - | self.phrase.deref()
|
165 - | }
|
166 - | }
|
167 - | #[allow(clippy::new_without_default)]
|
168 - | #[allow(clippy::too_many_arguments)]
|
169 181 | #[::pyo3::pymethods]
|
170 - | impl Farewell {
|
171 - | #[new]
|
172 - | pub fn new(phrase: ::std::string::String) -> Self {
|
173 - | Self { phrase }
|
182 + | impl FooEnum {
|
183 + | #[getter]
|
184 + | pub fn name(&self) -> &str {
|
185 + | match self {
|
186 + | FooEnum::Zero => "Zero",
|
187 + | FooEnum::One => "One",
|
188 + | FooEnum::Bar => "Bar",
|
189 + | FooEnum::Baz => "Baz",
|
190 + | FooEnum::Foo => "Foo",
|
191 + | }
|
192 + | }
|
193 + | #[getter]
|
194 + | pub fn value(&self) -> &str {
|
195 + | self.as_str()
|
174 196 | }
|
175 197 | fn __repr__(&self) -> String {
|
176 - | format!("{self:?}")
|
198 + | self.as_str().to_owned()
|
177 199 | }
|
178 200 | fn __str__(&self) -> String {
|
179 - | format!("{self:?}")
|
201 + | self.as_str().to_owned()
|
180 202 | }
|
181 203 | }
|
182 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Farewell> {
|
183 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
184 - | ob.extract::<Farewell>().map(Box::new)
|
204 + | impl crate::constrained::Constrained for FooEnum {
|
205 + | type Unconstrained = ::std::string::String;
|
206 + | }
|
207 + |
|
208 + | impl ::std::convert::From<::std::string::String>
|
209 + | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
210 + | {
|
211 + | fn from(value: ::std::string::String) -> Self {
|
212 + | Self::Unconstrained(value)
|
185 213 | }
|
186 214 | }
|
187 215 |
|
188 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Farewell> {
|
189 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
190 - | (*self).into_py(py)
|
216 + | #[allow(missing_docs)] // documentation missing in model
|
217 + | ///
|
218 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
219 + | /// [constraint traits]. Use [`IntegerSet::try_from`] to construct values of this type.
|
220 + | ///
|
221 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
222 + | ///
|
223 + | #[derive(
|
224 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
225 + | )]
|
226 + | pub(crate) struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
227 + | impl IntegerSet {
|
228 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
229 + | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
230 + | self.0
|
231 + | }
|
232 + |
|
233 + | fn check_unique_items(
|
234 + | items: ::std::vec::Vec<i32>,
|
235 + | ) -> ::std::result::Result<
|
236 + | ::std::vec::Vec<i32>,
|
237 + | crate::model::integer_set_internal::ConstraintViolation,
|
238 + | > {
|
239 + | let mut seen = ::std::collections::HashMap::new();
|
240 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
241 + | for (idx, item) in items.iter().enumerate() {
|
242 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
243 + | duplicate_indices.push(prev_idx);
|
244 + | }
|
245 + | }
|
246 + |
|
247 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
248 + | for idx in &duplicate_indices {
|
249 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
250 + | last_duplicate_indices.push(prev_idx);
|
251 + | }
|
252 + | }
|
253 + | duplicate_indices.extend(last_duplicate_indices);
|
254 + |
|
255 + | if !duplicate_indices.is_empty() {
|
256 + | debug_assert!(duplicate_indices.len() >= 2);
|
257 + | Err(
|
258 + | crate::model::integer_set_internal::ConstraintViolation::UniqueItems {
|
259 + | duplicate_indices,
|
260 + | original: items,
|
261 + | },
|
262 + | )
|
263 + | } else {
|
264 + | Ok(items)
|
265 + | }
|
191 266 | }
|
192 267 | }
|
193 - | impl crate::constrained::Constrained for crate::model::Farewell {
|
194 - | type Unconstrained = crate::model::farewell_internal::Builder;
|
268 + | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerSet {
|
269 + | type Error = crate::model::integer_set_internal::ConstraintViolation;
|
270 + |
|
271 + | /// Constructs a `IntegerSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
272 + | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
273 + | let value = Self::check_unique_items(value)?;
|
274 + |
|
275 + | Ok(Self(value))
|
276 + | }
|
195 277 | }
|
196 - | impl Farewell {
|
197 - | /// Creates a new builder-style object to manufacture [`Farewell`](crate::model::Farewell).
|
198 - | pub fn builder() -> crate::model::farewell::Builder {
|
199 - | crate::model::farewell::Builder::default()
|
278 + |
|
279 + | impl ::std::convert::From<IntegerSet> for ::std::vec::Vec<i32> {
|
280 + | fn from(value: IntegerSet) -> Self {
|
281 + | value.into_inner()
|
200 282 | }
|
201 283 | }
|
284 + | impl crate::constrained::Constrained for IntegerSet {
|
285 + | type Unconstrained = crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained;
|
286 + | }
|
202 287 |
|
203 288 | #[::pyo3::pyclass]
|
204 - | /// :param dialog rest_json.model.Dialog:
|
205 - | /// :param dialog_list typing.List\[rest_json.model.Dialog\]:
|
206 - | /// :param dialog_map typing.Dict\[str, rest_json.model.Dialog\]:
|
289 + | /// :param greeting typing.Optional\[str\]:
|
290 + | /// :param name typing.Optional\[str\]:
|
207 291 | /// :rtype None:
|
208 292 | #[allow(missing_docs)] // documentation missing in model
|
209 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
210 - | pub struct TopLevel {
|
211 - | #[pyo3(get, set)]
|
212 - | /// :type rest_json.model.Dialog:
|
213 - | #[allow(missing_docs)] // documentation missing in model
|
214 - | pub dialog: crate::model::Dialog,
|
293 + | #[derive(
|
294 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
295 + | )]
|
296 + | pub struct NestedPayload {
|
215 297 | #[pyo3(get, set)]
|
216 - | /// :type typing.List\[rest_json.model.Dialog\]:
|
298 + | /// :type typing.Optional\[str\]:
|
217 299 | #[allow(missing_docs)] // documentation missing in model
|
218 - | pub dialog_list: ::std::vec::Vec<crate::model::Dialog>,
|
300 + | pub greeting: ::std::option::Option<::std::string::String>,
|
219 301 | #[pyo3(get, set)]
|
220 - | /// :type typing.Dict\[str, rest_json.model.Dialog\]:
|
302 + | /// :type typing.Optional\[str\]:
|
221 303 | #[allow(missing_docs)] // documentation missing in model
|
222 - | pub dialog_map: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
304 + | pub name: ::std::option::Option<::std::string::String>,
|
223 305 | }
|
224 - | impl TopLevel {
|
225 - | #[allow(missing_docs)] // documentation missing in model
|
226 - | pub fn dialog(&self) -> &crate::model::Dialog {
|
227 - | &self.dialog
|
228 - | }
|
306 + | impl NestedPayload {
|
229 307 | #[allow(missing_docs)] // documentation missing in model
|
230 - | pub fn dialog_list(&self) -> &[crate::model::Dialog] {
|
231 - | use std::ops::Deref;
|
232 - | self.dialog_list.deref()
|
308 + | pub fn greeting(&self) -> ::std::option::Option<&str> {
|
309 + | self.greeting.as_deref()
|
233 310 | }
|
234 311 | #[allow(missing_docs)] // documentation missing in model
|
235 - | pub fn dialog_map(
|
236 - | &self,
|
237 - | ) -> &::std::collections::HashMap<::std::string::String, crate::model::Dialog> {
|
238 - | &self.dialog_map
|
312 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
313 + | self.name.as_deref()
|
239 314 | }
|
240 315 | }
|
241 316 | #[allow(clippy::new_without_default)]
|
242 317 | #[allow(clippy::too_many_arguments)]
|
243 318 | #[::pyo3::pymethods]
|
244 - | impl TopLevel {
|
319 + | impl NestedPayload {
|
245 320 | #[new]
|
246 321 | pub fn new(
|
247 - | dialog: crate::model::Dialog,
|
248 - | dialog_list: ::std::vec::Vec<crate::model::Dialog>,
|
249 - | dialog_map: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
322 + | greeting: ::std::option::Option<::std::string::String>,
|
323 + | name: ::std::option::Option<::std::string::String>,
|
250 324 | ) -> Self {
|
251 - | Self {
|
252 - | dialog,
|
253 - | dialog_list,
|
254 - | dialog_map,
|
255 - | }
|
325 + | Self { greeting, name }
|
256 326 | }
|
257 327 | fn __repr__(&self) -> String {
|
258 328 | format!("{self:?}")
|
259 329 | }
|
260 330 | fn __str__(&self) -> String {
|
261 331 | format!("{self:?}")
|
262 332 | }
|
263 333 | }
|
264 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<TopLevel> {
|
334 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<NestedPayload> {
|
265 335 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
266 - | ob.extract::<TopLevel>().map(Box::new)
|
336 + | ob.extract::<NestedPayload>().map(Box::new)
|
267 337 | }
|
268 338 | }
|
269 339 |
|
270 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<TopLevel> {
|
340 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<NestedPayload> {
|
271 341 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
272 342 | (*self).into_py(py)
|
273 343 | }
|
274 344 | }
|
275 - | impl crate::constrained::Constrained for crate::model::TopLevel {
|
276 - | type Unconstrained = crate::model::top_level_internal::Builder;
|
345 + | impl crate::constrained::Constrained for crate::model::NestedPayload {
|
346 + | type Unconstrained = crate::model::nested_payload_internal::Builder;
|
277 347 | }
|
278 - | impl TopLevel {
|
279 - | /// Creates a new builder-style object to manufacture [`TopLevel`](crate::model::TopLevel).
|
280 - | pub fn builder() -> crate::model::top_level::Builder {
|
281 - | crate::model::top_level::Builder::default()
|
348 + | impl NestedPayload {
|
349 + | /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::model::NestedPayload).
|
350 + | pub fn builder() -> crate::model::nested_payload::Builder {
|
351 + | crate::model::nested_payload::Builder::default()
|
282 352 | }
|
283 353 | }
|
284 354 |
|
285 355 | #[::pyo3::pyclass]
|
286 356 | #[allow(missing_docs)] // documentation missing in model
|
287 357 | #[derive(
|
288 358 | ::std::clone::Clone,
|
289 359 | ::std::cmp::Eq,
|
290 360 | ::std::cmp::Ord,
|
291 361 | ::std::cmp::PartialEq,
|
292 362 | ::std::cmp::PartialOrd,
|
293 363 | ::std::fmt::Debug,
|
294 364 | ::std::hash::Hash,
|
295 365 | )]
|
296 - | pub enum TestEnum {
|
297 - | #[allow(missing_docs)] // documentation missing in model
|
298 - | Bar,
|
299 - | #[allow(missing_docs)] // documentation missing in model
|
300 - | Baz,
|
366 + | pub enum StringEnum {
|
301 367 | #[allow(missing_docs)] // documentation missing in model
|
302 - | Foo,
|
368 + | V,
|
303 369 | }
|
304 - | pub(crate) mod test_enum_internal {
|
370 + | pub(crate) mod string_enum_internal {
|
305 371 | #[derive(Debug, PartialEq)]
|
306 372 | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
307 373 |
|
308 374 | impl ::std::fmt::Display for ConstraintViolation {
|
309 375 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
310 376 | write!(
|
311 377 | f,
|
312 - | r#"Value provided for 'aws.protocoltests.restjson#TestEnum' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#
|
378 + | r#"Value provided for 'aws.protocoltests.restjson#StringEnum' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#
|
313 379 | )
|
314 380 | }
|
315 381 | }
|
316 382 |
|
317 383 | impl ::std::error::Error for ConstraintViolation {}
|
318 384 | impl ConstraintViolation {
|
319 385 | pub(crate) fn as_validation_exception_field(
|
320 386 | self,
|
321 387 | path: ::std::string::String,
|
322 388 | ) -> crate::model::ValidationExceptionField {
|
323 389 | crate::model::ValidationExceptionField {
|
324 390 | message: format!(
|
325 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#,
|
391 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#,
|
326 392 | &path
|
327 393 | ),
|
328 394 | path,
|
329 395 | }
|
330 396 | }
|
331 397 | }
|
332 398 | }
|
333 - | impl ::std::convert::TryFrom<&str> for TestEnum {
|
334 - | type Error = crate::model::test_enum_internal::ConstraintViolation;
|
399 + | impl ::std::convert::TryFrom<&str> for StringEnum {
|
400 + | type Error = crate::model::string_enum_internal::ConstraintViolation;
|
335 401 | fn try_from(
|
336 402 | s: &str,
|
337 403 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
338 404 | match s {
|
339 - | "BAR" => Ok(TestEnum::Bar),
|
340 - | "BAZ" => Ok(TestEnum::Baz),
|
341 - | "FOO" => Ok(TestEnum::Foo),
|
342 - | _ => Err(crate::model::test_enum_internal::ConstraintViolation(
|
405 + | "enumvalue" => Ok(StringEnum::V),
|
406 + | _ => Err(crate::model::string_enum_internal::ConstraintViolation(
|
343 407 | s.to_owned(),
|
344 408 | )),
|
345 409 | }
|
346 410 | }
|
347 411 | }
|
348 - | impl ::std::convert::TryFrom<::std::string::String> for TestEnum {
|
349 - | type Error = crate::model::test_enum_internal::ConstraintViolation;
|
412 + | impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
|
413 + | type Error = crate::model::string_enum_internal::ConstraintViolation;
|
350 414 | fn try_from(
|
351 415 | s: ::std::string::String,
|
352 416 | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
353 417 | {
|
354 418 | s.as_str().try_into()
|
355 419 | }
|
356 420 | }
|
357 - | impl std::str::FromStr for TestEnum {
|
358 - | type Err = crate::model::test_enum_internal::ConstraintViolation;
|
421 + | impl std::str::FromStr for StringEnum {
|
422 + | type Err = crate::model::string_enum_internal::ConstraintViolation;
|
359 423 | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
360 424 | Self::try_from(s)
|
361 425 | }
|
362 426 | }
|
363 - | impl TestEnum {
|
427 + | impl StringEnum {
|
364 428 | /// Returns the `&str` value of the enum member.
|
365 429 | pub fn as_str(&self) -> &str {
|
366 430 | match self {
|
367 - | TestEnum::Bar => "BAR",
|
368 - | TestEnum::Baz => "BAZ",
|
369 - | TestEnum::Foo => "FOO",
|
431 + | StringEnum::V => "enumvalue",
|
370 432 | }
|
371 433 | }
|
372 434 | /// Returns all the `&str` representations of the enum members.
|
373 435 | pub const fn values() -> &'static [&'static str] {
|
374 - | &["BAR", "BAZ", "FOO"]
|
436 + | &["enumvalue"]
|
375 437 | }
|
376 438 | }
|
377 - | impl ::std::convert::AsRef<str> for TestEnum {
|
439 + | impl ::std::convert::AsRef<str> for StringEnum {
|
378 440 | fn as_ref(&self) -> &str {
|
379 441 | self.as_str()
|
380 442 | }
|
381 443 | }
|
382 444 | #[::pyo3::pymethods]
|
383 - | impl TestEnum {
|
445 + | impl StringEnum {
|
384 446 | #[getter]
|
385 447 | pub fn name(&self) -> &str {
|
386 448 | match self {
|
387 - | TestEnum::Bar => "Bar",
|
388 - | TestEnum::Baz => "Baz",
|
389 - | TestEnum::Foo => "Foo",
|
449 + | StringEnum::V => "V",
|
390 450 | }
|
391 451 | }
|
392 452 | #[getter]
|
393 453 | pub fn value(&self) -> &str {
|
394 454 | self.as_str()
|
395 455 | }
|
396 456 | fn __repr__(&self) -> String {
|
397 457 | self.as_str().to_owned()
|
398 458 | }
|
399 459 | fn __str__(&self) -> String {
|
400 460 | self.as_str().to_owned()
|
401 461 | }
|
402 462 | }
|
403 - | impl crate::constrained::Constrained for TestEnum {
|
463 + | impl crate::constrained::Constrained for StringEnum {
|
404 464 | type Unconstrained = ::std::string::String;
|
405 465 | }
|
406 466 |
|
407 467 | impl ::std::convert::From<::std::string::String>
|
408 - | for crate::constrained::MaybeConstrained<crate::model::TestEnum>
|
468 + | for crate::constrained::MaybeConstrained<crate::model::StringEnum>
|
409 469 | {
|
410 470 | fn from(value: ::std::string::String) -> Self {
|
411 471 | Self::Unconstrained(value)
|
412 472 | }
|
413 473 | }
|
414 474 |
|
415 - | #[::pyo3::pyclass]
|
416 - | /// :param member int:
|
417 - | /// :rtype None:
|
418 475 | #[allow(missing_docs)] // documentation missing in model
|
419 476 | #[derive(
|
420 477 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
421 478 | )]
|
422 - | pub struct ClientOptionalDefaults {
|
423 - | #[pyo3(get, set)]
|
424 - | /// :type int:
|
479 + | pub enum UnionPayload {
|
425 480 | #[allow(missing_docs)] // documentation missing in model
|
426 - | pub member: i32,
|
481 + | Greeting(::std::string::String),
|
427 482 | }
|
428 - | impl ClientOptionalDefaults {
|
429 - | #[allow(missing_docs)] // documentation missing in model
|
430 - | pub fn member(&self) -> i32 {
|
431 - | self.member
|
483 + | impl UnionPayload {
|
484 + | #[allow(irrefutable_let_patterns)]
|
485 + | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
486 + | /// Returns `Err(&Self)` if it can't be converted.
|
487 + | pub fn as_greeting(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
488 + | if let UnionPayload::Greeting(val) = &self {
|
489 + | ::std::result::Result::Ok(val)
|
490 + | } else {
|
491 + | ::std::result::Result::Err(self)
|
492 + | }
|
493 + | }
|
494 + | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
495 + | pub fn is_greeting(&self) -> bool {
|
496 + | self.as_greeting().is_ok()
|
497 + | }
|
498 + | }
|
499 + | #[pyo3::pyclass(name = "UnionPayload")]
|
500 + | #[derive(
|
501 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
502 + | )]
|
503 + | pub struct PyUnionMarkerUnionPayload(pub UnionPayload);
|
504 + | #[::pyo3::pymethods]
|
505 + | impl PyUnionMarkerUnionPayload {
|
506 + | #[allow(irrefutable_let_patterns)]
|
507 + | #[staticmethod]
|
508 + | /// Creates a new union instance of [`Greeting`](crate::model::UnionPayload::Greeting)
|
509 + | /// :param data str:
|
510 + | /// :rtype UnionPayload:
|
511 + | pub fn greeting(data: ::std::string::String) -> Self {
|
512 + | Self(UnionPayload::Greeting(data))
|
513 + | }
|
514 + | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
515 + | /// :rtype str:
|
516 + | pub fn as_greeting(&self) -> ::pyo3::PyResult<::std::string::String> {
|
517 + | match self.0.as_greeting() {
|
518 + | Ok(variant) => Ok(variant.clone()),
|
519 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
520 + | r"UnionPayload variant is not of type str",
|
521 + | )),
|
522 + | }
|
523 + | }
|
524 + | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
525 + | /// :rtype bool:
|
526 + | pub fn is_greeting(&self) -> bool {
|
527 + | self.0.is_greeting()
|
528 + | }
|
529 + | }
|
530 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for UnionPayload {
|
531 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
532 + | PyUnionMarkerUnionPayload(self).into_py(py)
|
533 + | }
|
534 + | }
|
535 + | impl<'source> ::pyo3::FromPyObject<'source> for UnionPayload {
|
536 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
537 + | let data: PyUnionMarkerUnionPayload = obj.extract()?;
|
538 + | Ok(data.0)
|
539 + | }
|
540 + | }
|
541 + |
|
542 + | #[::pyo3::pyclass]
|
543 + | /// :param foo typing.Optional\[str\]:
|
544 + | /// :rtype None:
|
545 + | #[allow(missing_docs)] // documentation missing in model
|
546 + | #[derive(
|
547 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
548 + | )]
|
549 + | pub struct ComplexNestedErrorData {
|
550 + | #[pyo3(get, set)]
|
551 + | /// :type typing.Optional\[str\]:
|
552 + | #[allow(missing_docs)] // documentation missing in model
|
553 + | pub foo: ::std::option::Option<::std::string::String>,
|
554 + | }
|
555 + | impl ComplexNestedErrorData {
|
556 + | #[allow(missing_docs)] // documentation missing in model
|
557 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
558 + | self.foo.as_deref()
|
432 559 | }
|
433 560 | }
|
434 561 | #[allow(clippy::new_without_default)]
|
435 562 | #[allow(clippy::too_many_arguments)]
|
436 563 | #[::pyo3::pymethods]
|
437 - | impl ClientOptionalDefaults {
|
564 + | impl ComplexNestedErrorData {
|
438 565 | #[new]
|
439 - | pub fn new(member: i32) -> Self {
|
440 - | Self { member }
|
566 + | pub fn new(foo: ::std::option::Option<::std::string::String>) -> Self {
|
567 + | Self { foo }
|
441 568 | }
|
442 569 | fn __repr__(&self) -> String {
|
443 570 | format!("{self:?}")
|
444 571 | }
|
445 572 | fn __str__(&self) -> String {
|
446 573 | format!("{self:?}")
|
447 574 | }
|
448 575 | }
|
449 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ClientOptionalDefaults> {
|
576 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ComplexNestedErrorData> {
|
450 577 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
451 - | ob.extract::<ClientOptionalDefaults>().map(Box::new)
|
578 + | ob.extract::<ComplexNestedErrorData>().map(Box::new)
|
452 579 | }
|
453 580 | }
|
454 581 |
|
455 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ClientOptionalDefaults> {
|
582 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ComplexNestedErrorData> {
|
456 583 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
457 584 | (*self).into_py(py)
|
458 585 | }
|
459 586 | }
|
460 - | impl crate::constrained::Constrained for crate::model::ClientOptionalDefaults {
|
461 - | type Unconstrained = crate::model::client_optional_defaults_internal::Builder;
|
587 + | impl ComplexNestedErrorData {
|
588 + | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
589 + | pub fn builder() -> crate::model::complex_nested_error_data::Builder {
|
590 + | crate::model::complex_nested_error_data::Builder::default()
|
591 + | }
|
462 592 | }
|
463 - | impl ClientOptionalDefaults {
|
464 - | /// Creates a new builder-style object to manufacture [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
465 - | pub fn builder() -> crate::model::client_optional_defaults::Builder {
|
466 - | crate::model::client_optional_defaults::Builder::default()
|
593 + |
|
594 + | #[allow(missing_docs)] // documentation missing in model
|
595 + | ///
|
596 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
597 + | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
598 + | ///
|
599 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
600 + | ///
|
601 + | #[derive(
|
602 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
603 + | )]
|
604 + | pub(crate) struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
605 + | impl FooEnumSet {
|
606 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
607 + | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
608 + | self.0
|
609 + | }
|
610 + |
|
611 + | fn check_unique_items(
|
612 + | items: ::std::vec::Vec<crate::model::FooEnum>,
|
613 + | ) -> ::std::result::Result<
|
614 + | ::std::vec::Vec<crate::model::FooEnum>,
|
615 + | crate::model::foo_enum_set_internal::ConstraintViolation,
|
616 + | > {
|
617 + | let mut seen = ::std::collections::HashMap::new();
|
618 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
619 + | for (idx, item) in items.iter().enumerate() {
|
620 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
621 + | duplicate_indices.push(prev_idx);
|
622 + | }
|
623 + | }
|
624 + |
|
625 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
626 + | for idx in &duplicate_indices {
|
627 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
628 + | last_duplicate_indices.push(prev_idx);
|
629 + | }
|
630 + | }
|
631 + | duplicate_indices.extend(last_duplicate_indices);
|
632 + |
|
633 + | if !duplicate_indices.is_empty() {
|
634 + | debug_assert!(duplicate_indices.len() >= 2);
|
635 + | Err(
|
636 + | crate::model::foo_enum_set_internal::ConstraintViolation::UniqueItems {
|
637 + | duplicate_indices,
|
638 + | original: items,
|
639 + | },
|
640 + | )
|
641 + | } else {
|
642 + | Ok(items)
|
643 + | }
|
467 644 | }
|
468 645 | }
|
646 + | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
647 + | type Error = crate::model::foo_enum_set_internal::ConstraintViolation;
|
648 + |
|
649 + | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
650 + | fn try_from(
|
651 + | value: ::std::vec::Vec<crate::model::FooEnum>,
|
652 + | ) -> ::std::result::Result<Self, Self::Error> {
|
653 + | let value = Self::check_unique_items(value)?;
|
654 + |
|
655 + | Ok(Self(value))
|
656 + | }
|
657 + | }
|
658 + |
|
659 + | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
660 + | fn from(value: FooEnumSet) -> Self {
|
661 + | value.into_inner()
|
662 + | }
|
663 + | }
|
664 + | impl crate::constrained::Constrained for FooEnumSet {
|
665 + | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
666 + | }
|
469 667 |
|
470 - | #[::pyo3::pyclass]
|
471 - | /// :param default_string str:
|
472 - | /// :param default_boolean bool:
|
473 - | /// :param default_list typing.List\[str\]:
|
474 - | /// :param default_document_map rest_json.types.Document:
|
475 - | /// :param default_document_string rest_json.types.Document:
|
476 - | /// :param default_document_boolean rest_json.types.Document:
|
477 - | /// :param default_document_list rest_json.types.Document:
|
478 - | /// :param default_timestamp rest_json.types.DateTime:
|
479 - | /// :param default_blob rest_json.types.Blob:
|
480 - | /// :param default_byte int:
|
481 - | /// :param default_short int:
|
482 - | /// :param default_integer int:
|
483 - | /// :param default_long int:
|
484 - | /// :param default_float float:
|
485 - | /// :param default_double float:
|
486 - | /// :param default_map typing.Dict\[str, str\]:
|
487 - | /// :param default_enum rest_json.model.TestEnum:
|
488 - | /// :param default_int_enum int:
|
489 - | /// :param empty_string str:
|
490 - | /// :param false_boolean bool:
|
491 - | /// :param empty_blob rest_json.types.Blob:
|
492 - | /// :param zero_byte int:
|
493 - | /// :param zero_short int:
|
494 - | /// :param zero_integer int:
|
495 - | /// :param zero_long int:
|
496 - | /// :param zero_float float:
|
497 - | /// :param zero_double float:
|
498 - | /// :param default_null_document typing.Optional\[rest_json.types.Document\]:
|
499 - | /// :rtype None:
|
500 668 | #[allow(missing_docs)] // documentation missing in model
|
501 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
502 - | pub struct Defaults {
|
503 - | #[pyo3(get, set)]
|
504 - | /// :type str:
|
505 - | #[allow(missing_docs)] // documentation missing in model
|
506 - | pub default_string: ::std::string::String,
|
507 - | #[pyo3(get, set)]
|
508 - | /// :type bool:
|
509 - | #[allow(missing_docs)] // documentation missing in model
|
510 - | pub default_boolean: bool,
|
511 - | #[pyo3(get, set)]
|
512 - | /// :type typing.List\[str\]:
|
513 - | #[allow(missing_docs)] // documentation missing in model
|
514 - | pub default_list: ::std::vec::Vec<::std::string::String>,
|
515 - | #[pyo3(get, set)]
|
516 - | /// :type rest_json.types.Document:
|
517 - | #[allow(missing_docs)] // documentation missing in model
|
518 - | pub default_document_map: ::aws_smithy_http_server_python::types::Document,
|
519 - | #[pyo3(get, set)]
|
520 - | /// :type rest_json.types.Document:
|
521 - | #[allow(missing_docs)] // documentation missing in model
|
522 - | pub default_document_string: ::aws_smithy_http_server_python::types::Document,
|
523 - | #[pyo3(get, set)]
|
524 - | /// :type rest_json.types.Document:
|
525 - | #[allow(missing_docs)] // documentation missing in model
|
526 - | pub default_document_boolean: ::aws_smithy_http_server_python::types::Document,
|
527 - | #[pyo3(get, set)]
|
528 - | /// :type rest_json.types.Document:
|
529 - | #[allow(missing_docs)] // documentation missing in model
|
530 - | pub default_document_list: ::aws_smithy_http_server_python::types::Document,
|
531 - | #[pyo3(get, set)]
|
532 - | /// :type typing.Optional\[rest_json.types.Document\]:
|
533 - | #[allow(missing_docs)] // documentation missing in model
|
534 - | pub default_null_document:
|
535 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
536 - | #[pyo3(get, set)]
|
537 - | /// :type rest_json.types.DateTime:
|
538 - | #[allow(missing_docs)] // documentation missing in model
|
539 - | pub default_timestamp: ::aws_smithy_http_server_python::types::DateTime,
|
540 - | #[pyo3(get, set)]
|
541 - | /// :type rest_json.types.Blob:
|
542 - | #[allow(missing_docs)] // documentation missing in model
|
543 - | pub default_blob: ::aws_smithy_http_server_python::types::Blob,
|
544 - | #[pyo3(get, set)]
|
545 - | /// :type int:
|
546 - | #[allow(missing_docs)] // documentation missing in model
|
547 - | pub default_byte: i8,
|
548 - | #[pyo3(get, set)]
|
549 - | /// :type int:
|
550 - | #[allow(missing_docs)] // documentation missing in model
|
551 - | pub default_short: i16,
|
552 - | #[pyo3(get, set)]
|
553 - | /// :type int:
|
554 - | #[allow(missing_docs)] // documentation missing in model
|
555 - | pub default_integer: i32,
|
556 - | #[pyo3(get, set)]
|
557 - | /// :type int:
|
558 - | #[allow(missing_docs)] // documentation missing in model
|
559 - | pub default_long: i64,
|
560 - | #[pyo3(get, set)]
|
561 - | /// :type float:
|
562 - | #[allow(missing_docs)] // documentation missing in model
|
563 - | pub default_float: f32,
|
564 - | #[pyo3(get, set)]
|
565 - | /// :type float:
|
566 - | #[allow(missing_docs)] // documentation missing in model
|
567 - | pub default_double: f64,
|
568 - | #[pyo3(get, set)]
|
569 - | /// :type typing.Dict\[str, str\]:
|
570 - | #[allow(missing_docs)] // documentation missing in model
|
571 - | pub default_map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
572 - | #[pyo3(get, set)]
|
573 - | /// :type rest_json.model.TestEnum:
|
574 - | #[allow(missing_docs)] // documentation missing in model
|
575 - | pub default_enum: crate::model::TestEnum,
|
576 - | #[pyo3(get, set)]
|
577 - | /// :type int:
|
578 - | #[allow(missing_docs)] // documentation missing in model
|
579 - | pub default_int_enum: i32,
|
580 - | #[pyo3(get, set)]
|
581 - | /// :type str:
|
582 - | #[allow(missing_docs)] // documentation missing in model
|
583 - | pub empty_string: ::std::string::String,
|
584 - | #[pyo3(get, set)]
|
585 - | /// :type bool:
|
586 - | #[allow(missing_docs)] // documentation missing in model
|
587 - | pub false_boolean: bool,
|
588 - | #[pyo3(get, set)]
|
589 - | /// :type rest_json.types.Blob:
|
590 - | #[allow(missing_docs)] // documentation missing in model
|
591 - | pub empty_blob: ::aws_smithy_http_server_python::types::Blob,
|
592 - | #[pyo3(get, set)]
|
593 - | /// :type int:
|
594 - | #[allow(missing_docs)] // documentation missing in model
|
595 - | pub zero_byte: i8,
|
596 - | #[pyo3(get, set)]
|
597 - | /// :type int:
|
598 - | #[allow(missing_docs)] // documentation missing in model
|
599 - | pub zero_short: i16,
|
600 - | #[pyo3(get, set)]
|
601 - | /// :type int:
|
602 - | #[allow(missing_docs)] // documentation missing in model
|
603 - | pub zero_integer: i32,
|
604 - | #[pyo3(get, set)]
|
605 - | /// :type int:
|
606 - | #[allow(missing_docs)] // documentation missing in model
|
607 - | pub zero_long: i64,
|
669 + | ///
|
670 + | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
671 + | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
672 + | ///
|
673 + | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
674 + | ///
|
675 + | #[derive(
|
676 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
677 + | )]
|
678 + | pub(crate) struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
679 + | impl IntegerEnumSet {
|
680 + | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
681 + | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
682 + | self.0
|
683 + | }
|
684 + |
|
685 + | fn check_unique_items(
|
686 + | items: ::std::vec::Vec<i32>,
|
687 + | ) -> ::std::result::Result<
|
688 + | ::std::vec::Vec<i32>,
|
689 + | crate::model::integer_enum_set_internal::ConstraintViolation,
|
690 + | > {
|
691 + | let mut seen = ::std::collections::HashMap::new();
|
692 + | let mut duplicate_indices = ::std::vec::Vec::new();
|
693 + | for (idx, item) in items.iter().enumerate() {
|
694 + | if let Some(prev_idx) = seen.insert(item, idx) {
|
695 + | duplicate_indices.push(prev_idx);
|
696 + | }
|
697 + | }
|
698 + |
|
699 + | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
700 + | for idx in &duplicate_indices {
|
701 + | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
702 + | last_duplicate_indices.push(prev_idx);
|
703 + | }
|
704 + | }
|
705 + | duplicate_indices.extend(last_duplicate_indices);
|
706 + |
|
707 + | if !duplicate_indices.is_empty() {
|
708 + | debug_assert!(duplicate_indices.len() >= 2);
|
709 + | Err(
|
710 + | crate::model::integer_enum_set_internal::ConstraintViolation::UniqueItems {
|
711 + | duplicate_indices,
|
712 + | original: items,
|
713 + | },
|
714 + | )
|
715 + | } else {
|
716 + | Ok(items)
|
717 + | }
|
718 + | }
|
719 + | }
|
720 + | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
721 + | type Error = crate::model::integer_enum_set_internal::ConstraintViolation;
|
722 + |
|
723 + | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
724 + | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
725 + | let value = Self::check_unique_items(value)?;
|
726 + |
|
727 + | Ok(Self(value))
|
728 + | }
|
729 + | }
|
730 + |
|
731 + | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
732 + | fn from(value: IntegerEnumSet) -> Self {
|
733 + | value.into_inner()
|
734 + | }
|
735 + | }
|
736 + | impl crate::constrained::Constrained for IntegerEnumSet {
|
737 + | type Unconstrained =
|
738 + | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
739 + | }
|
740 + |
|
741 + | #[::pyo3::pyclass]
|
742 + | /// :param foo typing.Optional\[str\]:
|
743 + | /// :param nested typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested2\]:
|
744 + | /// :rtype None:
|
745 + | #[allow(missing_docs)] // documentation missing in model
|
746 + | #[derive(
|
747 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
748 + | )]
|
749 + | pub struct RecursiveShapesInputOutputNested1 {
|
608 750 | #[pyo3(get, set)]
|
609 - | /// :type float:
|
751 + | /// :type typing.Optional\[str\]:
|
610 752 | #[allow(missing_docs)] // documentation missing in model
|
611 - | pub zero_float: f32,
|
753 + | pub foo: ::std::option::Option<::std::string::String>,
|
612 754 | #[pyo3(get, set)]
|
613 - | /// :type float:
|
755 + | /// :type typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested2\]:
|
614 756 | #[allow(missing_docs)] // documentation missing in model
|
615 - | pub zero_double: f64,
|
757 + | pub nested:
|
758 + | ::std::option::Option<::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>>,
|
616 759 | }
|
617 - | impl Defaults {
|
760 + | impl RecursiveShapesInputOutputNested1 {
|
618 761 | #[allow(missing_docs)] // documentation missing in model
|
619 - | pub fn default_string(&self) -> &str {
|
620 - | use std::ops::Deref;
|
621 - | self.default_string.deref()
|
762 + | pub fn foo(&self) -> ::std::option::Option<&str> {
|
763 + | self.foo.as_deref()
|
622 764 | }
|
623 765 | #[allow(missing_docs)] // documentation missing in model
|
624 - | pub fn default_boolean(&self) -> bool {
|
625 - | self.default_boolean
|
766 + | pub fn nested(
|
767 + | &self,
|
768 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested2> {
|
769 + | self.nested.as_deref()
|
626 770 | }
|
627 - | #[allow(missing_docs)] // documentation missing in model
|
628 - | pub fn default_list(&self) -> &[::std::string::String] {
|
629 - | use std::ops::Deref;
|
630 - | self.default_list.deref()
|
771 + | }
|
772 + | #[allow(clippy::new_without_default)]
|
773 + | #[allow(clippy::too_many_arguments)]
|
774 + | #[::pyo3::pymethods]
|
775 + | impl RecursiveShapesInputOutputNested1 {
|
776 + | #[new]
|
777 + | pub fn new(
|
778 + | foo: ::std::option::Option<::std::string::String>,
|
779 + | nested: ::std::option::Option<
|
780 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
781 + | >,
|
782 + | ) -> Self {
|
783 + | Self { foo, nested }
|
631 784 | }
|
632 - | #[allow(missing_docs)] // documentation missing in model
|
633 - | pub fn default_document_map(&self) -> &::aws_smithy_http_server_python::types::Document {
|
634 - | &self.default_document_map
|
785 + | fn __repr__(&self) -> String {
|
786 + | format!("{self:?}")
|
635 787 | }
|
636 - | #[allow(missing_docs)] // documentation missing in model
|
637 - | pub fn default_document_string(&self) -> &::aws_smithy_http_server_python::types::Document {
|
638 - | &self.default_document_string
|
788 + | fn __str__(&self) -> String {
|
789 + | format!("{self:?}")
|
639 790 | }
|
640 - | #[allow(missing_docs)] // documentation missing in model
|
641 - | pub fn default_document_boolean(&self) -> &::aws_smithy_http_server_python::types::Document {
|
642 - | &self.default_document_boolean
|
791 + | }
|
792 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
793 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
794 + | ob.extract::<RecursiveShapesInputOutputNested1>()
|
795 + | .map(Box::new)
|
643 796 | }
|
644 - | #[allow(missing_docs)] // documentation missing in model
|
645 - | pub fn default_document_list(&self) -> &::aws_smithy_http_server_python::types::Document {
|
646 - | &self.default_document_list
|
797 + | }
|
798 + |
|
799 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
800 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
801 + | (*self).into_py(py)
|
647 802 | }
|
648 - | #[allow(missing_docs)] // documentation missing in model
|
649 - | pub fn default_null_document(
|
650 - | &self,
|
651 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Document> {
|
652 - | self.default_null_document.as_ref()
|
803 + | }
|
804 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
805 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
806 + | }
|
807 + | impl RecursiveShapesInputOutputNested1 {
|
808 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
809 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
810 + | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
653 811 | }
|
812 + | }
|
813 + |
|
814 + | /// A union with a representative set of types for members.
|
815 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
816 + | pub enum MyUnion {
|
654 817 | #[allow(missing_docs)] // documentation missing in model
|
655 - | pub fn default_timestamp(&self) -> &::aws_smithy_http_server_python::types::DateTime {
|
656 - | &self.default_timestamp
|
657 - | }
|
818 + | BlobValue(::aws_smithy_http_server_python::types::Blob),
|
658 819 | #[allow(missing_docs)] // documentation missing in model
|
659 - | pub fn default_blob(&self) -> &::aws_smithy_http_server_python::types::Blob {
|
660 - | &self.default_blob
|
661 - | }
|
820 + | BooleanValue(bool),
|
662 821 | #[allow(missing_docs)] // documentation missing in model
|
663 - | pub fn default_byte(&self) -> i8 {
|
664 - | self.default_byte
|
665 - | }
|
822 + | EnumValue(crate::model::FooEnum),
|
666 823 | #[allow(missing_docs)] // documentation missing in model
|
667 - | pub fn default_short(&self) -> i16 {
|
668 - | self.default_short
|
669 - | }
|
824 + | ListValue(::std::vec::Vec<::std::string::String>),
|
670 825 | #[allow(missing_docs)] // documentation missing in model
|
671 - | pub fn default_integer(&self) -> i32 {
|
672 - | self.default_integer
|
673 - | }
|
826 + | MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
674 827 | #[allow(missing_docs)] // documentation missing in model
|
675 - | pub fn default_long(&self) -> i64 {
|
676 - | self.default_long
|
677 - | }
|
828 + | NumberValue(i32),
|
678 829 | #[allow(missing_docs)] // documentation missing in model
|
679 - | pub fn default_float(&self) -> f32 {
|
680 - | self.default_float
|
681 - | }
|
830 + | RenamedStructureValue(crate::model::RenamedGreeting),
|
682 831 | #[allow(missing_docs)] // documentation missing in model
|
683 - | pub fn default_double(&self) -> f64 {
|
684 - | self.default_double
|
685 - | }
|
832 + | StringValue(::std::string::String),
|
686 833 | #[allow(missing_docs)] // documentation missing in model
|
687 - | pub fn default_map(
|
688 - | &self,
|
689 - | ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
690 - | &self.default_map
|
691 - | }
|
834 + | StructureValue(crate::model::GreetingStruct),
|
692 835 | #[allow(missing_docs)] // documentation missing in model
|
693 - | pub fn default_enum(&self) -> &crate::model::TestEnum {
|
836 + | TimestampValue(::aws_smithy_http_server_python::types::DateTime),
|
837 + | }
|
838 + | impl MyUnion {
|
839 + | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_http_server_python::types::Blob).
|
840 + | /// Returns `Err(&Self)` if it can't be converted.
|
841 + | pub fn as_blob_value(
|
842 + | &self,
|
843 + | ) -> ::std::result::Result<&::aws_smithy_http_server_python::types::Blob, &Self> {
|
844 + | if let MyUnion::BlobValue(val) = &self {
|
845 + | ::std::result::Result::Ok(val)
|
846 + | } else {
|
847 + | ::std::result::Result::Err(self)
|
848 + | }
|
849 + | }
|
850 + | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
851 + | pub fn is_blob_value(&self) -> bool {
|
852 + | self.as_blob_value().is_ok()
|
853 + | }
|
854 + | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
855 + | /// Returns `Err(&Self)` if it can't be converted.
|
856 + | pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
|
857 + | if let MyUnion::BooleanValue(val) = &self {
|
858 + | ::std::result::Result::Ok(val)
|
859 + | } else {
|
860 + | ::std::result::Result::Err(self)
|
861 + | }
|
862 + | }
|
863 + | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
864 + | pub fn is_boolean_value(&self) -> bool {
|
865 + | self.as_boolean_value().is_ok()
|
866 + | }
|
867 + | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
868 + | /// Returns `Err(&Self)` if it can't be converted.
|
869 + | pub fn as_enum_value(&self) -> ::std::result::Result<&crate::model::FooEnum, &Self> {
|
870 + | if let MyUnion::EnumValue(val) = &self {
|
871 + | ::std::result::Result::Ok(val)
|
872 + | } else {
|
873 + | ::std::result::Result::Err(self)
|
874 + | }
|
875 + | }
|
876 + | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
877 + | pub fn is_enum_value(&self) -> bool {
|
878 + | self.as_enum_value().is_ok()
|
879 + | }
|
880 + | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
881 + | /// Returns `Err(&Self)` if it can't be converted.
|
882 + | pub fn as_list_value(
|
883 + | &self,
|
884 + | ) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
|
885 + | if let MyUnion::ListValue(val) = &self {
|
886 + | ::std::result::Result::Ok(val)
|
887 + | } else {
|
888 + | ::std::result::Result::Err(self)
|
889 + | }
|
890 + | }
|
891 + | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
892 + | pub fn is_list_value(&self) -> bool {
|
893 + | self.as_list_value().is_ok()
|
894 + | }
|
895 + | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
896 + | /// Returns `Err(&Self)` if it can't be converted.
|
897 + | pub fn as_map_value(
|
898 + | &self,
|
899 + | ) -> ::std::result::Result<
|
900 + | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
901 + | &Self,
|
902 + | > {
|
903 + | if let MyUnion::MapValue(val) = &self {
|
904 + | ::std::result::Result::Ok(val)
|
905 + | } else {
|
906 + | ::std::result::Result::Err(self)
|
907 + | }
|
908 + | }
|
909 + | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
910 + | pub fn is_map_value(&self) -> bool {
|
911 + | self.as_map_value().is_ok()
|
912 + | }
|
913 + | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
914 + | /// Returns `Err(&Self)` if it can't be converted.
|
915 + | pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
|
916 + | if let MyUnion::NumberValue(val) = &self {
|
917 + | ::std::result::Result::Ok(val)
|
918 + | } else {
|
919 + | ::std::result::Result::Err(self)
|
920 + | }
|
921 + | }
|
922 + | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
923 + | pub fn is_number_value(&self) -> bool {
|
924 + | self.as_number_value().is_ok()
|
925 + | }
|
926 + | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
927 + | /// Returns `Err(&Self)` if it can't be converted.
|
928 + | pub fn as_renamed_structure_value(
|
929 + | &self,
|
930 + | ) -> ::std::result::Result<&crate::model::RenamedGreeting, &Self> {
|
931 + | if let MyUnion::RenamedStructureValue(val) = &self {
|
932 + | ::std::result::Result::Ok(val)
|
933 + | } else {
|
934 + | ::std::result::Result::Err(self)
|
935 + | }
|
936 + | }
|
937 + | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
938 + | pub fn is_renamed_structure_value(&self) -> bool {
|
939 + | self.as_renamed_structure_value().is_ok()
|
940 + | }
|
941 + | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
942 + | /// Returns `Err(&Self)` if it can't be converted.
|
943 + | pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
944 + | if let MyUnion::StringValue(val) = &self {
|
945 + | ::std::result::Result::Ok(val)
|
946 + | } else {
|
947 + | ::std::result::Result::Err(self)
|
948 + | }
|
949 + | }
|
950 + | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
951 + | pub fn is_string_value(&self) -> bool {
|
952 + | self.as_string_value().is_ok()
|
953 + | }
|
954 + | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
955 + | /// Returns `Err(&Self)` if it can't be converted.
|
956 + | pub fn as_structure_value(
|
957 + | &self,
|
958 + | ) -> ::std::result::Result<&crate::model::GreetingStruct, &Self> {
|
959 + | if let MyUnion::StructureValue(val) = &self {
|
960 + | ::std::result::Result::Ok(val)
|
961 + | } else {
|
962 + | ::std::result::Result::Err(self)
|
963 + | }
|
964 + | }
|
965 + | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
966 + | pub fn is_structure_value(&self) -> bool {
|
967 + | self.as_structure_value().is_ok()
|
968 + | }
|
969 + | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_http_server_python::types::DateTime).
|
970 + | /// Returns `Err(&Self)` if it can't be converted.
|
971 + | pub fn as_timestamp_value(
|
972 + | &self,
|
973 + | ) -> ::std::result::Result<&::aws_smithy_http_server_python::types::DateTime, &Self> {
|
974 + | if let MyUnion::TimestampValue(val) = &self {
|
975 + | ::std::result::Result::Ok(val)
|
976 + | } else {
|
977 + | ::std::result::Result::Err(self)
|
978 + | }
|
979 + | }
|
980 + | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
981 + | pub fn is_timestamp_value(&self) -> bool {
|
982 + | self.as_timestamp_value().is_ok()
|
983 + | }
|
984 + | }
|
985 + | #[pyo3::pyclass(name = "MyUnion")]
|
986 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
987 + | pub struct PyUnionMarkerMyUnion(pub MyUnion);
|
988 + | #[::pyo3::pymethods]
|
989 + | impl PyUnionMarkerMyUnion {
|
990 + | #[staticmethod]
|
991 + | /// Creates a new union instance of [`BlobValue`](crate::model::MyUnion::BlobValue)
|
992 + | /// :param data rest_json.types.Blob:
|
993 + | /// :rtype MyUnion:
|
994 + | pub fn blob_value(data: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
995 + | Self(MyUnion::BlobValue(data))
|
996 + | }
|
997 + | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_http_server_python::types::Blob).
|
998 + | /// :rtype rest_json.types.Blob:
|
999 + | pub fn as_blob_value(&self) -> ::pyo3::PyResult<::aws_smithy_http_server_python::types::Blob> {
|
1000 + | match self.0.as_blob_value() {
|
1001 + | Ok(variant) => Ok(variant.clone()),
|
1002 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1003 + | r"MyUnion variant is not of type rest_json.types.Blob",
|
1004 + | )),
|
1005 + | }
|
1006 + | }
|
1007 + | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
1008 + | /// :rtype bool:
|
1009 + | pub fn is_blob_value(&self) -> bool {
|
1010 + | self.0.is_blob_value()
|
1011 + | }
|
1012 + | #[staticmethod]
|
1013 + | /// Creates a new union instance of [`BooleanValue`](crate::model::MyUnion::BooleanValue)
|
1014 + | /// :param data bool:
|
1015 + | /// :rtype MyUnion:
|
1016 + | pub fn boolean_value(data: bool) -> Self {
|
1017 + | Self(MyUnion::BooleanValue(data))
|
1018 + | }
|
1019 + | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
1020 + | /// :rtype bool:
|
1021 + | pub fn as_boolean_value(&self) -> ::pyo3::PyResult<bool> {
|
1022 + | match self.0.as_boolean_value() {
|
1023 + | Ok(variant) => Ok(*variant),
|
1024 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1025 + | r"MyUnion variant is not of type bool",
|
1026 + | )),
|
1027 + | }
|
1028 + | }
|
1029 + | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
1030 + | /// :rtype bool:
|
1031 + | pub fn is_boolean_value(&self) -> bool {
|
1032 + | self.0.is_boolean_value()
|
1033 + | }
|
1034 + | #[staticmethod]
|
1035 + | /// Creates a new union instance of [`EnumValue`](crate::model::MyUnion::EnumValue)
|
1036 + | /// :param data rest_json.model.FooEnum:
|
1037 + | /// :rtype MyUnion:
|
1038 + | pub fn enum_value(data: crate::model::FooEnum) -> Self {
|
1039 + | Self(MyUnion::EnumValue(data))
|
1040 + | }
|
1041 + | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
1042 + | /// :rtype rest_json.model.FooEnum:
|
1043 + | pub fn as_enum_value(&self) -> ::pyo3::PyResult<crate::model::FooEnum> {
|
1044 + | match self.0.as_enum_value() {
|
1045 + | Ok(variant) => Ok(variant.clone()),
|
1046 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1047 + | r"MyUnion variant is not of type rest_json.model.FooEnum",
|
1048 + | )),
|
1049 + | }
|
1050 + | }
|
1051 + | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
1052 + | /// :rtype bool:
|
1053 + | pub fn is_enum_value(&self) -> bool {
|
1054 + | self.0.is_enum_value()
|
1055 + | }
|
1056 + | #[staticmethod]
|
1057 + | /// Creates a new union instance of [`ListValue`](crate::model::MyUnion::ListValue)
|
1058 + | /// :param data typing.List\[str\]:
|
1059 + | /// :rtype MyUnion:
|
1060 + | pub fn list_value(data: ::std::vec::Vec<::std::string::String>) -> Self {
|
1061 + | Self(MyUnion::ListValue(data))
|
1062 + | }
|
1063 + | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
1064 + | /// :rtype typing.List\[str\]:
|
1065 + | pub fn as_list_value(&self) -> ::pyo3::PyResult<::std::vec::Vec<::std::string::String>> {
|
1066 + | match self.0.as_list_value() {
|
1067 + | Ok(variant) => Ok(variant.clone()),
|
1068 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1069 + | r"MyUnion variant is not of type typing.List\[str\]",
|
1070 + | )),
|
1071 + | }
|
1072 + | }
|
1073 + | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
1074 + | /// :rtype bool:
|
1075 + | pub fn is_list_value(&self) -> bool {
|
1076 + | self.0.is_list_value()
|
1077 + | }
|
1078 + | #[staticmethod]
|
1079 + | /// Creates a new union instance of [`MapValue`](crate::model::MyUnion::MapValue)
|
1080 + | /// :param data typing.Dict\[str, str\]:
|
1081 + | /// :rtype MyUnion:
|
1082 + | pub fn map_value(
|
1083 + | data: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1084 + | ) -> Self {
|
1085 + | Self(MyUnion::MapValue(data))
|
1086 + | }
|
1087 + | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
1088 + | /// :rtype typing.Dict\[str, str\]:
|
1089 + | pub fn as_map_value(
|
1090 + | &self,
|
1091 + | ) -> ::pyo3::PyResult<::std::collections::HashMap<::std::string::String, ::std::string::String>>
|
1092 + | {
|
1093 + | match self.0.as_map_value() {
|
1094 + | Ok(variant) => Ok(variant.clone()),
|
1095 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1096 + | r"MyUnion variant is not of type typing.Dict\[str, str\]",
|
1097 + | )),
|
1098 + | }
|
1099 + | }
|
1100 + | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
1101 + | /// :rtype bool:
|
1102 + | pub fn is_map_value(&self) -> bool {
|
1103 + | self.0.is_map_value()
|
1104 + | }
|
1105 + | #[staticmethod]
|
1106 + | /// Creates a new union instance of [`NumberValue`](crate::model::MyUnion::NumberValue)
|
1107 + | /// :param data int:
|
1108 + | /// :rtype MyUnion:
|
1109 + | pub fn number_value(data: i32) -> Self {
|
1110 + | Self(MyUnion::NumberValue(data))
|
1111 + | }
|
1112 + | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
1113 + | /// :rtype int:
|
1114 + | pub fn as_number_value(&self) -> ::pyo3::PyResult<i32> {
|
1115 + | match self.0.as_number_value() {
|
1116 + | Ok(variant) => Ok(*variant),
|
1117 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1118 + | r"MyUnion variant is not of type int",
|
1119 + | )),
|
1120 + | }
|
1121 + | }
|
1122 + | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
1123 + | /// :rtype bool:
|
1124 + | pub fn is_number_value(&self) -> bool {
|
1125 + | self.0.is_number_value()
|
1126 + | }
|
1127 + | #[staticmethod]
|
1128 + | /// Creates a new union instance of [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue)
|
1129 + | /// :param data rest_json.model.RenamedGreeting:
|
1130 + | /// :rtype MyUnion:
|
1131 + | pub fn renamed_structure_value(data: crate::model::RenamedGreeting) -> Self {
|
1132 + | Self(MyUnion::RenamedStructureValue(data))
|
1133 + | }
|
1134 + | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
1135 + | /// :rtype rest_json.model.RenamedGreeting:
|
1136 + | pub fn as_renamed_structure_value(&self) -> ::pyo3::PyResult<crate::model::RenamedGreeting> {
|
1137 + | match self.0.as_renamed_structure_value() {
|
1138 + | Ok(variant) => Ok(variant.clone()),
|
1139 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1140 + | r"MyUnion variant is not of type rest_json.model.RenamedGreeting",
|
1141 + | )),
|
1142 + | }
|
1143 + | }
|
1144 + | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
1145 + | /// :rtype bool:
|
1146 + | pub fn is_renamed_structure_value(&self) -> bool {
|
1147 + | self.0.is_renamed_structure_value()
|
1148 + | }
|
1149 + | #[staticmethod]
|
1150 + | /// Creates a new union instance of [`StringValue`](crate::model::MyUnion::StringValue)
|
1151 + | /// :param data str:
|
1152 + | /// :rtype MyUnion:
|
1153 + | pub fn string_value(data: ::std::string::String) -> Self {
|
1154 + | Self(MyUnion::StringValue(data))
|
1155 + | }
|
1156 + | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
1157 + | /// :rtype str:
|
1158 + | pub fn as_string_value(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1159 + | match self.0.as_string_value() {
|
1160 + | Ok(variant) => Ok(variant.clone()),
|
1161 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1162 + | r"MyUnion variant is not of type str",
|
1163 + | )),
|
1164 + | }
|
1165 + | }
|
1166 + | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
1167 + | /// :rtype bool:
|
1168 + | pub fn is_string_value(&self) -> bool {
|
1169 + | self.0.is_string_value()
|
1170 + | }
|
1171 + | #[staticmethod]
|
1172 + | /// Creates a new union instance of [`StructureValue`](crate::model::MyUnion::StructureValue)
|
1173 + | /// :param data rest_json.model.GreetingStruct:
|
1174 + | /// :rtype MyUnion:
|
1175 + | pub fn structure_value(data: crate::model::GreetingStruct) -> Self {
|
1176 + | Self(MyUnion::StructureValue(data))
|
1177 + | }
|
1178 + | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
1179 + | /// :rtype rest_json.model.GreetingStruct:
|
1180 + | pub fn as_structure_value(&self) -> ::pyo3::PyResult<crate::model::GreetingStruct> {
|
1181 + | match self.0.as_structure_value() {
|
1182 + | Ok(variant) => Ok(variant.clone()),
|
1183 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1184 + | r"MyUnion variant is not of type rest_json.model.GreetingStruct",
|
1185 + | )),
|
1186 + | }
|
1187 + | }
|
1188 + | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
1189 + | /// :rtype bool:
|
1190 + | pub fn is_structure_value(&self) -> bool {
|
1191 + | self.0.is_structure_value()
|
1192 + | }
|
1193 + | #[staticmethod]
|
1194 + | /// Creates a new union instance of [`TimestampValue`](crate::model::MyUnion::TimestampValue)
|
1195 + | /// :param data rest_json.types.DateTime:
|
1196 + | /// :rtype MyUnion:
|
1197 + | pub fn timestamp_value(data: ::aws_smithy_http_server_python::types::DateTime) -> Self {
|
1198 + | Self(MyUnion::TimestampValue(data))
|
1199 + | }
|
1200 + | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_http_server_python::types::DateTime).
|
1201 + | /// :rtype rest_json.types.DateTime:
|
1202 + | pub fn as_timestamp_value(
|
1203 + | &self,
|
1204 + | ) -> ::pyo3::PyResult<::aws_smithy_http_server_python::types::DateTime> {
|
1205 + | match self.0.as_timestamp_value() {
|
1206 + | Ok(variant) => Ok(variant.clone()),
|
1207 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1208 + | r"MyUnion variant is not of type rest_json.types.DateTime",
|
1209 + | )),
|
1210 + | }
|
1211 + | }
|
1212 + | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
1213 + | /// :rtype bool:
|
1214 + | pub fn is_timestamp_value(&self) -> bool {
|
1215 + | self.0.is_timestamp_value()
|
1216 + | }
|
1217 + | }
|
1218 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for MyUnion {
|
1219 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1220 + | PyUnionMarkerMyUnion(self).into_py(py)
|
1221 + | }
|
1222 + | }
|
1223 + | impl<'source> ::pyo3::FromPyObject<'source> for MyUnion {
|
1224 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1225 + | let data: PyUnionMarkerMyUnion = obj.extract()?;
|
1226 + | Ok(data.0)
|
1227 + | }
|
1228 + | }
|
1229 + |
|
1230 + | #[allow(missing_docs)] // documentation missing in model
|
1231 + | #[derive(
|
1232 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1233 + | )]
|
1234 + | pub enum PlayerAction {
|
1235 + | /// Quit the game.
|
1236 + | Quit,
|
1237 + | }
|
1238 + | impl PlayerAction {
|
1239 + | #[allow(irrefutable_let_patterns)]
|
1240 + | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
1241 + | /// Returns `Err(&Self)` if it can't be converted.
|
1242 + | pub fn as_quit(&self) -> ::std::result::Result<(), &Self> {
|
1243 + | if let PlayerAction::Quit = &self {
|
1244 + | ::std::result::Result::Ok(())
|
1245 + | } else {
|
1246 + | ::std::result::Result::Err(self)
|
1247 + | }
|
1248 + | }
|
1249 + | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
1250 + | pub fn is_quit(&self) -> bool {
|
1251 + | self.as_quit().is_ok()
|
1252 + | }
|
1253 + | }
|
1254 + | #[pyo3::pyclass(name = "PlayerAction")]
|
1255 + | #[derive(
|
1256 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1257 + | )]
|
1258 + | pub struct PyUnionMarkerPlayerAction(pub PlayerAction);
|
1259 + | #[::pyo3::pymethods]
|
1260 + | impl PyUnionMarkerPlayerAction {
|
1261 + | #[allow(irrefutable_let_patterns)]
|
1262 + | #[staticmethod]
|
1263 + | /// Creates a new union instance of [`Quit`](crate::model::PlayerAction::Quit)
|
1264 + | /// :rtype PlayerAction:
|
1265 + | pub fn quit() -> Self {
|
1266 + | Self(PlayerAction::Quit)
|
1267 + | }
|
1268 + | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
1269 + | /// :rtype None:
|
1270 + | pub fn as_quit(&self) -> ::pyo3::PyResult<()> {
|
1271 + | self.0.as_quit().map_err(|_| {
|
1272 + | ::pyo3::exceptions::PyValueError::new_err("PlayerAction variant is not None")
|
1273 + | })
|
1274 + | }
|
1275 + | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
1276 + | /// :rtype bool:
|
1277 + | pub fn is_quit(&self) -> bool {
|
1278 + | self.0.is_quit()
|
1279 + | }
|
1280 + | }
|
1281 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for PlayerAction {
|
1282 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1283 + | PyUnionMarkerPlayerAction(self).into_py(py)
|
1284 + | }
|
1285 + | }
|
1286 + | impl<'source> ::pyo3::FromPyObject<'source> for PlayerAction {
|
1287 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1288 + | let data: PyUnionMarkerPlayerAction = obj.extract()?;
|
1289 + | Ok(data.0)
|
1290 + | }
|
1291 + | }
|
1292 + |
|
1293 + | #[allow(missing_docs)] // documentation missing in model
|
1294 + | #[derive(
|
1295 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1296 + | )]
|
1297 + | pub enum UnionWithJsonName {
|
1298 + | #[allow(missing_docs)] // documentation missing in model
|
1299 + | Bar(::std::string::String),
|
1300 + | #[allow(missing_docs)] // documentation missing in model
|
1301 + | Baz(::std::string::String),
|
1302 + | #[allow(missing_docs)] // documentation missing in model
|
1303 + | Foo(::std::string::String),
|
1304 + | }
|
1305 + | impl UnionWithJsonName {
|
1306 + | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
1307 + | /// Returns `Err(&Self)` if it can't be converted.
|
1308 + | pub fn as_bar(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1309 + | if let UnionWithJsonName::Bar(val) = &self {
|
1310 + | ::std::result::Result::Ok(val)
|
1311 + | } else {
|
1312 + | ::std::result::Result::Err(self)
|
1313 + | }
|
1314 + | }
|
1315 + | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
1316 + | pub fn is_bar(&self) -> bool {
|
1317 + | self.as_bar().is_ok()
|
1318 + | }
|
1319 + | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
1320 + | /// Returns `Err(&Self)` if it can't be converted.
|
1321 + | pub fn as_baz(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1322 + | if let UnionWithJsonName::Baz(val) = &self {
|
1323 + | ::std::result::Result::Ok(val)
|
1324 + | } else {
|
1325 + | ::std::result::Result::Err(self)
|
1326 + | }
|
1327 + | }
|
1328 + | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
1329 + | pub fn is_baz(&self) -> bool {
|
1330 + | self.as_baz().is_ok()
|
1331 + | }
|
1332 + | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
1333 + | /// Returns `Err(&Self)` if it can't be converted.
|
1334 + | pub fn as_foo(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1335 + | if let UnionWithJsonName::Foo(val) = &self {
|
1336 + | ::std::result::Result::Ok(val)
|
1337 + | } else {
|
1338 + | ::std::result::Result::Err(self)
|
1339 + | }
|
1340 + | }
|
1341 + | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
1342 + | pub fn is_foo(&self) -> bool {
|
1343 + | self.as_foo().is_ok()
|
1344 + | }
|
1345 + | }
|
1346 + | #[pyo3::pyclass(name = "UnionWithJsonName")]
|
1347 + | #[derive(
|
1348 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1349 + | )]
|
1350 + | pub struct PyUnionMarkerUnionWithJsonName(pub UnionWithJsonName);
|
1351 + | #[::pyo3::pymethods]
|
1352 + | impl PyUnionMarkerUnionWithJsonName {
|
1353 + | #[staticmethod]
|
1354 + | /// Creates a new union instance of [`Bar`](crate::model::UnionWithJsonName::Bar)
|
1355 + | /// :param data str:
|
1356 + | /// :rtype UnionWithJsonName:
|
1357 + | pub fn bar(data: ::std::string::String) -> Self {
|
1358 + | Self(UnionWithJsonName::Bar(data))
|
1359 + | }
|
1360 + | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
1361 + | /// :rtype str:
|
1362 + | pub fn as_bar(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1363 + | match self.0.as_bar() {
|
1364 + | Ok(variant) => Ok(variant.clone()),
|
1365 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1366 + | r"UnionWithJsonName variant is not of type str",
|
1367 + | )),
|
1368 + | }
|
1369 + | }
|
1370 + | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
1371 + | /// :rtype bool:
|
1372 + | pub fn is_bar(&self) -> bool {
|
1373 + | self.0.is_bar()
|
1374 + | }
|
1375 + | #[staticmethod]
|
1376 + | /// Creates a new union instance of [`Baz`](crate::model::UnionWithJsonName::Baz)
|
1377 + | /// :param data str:
|
1378 + | /// :rtype UnionWithJsonName:
|
1379 + | pub fn baz(data: ::std::string::String) -> Self {
|
1380 + | Self(UnionWithJsonName::Baz(data))
|
1381 + | }
|
1382 + | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
1383 + | /// :rtype str:
|
1384 + | pub fn as_baz(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1385 + | match self.0.as_baz() {
|
1386 + | Ok(variant) => Ok(variant.clone()),
|
1387 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1388 + | r"UnionWithJsonName variant is not of type str",
|
1389 + | )),
|
1390 + | }
|
1391 + | }
|
1392 + | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
1393 + | /// :rtype bool:
|
1394 + | pub fn is_baz(&self) -> bool {
|
1395 + | self.0.is_baz()
|
1396 + | }
|
1397 + | #[staticmethod]
|
1398 + | /// Creates a new union instance of [`Foo`](crate::model::UnionWithJsonName::Foo)
|
1399 + | /// :param data str:
|
1400 + | /// :rtype UnionWithJsonName:
|
1401 + | pub fn foo(data: ::std::string::String) -> Self {
|
1402 + | Self(UnionWithJsonName::Foo(data))
|
1403 + | }
|
1404 + | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
1405 + | /// :rtype str:
|
1406 + | pub fn as_foo(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1407 + | match self.0.as_foo() {
|
1408 + | Ok(variant) => Ok(variant.clone()),
|
1409 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1410 + | r"UnionWithJsonName variant is not of type str",
|
1411 + | )),
|
1412 + | }
|
1413 + | }
|
1414 + | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
1415 + | /// :rtype bool:
|
1416 + | pub fn is_foo(&self) -> bool {
|
1417 + | self.0.is_foo()
|
1418 + | }
|
1419 + | }
|
1420 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for UnionWithJsonName {
|
1421 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1422 + | PyUnionMarkerUnionWithJsonName(self).into_py(py)
|
1423 + | }
|
1424 + | }
|
1425 + | impl<'source> ::pyo3::FromPyObject<'source> for UnionWithJsonName {
|
1426 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1427 + | let data: PyUnionMarkerUnionWithJsonName = obj.extract()?;
|
1428 + | Ok(data.0)
|
1429 + | }
|
1430 + | }
|
1431 + |
|
1432 + | #[allow(missing_docs)] // documentation missing in model
|
1433 + | #[derive(
|
1434 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1435 + | )]
|
1436 + | pub enum SimpleUnion {
|
1437 + | #[allow(missing_docs)] // documentation missing in model
|
1438 + | Int(i32),
|
1439 + | #[allow(missing_docs)] // documentation missing in model
|
1440 + | String(::std::string::String),
|
1441 + | }
|
1442 + | impl SimpleUnion {
|
1443 + | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
1444 + | /// Returns `Err(&Self)` if it can't be converted.
|
1445 + | pub fn as_int(&self) -> ::std::result::Result<&i32, &Self> {
|
1446 + | if let SimpleUnion::Int(val) = &self {
|
1447 + | ::std::result::Result::Ok(val)
|
1448 + | } else {
|
1449 + | ::std::result::Result::Err(self)
|
1450 + | }
|
1451 + | }
|
1452 + | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
1453 + | pub fn is_int(&self) -> bool {
|
1454 + | self.as_int().is_ok()
|
1455 + | }
|
1456 + | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
1457 + | /// Returns `Err(&Self)` if it can't be converted.
|
1458 + | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1459 + | if let SimpleUnion::String(val) = &self {
|
1460 + | ::std::result::Result::Ok(val)
|
1461 + | } else {
|
1462 + | ::std::result::Result::Err(self)
|
1463 + | }
|
1464 + | }
|
1465 + | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
1466 + | pub fn is_string(&self) -> bool {
|
1467 + | self.as_string().is_ok()
|
1468 + | }
|
1469 + | }
|
1470 + | #[pyo3::pyclass(name = "SimpleUnion")]
|
1471 + | #[derive(
|
1472 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1473 + | )]
|
1474 + | pub struct PyUnionMarkerSimpleUnion(pub SimpleUnion);
|
1475 + | #[::pyo3::pymethods]
|
1476 + | impl PyUnionMarkerSimpleUnion {
|
1477 + | #[staticmethod]
|
1478 + | /// Creates a new union instance of [`Int`](crate::model::SimpleUnion::Int)
|
1479 + | /// :param data int:
|
1480 + | /// :rtype SimpleUnion:
|
1481 + | pub fn int(data: i32) -> Self {
|
1482 + | Self(SimpleUnion::Int(data))
|
1483 + | }
|
1484 + | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
1485 + | /// :rtype int:
|
1486 + | pub fn as_int(&self) -> ::pyo3::PyResult<i32> {
|
1487 + | match self.0.as_int() {
|
1488 + | Ok(variant) => Ok(*variant),
|
1489 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1490 + | r"SimpleUnion variant is not of type int",
|
1491 + | )),
|
1492 + | }
|
1493 + | }
|
1494 + | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
1495 + | /// :rtype bool:
|
1496 + | pub fn is_int(&self) -> bool {
|
1497 + | self.0.is_int()
|
1498 + | }
|
1499 + | #[staticmethod]
|
1500 + | /// Creates a new union instance of [`String`](crate::model::SimpleUnion::String)
|
1501 + | /// :param data str:
|
1502 + | /// :rtype SimpleUnion:
|
1503 + | pub fn string(data: ::std::string::String) -> Self {
|
1504 + | Self(SimpleUnion::String(data))
|
1505 + | }
|
1506 + | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
1507 + | /// :rtype str:
|
1508 + | pub fn as_string(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1509 + | match self.0.as_string() {
|
1510 + | Ok(variant) => Ok(variant.clone()),
|
1511 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1512 + | r"SimpleUnion variant is not of type str",
|
1513 + | )),
|
1514 + | }
|
1515 + | }
|
1516 + | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
1517 + | /// :rtype bool:
|
1518 + | pub fn is_string(&self) -> bool {
|
1519 + | self.0.is_string()
|
1520 + | }
|
1521 + | }
|
1522 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for SimpleUnion {
|
1523 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1524 + | PyUnionMarkerSimpleUnion(self).into_py(py)
|
1525 + | }
|
1526 + | }
|
1527 + | impl<'source> ::pyo3::FromPyObject<'source> for SimpleUnion {
|
1528 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1529 + | let data: PyUnionMarkerSimpleUnion = obj.extract()?;
|
1530 + | Ok(data.0)
|
1531 + | }
|
1532 + | }
|
1533 + |
|
1534 + | #[::pyo3::pyclass]
|
1535 + | /// :param timeout typing.Optional\[int\]:
|
1536 + | /// :rtype None:
|
1537 + | #[allow(missing_docs)] // documentation missing in model
|
1538 + | #[derive(
|
1539 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1540 + | )]
|
1541 + | pub struct TestConfig {
|
1542 + | #[pyo3(get, set)]
|
1543 + | /// :type typing.Optional\[int\]:
|
1544 + | #[allow(missing_docs)] // documentation missing in model
|
1545 + | pub timeout: ::std::option::Option<i32>,
|
1546 + | }
|
1547 + | impl TestConfig {
|
1548 + | #[allow(missing_docs)] // documentation missing in model
|
1549 + | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
1550 + | self.timeout
|
1551 + | }
|
1552 + | }
|
1553 + | #[allow(clippy::new_without_default)]
|
1554 + | #[allow(clippy::too_many_arguments)]
|
1555 + | #[::pyo3::pymethods]
|
1556 + | impl TestConfig {
|
1557 + | #[new]
|
1558 + | pub fn new(timeout: ::std::option::Option<i32>) -> Self {
|
1559 + | Self { timeout }
|
1560 + | }
|
1561 + | fn __repr__(&self) -> String {
|
1562 + | format!("{self:?}")
|
1563 + | }
|
1564 + | fn __str__(&self) -> String {
|
1565 + | format!("{self:?}")
|
1566 + | }
|
1567 + | }
|
1568 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<TestConfig> {
|
1569 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1570 + | ob.extract::<TestConfig>().map(Box::new)
|
1571 + | }
|
1572 + | }
|
1573 + |
|
1574 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<TestConfig> {
|
1575 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1576 + | (*self).into_py(py)
|
1577 + | }
|
1578 + | }
|
1579 + | impl crate::constrained::Constrained for crate::model::TestConfig {
|
1580 + | type Unconstrained = crate::model::test_config_internal::Builder;
|
1581 + | }
|
1582 + | impl TestConfig {
|
1583 + | /// Creates a new builder-style object to manufacture [`TestConfig`](crate::model::TestConfig).
|
1584 + | pub fn builder() -> crate::model::test_config::Builder {
|
1585 + | crate::model::test_config::Builder::default()
|
1586 + | }
|
1587 + | }
|
1588 + |
|
1589 + | #[::pyo3::pyclass]
|
1590 + | /// :param data typing.Optional\[int\]:
|
1591 + | /// :rtype None:
|
1592 + | #[allow(missing_docs)] // documentation missing in model
|
1593 + | #[derive(
|
1594 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1595 + | )]
|
1596 + | pub struct PayloadConfig {
|
1597 + | #[pyo3(get, set)]
|
1598 + | /// :type typing.Optional\[int\]:
|
1599 + | #[allow(missing_docs)] // documentation missing in model
|
1600 + | pub data: ::std::option::Option<i32>,
|
1601 + | }
|
1602 + | impl PayloadConfig {
|
1603 + | #[allow(missing_docs)] // documentation missing in model
|
1604 + | pub fn data(&self) -> ::std::option::Option<i32> {
|
1605 + | self.data
|
1606 + | }
|
1607 + | }
|
1608 + | #[allow(clippy::new_without_default)]
|
1609 + | #[allow(clippy::too_many_arguments)]
|
1610 + | #[::pyo3::pymethods]
|
1611 + | impl PayloadConfig {
|
1612 + | #[new]
|
1613 + | pub fn new(data: ::std::option::Option<i32>) -> Self {
|
1614 + | Self { data }
|
1615 + | }
|
1616 + | fn __repr__(&self) -> String {
|
1617 + | format!("{self:?}")
|
1618 + | }
|
1619 + | fn __str__(&self) -> String {
|
1620 + | format!("{self:?}")
|
1621 + | }
|
1622 + | }
|
1623 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<PayloadConfig> {
|
1624 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1625 + | ob.extract::<PayloadConfig>().map(Box::new)
|
1626 + | }
|
1627 + | }
|
1628 + |
|
1629 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<PayloadConfig> {
|
1630 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1631 + | (*self).into_py(py)
|
1632 + | }
|
1633 + | }
|
1634 + | impl crate::constrained::Constrained for crate::model::PayloadConfig {
|
1635 + | type Unconstrained = crate::model::payload_config_internal::Builder;
|
1636 + | }
|
1637 + | impl PayloadConfig {
|
1638 + | /// Creates a new builder-style object to manufacture [`PayloadConfig`](crate::model::PayloadConfig).
|
1639 + | pub fn builder() -> crate::model::payload_config::Builder {
|
1640 + | crate::model::payload_config::Builder::default()
|
1641 + | }
|
1642 + | }
|
1643 + |
|
1644 + | #[::pyo3::pyclass]
|
1645 + | /// :param default_string str:
|
1646 + | /// :param default_boolean bool:
|
1647 + | /// :param default_list typing.List\[str\]:
|
1648 + | /// :param default_document_map rest_json.types.Document:
|
1649 + | /// :param default_document_string rest_json.types.Document:
|
1650 + | /// :param default_document_boolean rest_json.types.Document:
|
1651 + | /// :param default_document_list rest_json.types.Document:
|
1652 + | /// :param default_timestamp rest_json.types.DateTime:
|
1653 + | /// :param default_blob rest_json.types.Blob:
|
1654 + | /// :param default_byte int:
|
1655 + | /// :param default_short int:
|
1656 + | /// :param default_integer int:
|
1657 + | /// :param default_long int:
|
1658 + | /// :param default_float float:
|
1659 + | /// :param default_double float:
|
1660 + | /// :param default_map typing.Dict\[str, str\]:
|
1661 + | /// :param default_enum rest_json.model.TestEnum:
|
1662 + | /// :param default_int_enum int:
|
1663 + | /// :param empty_string str:
|
1664 + | /// :param false_boolean bool:
|
1665 + | /// :param empty_blob rest_json.types.Blob:
|
1666 + | /// :param zero_byte int:
|
1667 + | /// :param zero_short int:
|
1668 + | /// :param zero_integer int:
|
1669 + | /// :param zero_long int:
|
1670 + | /// :param zero_float float:
|
1671 + | /// :param zero_double float:
|
1672 + | /// :param default_null_document typing.Optional\[rest_json.types.Document\]:
|
1673 + | /// :rtype None:
|
1674 + | #[allow(missing_docs)] // documentation missing in model
|
1675 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1676 + | pub struct Defaults {
|
1677 + | #[pyo3(get, set)]
|
1678 + | /// :type str:
|
1679 + | #[allow(missing_docs)] // documentation missing in model
|
1680 + | pub default_string: ::std::string::String,
|
1681 + | #[pyo3(get, set)]
|
1682 + | /// :type bool:
|
1683 + | #[allow(missing_docs)] // documentation missing in model
|
1684 + | pub default_boolean: bool,
|
1685 + | #[pyo3(get, set)]
|
1686 + | /// :type typing.List\[str\]:
|
1687 + | #[allow(missing_docs)] // documentation missing in model
|
1688 + | pub default_list: ::std::vec::Vec<::std::string::String>,
|
1689 + | #[pyo3(get, set)]
|
1690 + | /// :type rest_json.types.Document:
|
1691 + | #[allow(missing_docs)] // documentation missing in model
|
1692 + | pub default_document_map: ::aws_smithy_http_server_python::types::Document,
|
1693 + | #[pyo3(get, set)]
|
1694 + | /// :type rest_json.types.Document:
|
1695 + | #[allow(missing_docs)] // documentation missing in model
|
1696 + | pub default_document_string: ::aws_smithy_http_server_python::types::Document,
|
1697 + | #[pyo3(get, set)]
|
1698 + | /// :type rest_json.types.Document:
|
1699 + | #[allow(missing_docs)] // documentation missing in model
|
1700 + | pub default_document_boolean: ::aws_smithy_http_server_python::types::Document,
|
1701 + | #[pyo3(get, set)]
|
1702 + | /// :type rest_json.types.Document:
|
1703 + | #[allow(missing_docs)] // documentation missing in model
|
1704 + | pub default_document_list: ::aws_smithy_http_server_python::types::Document,
|
1705 + | #[pyo3(get, set)]
|
1706 + | /// :type typing.Optional\[rest_json.types.Document\]:
|
1707 + | #[allow(missing_docs)] // documentation missing in model
|
1708 + | pub default_null_document:
|
1709 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
1710 + | #[pyo3(get, set)]
|
1711 + | /// :type rest_json.types.DateTime:
|
1712 + | #[allow(missing_docs)] // documentation missing in model
|
1713 + | pub default_timestamp: ::aws_smithy_http_server_python::types::DateTime,
|
1714 + | #[pyo3(get, set)]
|
1715 + | /// :type rest_json.types.Blob:
|
1716 + | #[allow(missing_docs)] // documentation missing in model
|
1717 + | pub default_blob: ::aws_smithy_http_server_python::types::Blob,
|
1718 + | #[pyo3(get, set)]
|
1719 + | /// :type int:
|
1720 + | #[allow(missing_docs)] // documentation missing in model
|
1721 + | pub default_byte: i8,
|
1722 + | #[pyo3(get, set)]
|
1723 + | /// :type int:
|
1724 + | #[allow(missing_docs)] // documentation missing in model
|
1725 + | pub default_short: i16,
|
1726 + | #[pyo3(get, set)]
|
1727 + | /// :type int:
|
1728 + | #[allow(missing_docs)] // documentation missing in model
|
1729 + | pub default_integer: i32,
|
1730 + | #[pyo3(get, set)]
|
1731 + | /// :type int:
|
1732 + | #[allow(missing_docs)] // documentation missing in model
|
1733 + | pub default_long: i64,
|
1734 + | #[pyo3(get, set)]
|
1735 + | /// :type float:
|
1736 + | #[allow(missing_docs)] // documentation missing in model
|
1737 + | pub default_float: f32,
|
1738 + | #[pyo3(get, set)]
|
1739 + | /// :type float:
|
1740 + | #[allow(missing_docs)] // documentation missing in model
|
1741 + | pub default_double: f64,
|
1742 + | #[pyo3(get, set)]
|
1743 + | /// :type typing.Dict\[str, str\]:
|
1744 + | #[allow(missing_docs)] // documentation missing in model
|
1745 + | pub default_map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1746 + | #[pyo3(get, set)]
|
1747 + | /// :type rest_json.model.TestEnum:
|
1748 + | #[allow(missing_docs)] // documentation missing in model
|
1749 + | pub default_enum: crate::model::TestEnum,
|
1750 + | #[pyo3(get, set)]
|
1751 + | /// :type int:
|
1752 + | #[allow(missing_docs)] // documentation missing in model
|
1753 + | pub default_int_enum: i32,
|
1754 + | #[pyo3(get, set)]
|
1755 + | /// :type str:
|
1756 + | #[allow(missing_docs)] // documentation missing in model
|
1757 + | pub empty_string: ::std::string::String,
|
1758 + | #[pyo3(get, set)]
|
1759 + | /// :type bool:
|
1760 + | #[allow(missing_docs)] // documentation missing in model
|
1761 + | pub false_boolean: bool,
|
1762 + | #[pyo3(get, set)]
|
1763 + | /// :type rest_json.types.Blob:
|
1764 + | #[allow(missing_docs)] // documentation missing in model
|
1765 + | pub empty_blob: ::aws_smithy_http_server_python::types::Blob,
|
1766 + | #[pyo3(get, set)]
|
1767 + | /// :type int:
|
1768 + | #[allow(missing_docs)] // documentation missing in model
|
1769 + | pub zero_byte: i8,
|
1770 + | #[pyo3(get, set)]
|
1771 + | /// :type int:
|
1772 + | #[allow(missing_docs)] // documentation missing in model
|
1773 + | pub zero_short: i16,
|
1774 + | #[pyo3(get, set)]
|
1775 + | /// :type int:
|
1776 + | #[allow(missing_docs)] // documentation missing in model
|
1777 + | pub zero_integer: i32,
|
1778 + | #[pyo3(get, set)]
|
1779 + | /// :type int:
|
1780 + | #[allow(missing_docs)] // documentation missing in model
|
1781 + | pub zero_long: i64,
|
1782 + | #[pyo3(get, set)]
|
1783 + | /// :type float:
|
1784 + | #[allow(missing_docs)] // documentation missing in model
|
1785 + | pub zero_float: f32,
|
1786 + | #[pyo3(get, set)]
|
1787 + | /// :type float:
|
1788 + | #[allow(missing_docs)] // documentation missing in model
|
1789 + | pub zero_double: f64,
|
1790 + | }
|
1791 + | impl Defaults {
|
1792 + | #[allow(missing_docs)] // documentation missing in model
|
1793 + | pub fn default_string(&self) -> &str {
|
1794 + | use std::ops::Deref;
|
1795 + | self.default_string.deref()
|
1796 + | }
|
1797 + | #[allow(missing_docs)] // documentation missing in model
|
1798 + | pub fn default_boolean(&self) -> bool {
|
1799 + | self.default_boolean
|
1800 + | }
|
1801 + | #[allow(missing_docs)] // documentation missing in model
|
1802 + | pub fn default_list(&self) -> &[::std::string::String] {
|
1803 + | use std::ops::Deref;
|
1804 + | self.default_list.deref()
|
1805 + | }
|
1806 + | #[allow(missing_docs)] // documentation missing in model
|
1807 + | pub fn default_document_map(&self) -> &::aws_smithy_http_server_python::types::Document {
|
1808 + | &self.default_document_map
|
1809 + | }
|
1810 + | #[allow(missing_docs)] // documentation missing in model
|
1811 + | pub fn default_document_string(&self) -> &::aws_smithy_http_server_python::types::Document {
|
1812 + | &self.default_document_string
|
1813 + | }
|
1814 + | #[allow(missing_docs)] // documentation missing in model
|
1815 + | pub fn default_document_boolean(&self) -> &::aws_smithy_http_server_python::types::Document {
|
1816 + | &self.default_document_boolean
|
1817 + | }
|
1818 + | #[allow(missing_docs)] // documentation missing in model
|
1819 + | pub fn default_document_list(&self) -> &::aws_smithy_http_server_python::types::Document {
|
1820 + | &self.default_document_list
|
1821 + | }
|
1822 + | #[allow(missing_docs)] // documentation missing in model
|
1823 + | pub fn default_null_document(
|
1824 + | &self,
|
1825 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Document> {
|
1826 + | self.default_null_document.as_ref()
|
1827 + | }
|
1828 + | #[allow(missing_docs)] // documentation missing in model
|
1829 + | pub fn default_timestamp(&self) -> &::aws_smithy_http_server_python::types::DateTime {
|
1830 + | &self.default_timestamp
|
1831 + | }
|
1832 + | #[allow(missing_docs)] // documentation missing in model
|
1833 + | pub fn default_blob(&self) -> &::aws_smithy_http_server_python::types::Blob {
|
1834 + | &self.default_blob
|
1835 + | }
|
1836 + | #[allow(missing_docs)] // documentation missing in model
|
1837 + | pub fn default_byte(&self) -> i8 {
|
1838 + | self.default_byte
|
1839 + | }
|
1840 + | #[allow(missing_docs)] // documentation missing in model
|
1841 + | pub fn default_short(&self) -> i16 {
|
1842 + | self.default_short
|
1843 + | }
|
1844 + | #[allow(missing_docs)] // documentation missing in model
|
1845 + | pub fn default_integer(&self) -> i32 {
|
1846 + | self.default_integer
|
1847 + | }
|
1848 + | #[allow(missing_docs)] // documentation missing in model
|
1849 + | pub fn default_long(&self) -> i64 {
|
1850 + | self.default_long
|
1851 + | }
|
1852 + | #[allow(missing_docs)] // documentation missing in model
|
1853 + | pub fn default_float(&self) -> f32 {
|
1854 + | self.default_float
|
1855 + | }
|
1856 + | #[allow(missing_docs)] // documentation missing in model
|
1857 + | pub fn default_double(&self) -> f64 {
|
1858 + | self.default_double
|
1859 + | }
|
1860 + | #[allow(missing_docs)] // documentation missing in model
|
1861 + | pub fn default_map(
|
1862 + | &self,
|
1863 + | ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
|
1864 + | &self.default_map
|
1865 + | }
|
1866 + | #[allow(missing_docs)] // documentation missing in model
|
1867 + | pub fn default_enum(&self) -> &crate::model::TestEnum {
|
694 1868 | &self.default_enum
|
695 1869 | }
|
696 1870 | #[allow(missing_docs)] // documentation missing in model
|
697 1871 | pub fn default_int_enum(&self) -> i32 {
|
698 1872 | self.default_int_enum
|
699 1873 | }
|
700 1874 | #[allow(missing_docs)] // documentation missing in model
|
701 1875 | pub fn empty_string(&self) -> &str {
|
702 1876 | use std::ops::Deref;
|
703 1877 | self.empty_string.deref()
|
817 1991 | }
|
818 1992 |
|
819 1993 | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Defaults> {
|
820 1994 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
821 1995 | (*self).into_py(py)
|
822 1996 | }
|
823 1997 | }
|
824 1998 | impl crate::constrained::Constrained for crate::model::Defaults {
|
825 1999 | type Unconstrained = crate::model::defaults_internal::Builder;
|
826 2000 | }
|
827 - | impl Defaults {
|
828 - | /// Creates a new builder-style object to manufacture [`Defaults`](crate::model::Defaults).
|
829 - | pub fn builder() -> crate::model::defaults::Builder {
|
830 - | crate::model::defaults::Builder::default()
|
2001 + | impl Defaults {
|
2002 + | /// Creates a new builder-style object to manufacture [`Defaults`](crate::model::Defaults).
|
2003 + | pub fn builder() -> crate::model::defaults::Builder {
|
2004 + | crate::model::defaults::Builder::default()
|
2005 + | }
|
2006 + | }
|
2007 + |
|
2008 + | #[::pyo3::pyclass]
|
2009 + | /// :param member int:
|
2010 + | /// :rtype None:
|
2011 + | #[allow(missing_docs)] // documentation missing in model
|
2012 + | #[derive(
|
2013 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2014 + | )]
|
2015 + | pub struct ClientOptionalDefaults {
|
2016 + | #[pyo3(get, set)]
|
2017 + | /// :type int:
|
2018 + | #[allow(missing_docs)] // documentation missing in model
|
2019 + | pub member: i32,
|
2020 + | }
|
2021 + | impl ClientOptionalDefaults {
|
2022 + | #[allow(missing_docs)] // documentation missing in model
|
2023 + | pub fn member(&self) -> i32 {
|
2024 + | self.member
|
2025 + | }
|
2026 + | }
|
2027 + | #[allow(clippy::new_without_default)]
|
2028 + | #[allow(clippy::too_many_arguments)]
|
2029 + | #[::pyo3::pymethods]
|
2030 + | impl ClientOptionalDefaults {
|
2031 + | #[new]
|
2032 + | pub fn new(member: i32) -> Self {
|
2033 + | Self { member }
|
2034 + | }
|
2035 + | fn __repr__(&self) -> String {
|
2036 + | format!("{self:?}")
|
2037 + | }
|
2038 + | fn __str__(&self) -> String {
|
2039 + | format!("{self:?}")
|
2040 + | }
|
2041 + | }
|
2042 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ClientOptionalDefaults> {
|
2043 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2044 + | ob.extract::<ClientOptionalDefaults>().map(Box::new)
|
2045 + | }
|
2046 + | }
|
2047 + |
|
2048 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ClientOptionalDefaults> {
|
2049 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2050 + | (*self).into_py(py)
|
2051 + | }
|
2052 + | }
|
2053 + | impl crate::constrained::Constrained for crate::model::ClientOptionalDefaults {
|
2054 + | type Unconstrained = crate::model::client_optional_defaults_internal::Builder;
|
2055 + | }
|
2056 + | impl ClientOptionalDefaults {
|
2057 + | /// Creates a new builder-style object to manufacture [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
2058 + | pub fn builder() -> crate::model::client_optional_defaults::Builder {
|
2059 + | crate::model::client_optional_defaults::Builder::default()
|
2060 + | }
|
2061 + | }
|
2062 + |
|
2063 + | #[::pyo3::pyclass]
|
2064 + | #[allow(missing_docs)] // documentation missing in model
|
2065 + | #[derive(
|
2066 + | ::std::clone::Clone,
|
2067 + | ::std::cmp::Eq,
|
2068 + | ::std::cmp::Ord,
|
2069 + | ::std::cmp::PartialEq,
|
2070 + | ::std::cmp::PartialOrd,
|
2071 + | ::std::fmt::Debug,
|
2072 + | ::std::hash::Hash,
|
2073 + | )]
|
2074 + | pub enum TestEnum {
|
2075 + | #[allow(missing_docs)] // documentation missing in model
|
2076 + | Bar,
|
2077 + | #[allow(missing_docs)] // documentation missing in model
|
2078 + | Baz,
|
2079 + | #[allow(missing_docs)] // documentation missing in model
|
2080 + | Foo,
|
2081 + | }
|
2082 + | pub(crate) mod test_enum_internal {
|
2083 + | #[derive(Debug, PartialEq)]
|
2084 + | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
2085 + |
|
2086 + | impl ::std::fmt::Display for ConstraintViolation {
|
2087 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2088 + | write!(
|
2089 + | f,
|
2090 + | r#"Value provided for 'aws.protocoltests.restjson#TestEnum' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#
|
2091 + | )
|
2092 + | }
|
2093 + | }
|
2094 + |
|
2095 + | impl ::std::error::Error for ConstraintViolation {}
|
2096 + | impl ConstraintViolation {
|
2097 + | pub(crate) fn as_validation_exception_field(
|
2098 + | self,
|
2099 + | path: ::std::string::String,
|
2100 + | ) -> crate::model::ValidationExceptionField {
|
2101 + | crate::model::ValidationExceptionField {
|
2102 + | message: format!(
|
2103 + | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [FOO, BAR, BAZ]"#,
|
2104 + | &path
|
2105 + | ),
|
2106 + | path,
|
2107 + | }
|
2108 + | }
|
2109 + | }
|
2110 + | }
|
2111 + | impl ::std::convert::TryFrom<&str> for TestEnum {
|
2112 + | type Error = crate::model::test_enum_internal::ConstraintViolation;
|
2113 + | fn try_from(
|
2114 + | s: &str,
|
2115 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
2116 + | match s {
|
2117 + | "BAR" => Ok(TestEnum::Bar),
|
2118 + | "BAZ" => Ok(TestEnum::Baz),
|
2119 + | "FOO" => Ok(TestEnum::Foo),
|
2120 + | _ => Err(crate::model::test_enum_internal::ConstraintViolation(
|
2121 + | s.to_owned(),
|
2122 + | )),
|
2123 + | }
|
2124 + | }
|
2125 + | }
|
2126 + | impl ::std::convert::TryFrom<::std::string::String> for TestEnum {
|
2127 + | type Error = crate::model::test_enum_internal::ConstraintViolation;
|
2128 + | fn try_from(
|
2129 + | s: ::std::string::String,
|
2130 + | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
2131 + | {
|
2132 + | s.as_str().try_into()
|
2133 + | }
|
2134 + | }
|
2135 + | impl std::str::FromStr for TestEnum {
|
2136 + | type Err = crate::model::test_enum_internal::ConstraintViolation;
|
2137 + | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
2138 + | Self::try_from(s)
|
2139 + | }
|
2140 + | }
|
2141 + | impl TestEnum {
|
2142 + | /// Returns the `&str` value of the enum member.
|
2143 + | pub fn as_str(&self) -> &str {
|
2144 + | match self {
|
2145 + | TestEnum::Bar => "BAR",
|
2146 + | TestEnum::Baz => "BAZ",
|
2147 + | TestEnum::Foo => "FOO",
|
2148 + | }
|
2149 + | }
|
2150 + | /// Returns all the `&str` representations of the enum members.
|
2151 + | pub const fn values() -> &'static [&'static str] {
|
2152 + | &["BAR", "BAZ", "FOO"]
|
2153 + | }
|
2154 + | }
|
2155 + | impl ::std::convert::AsRef<str> for TestEnum {
|
2156 + | fn as_ref(&self) -> &str {
|
2157 + | self.as_str()
|
2158 + | }
|
2159 + | }
|
2160 + | #[::pyo3::pymethods]
|
2161 + | impl TestEnum {
|
2162 + | #[getter]
|
2163 + | pub fn name(&self) -> &str {
|
2164 + | match self {
|
2165 + | TestEnum::Bar => "Bar",
|
2166 + | TestEnum::Baz => "Baz",
|
2167 + | TestEnum::Foo => "Foo",
|
2168 + | }
|
2169 + | }
|
2170 + | #[getter]
|
2171 + | pub fn value(&self) -> &str {
|
2172 + | self.as_str()
|
2173 + | }
|
2174 + | fn __repr__(&self) -> String {
|
2175 + | self.as_str().to_owned()
|
2176 + | }
|
2177 + | fn __str__(&self) -> String {
|
2178 + | self.as_str().to_owned()
|
2179 + | }
|
2180 + | }
|
2181 + | impl crate::constrained::Constrained for TestEnum {
|
2182 + | type Unconstrained = ::std::string::String;
|
2183 + | }
|
2184 + |
|
2185 + | impl ::std::convert::From<::std::string::String>
|
2186 + | for crate::constrained::MaybeConstrained<crate::model::TestEnum>
|
2187 + | {
|
2188 + | fn from(value: ::std::string::String) -> Self {
|
2189 + | Self::Unconstrained(value)
|
831 2190 | }
|
832 2191 | }
|
833 2192 |
|
834 2193 | #[::pyo3::pyclass]
|
835 - | /// :param data typing.Optional\[int\]:
|
2194 + | /// :param dialog rest_json.model.Dialog:
|
2195 + | /// :param dialog_list typing.List\[rest_json.model.Dialog\]:
|
2196 + | /// :param dialog_map typing.Dict\[str, rest_json.model.Dialog\]:
|
836 2197 | /// :rtype None:
|
837 2198 | #[allow(missing_docs)] // documentation missing in model
|
838 - | #[derive(
|
839 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
840 - | )]
|
841 - | pub struct PayloadConfig {
|
2199 + | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2200 + | pub struct TopLevel {
|
842 2201 | #[pyo3(get, set)]
|
843 - | /// :type typing.Optional\[int\]:
|
2202 + | /// :type rest_json.model.Dialog:
|
844 2203 | #[allow(missing_docs)] // documentation missing in model
|
845 - | pub data: ::std::option::Option<i32>,
|
2204 + | pub dialog: crate::model::Dialog,
|
2205 + | #[pyo3(get, set)]
|
2206 + | /// :type typing.List\[rest_json.model.Dialog\]:
|
2207 + | #[allow(missing_docs)] // documentation missing in model
|
2208 + | pub dialog_list: ::std::vec::Vec<crate::model::Dialog>,
|
2209 + | #[pyo3(get, set)]
|
2210 + | /// :type typing.Dict\[str, rest_json.model.Dialog\]:
|
2211 + | #[allow(missing_docs)] // documentation missing in model
|
2212 + | pub dialog_map: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
846 2213 | }
|
847 - | impl PayloadConfig {
|
2214 + | impl TopLevel {
|
848 2215 | #[allow(missing_docs)] // documentation missing in model
|
849 - | pub fn data(&self) -> ::std::option::Option<i32> {
|
850 - | self.data
|
2216 + | pub fn dialog(&self) -> &crate::model::Dialog {
|
2217 + | &self.dialog
|
2218 + | }
|
2219 + | #[allow(missing_docs)] // documentation missing in model
|
2220 + | pub fn dialog_list(&self) -> &[crate::model::Dialog] {
|
2221 + | use std::ops::Deref;
|
2222 + | self.dialog_list.deref()
|
2223 + | }
|
2224 + | #[allow(missing_docs)] // documentation missing in model
|
2225 + | pub fn dialog_map(
|
2226 + | &self,
|
2227 + | ) -> &::std::collections::HashMap<::std::string::String, crate::model::Dialog> {
|
2228 + | &self.dialog_map
|
851 2229 | }
|
852 2230 | }
|
853 2231 | #[allow(clippy::new_without_default)]
|
854 2232 | #[allow(clippy::too_many_arguments)]
|
855 2233 | #[::pyo3::pymethods]
|
856 - | impl PayloadConfig {
|
2234 + | impl TopLevel {
|
857 2235 | #[new]
|
858 - | pub fn new(data: ::std::option::Option<i32>) -> Self {
|
859 - | Self { data }
|
2236 + | pub fn new(
|
2237 + | dialog: crate::model::Dialog,
|
2238 + | dialog_list: ::std::vec::Vec<crate::model::Dialog>,
|
2239 + | dialog_map: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
2240 + | ) -> Self {
|
2241 + | Self {
|
2242 + | dialog,
|
2243 + | dialog_list,
|
2244 + | dialog_map,
|
2245 + | }
|
860 2246 | }
|
861 2247 | fn __repr__(&self) -> String {
|
862 2248 | format!("{self:?}")
|
863 2249 | }
|
864 2250 | fn __str__(&self) -> String {
|
865 2251 | format!("{self:?}")
|
866 2252 | }
|
867 2253 | }
|
868 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<PayloadConfig> {
|
2254 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<TopLevel> {
|
869 2255 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
870 - | ob.extract::<PayloadConfig>().map(Box::new)
|
2256 + | ob.extract::<TopLevel>().map(Box::new)
|
871 2257 | }
|
872 2258 | }
|
873 2259 |
|
874 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<PayloadConfig> {
|
2260 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<TopLevel> {
|
875 2261 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
876 2262 | (*self).into_py(py)
|
877 2263 | }
|
878 2264 | }
|
879 - | impl crate::constrained::Constrained for crate::model::PayloadConfig {
|
880 - | type Unconstrained = crate::model::payload_config_internal::Builder;
|
2265 + | impl crate::constrained::Constrained for crate::model::TopLevel {
|
2266 + | type Unconstrained = crate::model::top_level_internal::Builder;
|
881 2267 | }
|
882 - | impl PayloadConfig {
|
883 - | /// Creates a new builder-style object to manufacture [`PayloadConfig`](crate::model::PayloadConfig).
|
884 - | pub fn builder() -> crate::model::payload_config::Builder {
|
885 - | crate::model::payload_config::Builder::default()
|
2268 + | impl TopLevel {
|
2269 + | /// Creates a new builder-style object to manufacture [`TopLevel`](crate::model::TopLevel).
|
2270 + | pub fn builder() -> crate::model::top_level::Builder {
|
2271 + | crate::model::top_level::Builder::default()
|
886 2272 | }
|
887 2273 | }
|
888 2274 |
|
889 2275 | #[::pyo3::pyclass]
|
890 - | /// :param timeout typing.Optional\[int\]:
|
2276 + | /// :param greeting str:
|
2277 + | /// :param language typing.Optional\[str\]:
|
2278 + | /// :param farewell typing.Optional\[rest_json.model.Farewell\]:
|
891 2279 | /// :rtype None:
|
892 2280 | #[allow(missing_docs)] // documentation missing in model
|
893 2281 | #[derive(
|
894 2282 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
895 2283 | )]
|
896 - | pub struct TestConfig {
|
2284 + | pub struct Dialog {
|
897 2285 | #[pyo3(get, set)]
|
898 - | /// :type typing.Optional\[int\]:
|
2286 + | /// :type typing.Optional\[str\]:
|
899 2287 | #[allow(missing_docs)] // documentation missing in model
|
900 - | pub timeout: ::std::option::Option<i32>,
|
2288 + | pub language: ::std::option::Option<::std::string::String>,
|
2289 + | #[pyo3(get, set)]
|
2290 + | /// :type str:
|
2291 + | #[allow(missing_docs)] // documentation missing in model
|
2292 + | pub greeting: ::std::string::String,
|
2293 + | #[pyo3(get, set)]
|
2294 + | /// :type typing.Optional\[rest_json.model.Farewell\]:
|
2295 + | #[allow(missing_docs)] // documentation missing in model
|
2296 + | pub farewell: ::std::option::Option<crate::model::Farewell>,
|
901 2297 | }
|
902 - | impl TestConfig {
|
2298 + | impl Dialog {
|
903 2299 | #[allow(missing_docs)] // documentation missing in model
|
904 - | pub fn timeout(&self) -> ::std::option::Option<i32> {
|
905 - | self.timeout
|
2300 + | pub fn language(&self) -> ::std::option::Option<&str> {
|
2301 + | self.language.as_deref()
|
2302 + | }
|
2303 + | #[allow(missing_docs)] // documentation missing in model
|
2304 + | pub fn greeting(&self) -> &str {
|
2305 + | use std::ops::Deref;
|
2306 + | self.greeting.deref()
|
2307 + | }
|
2308 + | #[allow(missing_docs)] // documentation missing in model
|
2309 + | pub fn farewell(&self) -> ::std::option::Option<&crate::model::Farewell> {
|
2310 + | self.farewell.as_ref()
|
906 2311 | }
|
907 2312 | }
|
908 2313 | #[allow(clippy::new_without_default)]
|
909 2314 | #[allow(clippy::too_many_arguments)]
|
910 2315 | #[::pyo3::pymethods]
|
911 - | impl TestConfig {
|
2316 + | impl Dialog {
|
912 2317 | #[new]
|
913 - | pub fn new(timeout: ::std::option::Option<i32>) -> Self {
|
914 - | Self { timeout }
|
2318 + | pub fn new(
|
2319 + | greeting: ::std::string::String,
|
2320 + | language: ::std::option::Option<::std::string::String>,
|
2321 + | farewell: ::std::option::Option<crate::model::Farewell>,
|
2322 + | ) -> Self {
|
2323 + | Self {
|
2324 + | greeting,
|
2325 + | language,
|
2326 + | farewell,
|
2327 + | }
|
915 2328 | }
|
916 2329 | fn __repr__(&self) -> String {
|
917 2330 | format!("{self:?}")
|
918 2331 | }
|
919 2332 | fn __str__(&self) -> String {
|
920 2333 | format!("{self:?}")
|
921 2334 | }
|
922 2335 | }
|
923 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<TestConfig> {
|
2336 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Dialog> {
|
924 2337 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
925 - | ob.extract::<TestConfig>().map(Box::new)
|
2338 + | ob.extract::<Dialog>().map(Box::new)
|
926 2339 | }
|
927 2340 | }
|
928 2341 |
|
929 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<TestConfig> {
|
2342 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Dialog> {
|
930 2343 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
931 2344 | (*self).into_py(py)
|
932 2345 | }
|
933 2346 | }
|
934 - | impl crate::constrained::Constrained for crate::model::TestConfig {
|
935 - | type Unconstrained = crate::model::test_config_internal::Builder;
|
2347 + | impl crate::constrained::Constrained for crate::model::Dialog {
|
2348 + | type Unconstrained = crate::model::dialog_internal::Builder;
|
936 2349 | }
|
937 - | impl TestConfig {
|
938 - | /// Creates a new builder-style object to manufacture [`TestConfig`](crate::model::TestConfig).
|
939 - | pub fn builder() -> crate::model::test_config::Builder {
|
940 - | crate::model::test_config::Builder::default()
|
2350 + | impl Dialog {
|
2351 + | /// Creates a new builder-style object to manufacture [`Dialog`](crate::model::Dialog).
|
2352 + | pub fn builder() -> crate::model::dialog::Builder {
|
2353 + | crate::model::dialog::Builder::default()
|
941 2354 | }
|
942 2355 | }
|
943 2356 |
|
944 2357 | #[allow(missing_docs)] // documentation missing in model
|
945 - | #[derive(
|
946 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
947 - | )]
|
948 - | pub enum SimpleUnion {
|
2358 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2359 + | pub enum EventStream {
|
949 2360 | #[allow(missing_docs)] // documentation missing in model
|
950 - | Int(i32),
|
2361 + | BlobPayload(crate::model::BlobPayloadEvent),
|
951 2362 | #[allow(missing_docs)] // documentation missing in model
|
952 - | String(::std::string::String),
|
2363 + | Headers(crate::model::HeadersEvent),
|
2364 + | #[allow(missing_docs)] // documentation missing in model
|
2365 + | HeadersAndExplicitPayload(crate::model::HeadersAndExplicitPayloadEvent),
|
2366 + | #[allow(missing_docs)] // documentation missing in model
|
2367 + | HeadersAndImplicitPayload(crate::model::HeadersAndImplicitPayloadEvent),
|
2368 + | #[allow(missing_docs)] // documentation missing in model
|
2369 + | StringPayload(crate::model::StringPayloadEvent),
|
2370 + | #[allow(missing_docs)] // documentation missing in model
|
2371 + | StructurePayload(crate::model::StructurePayloadEvent),
|
2372 + | #[allow(missing_docs)] // documentation missing in model
|
2373 + | UnionPayload(crate::model::UnionPayloadEvent),
|
953 2374 | }
|
954 - | impl SimpleUnion {
|
955 - | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
2375 + | impl EventStream {
|
2376 + | /// Tries to convert the enum instance into [`BlobPayload`](crate::model::EventStream::BlobPayload), extracting the inner [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
956 2377 | /// Returns `Err(&Self)` if it can't be converted.
|
957 - | pub fn as_int(&self) -> ::std::result::Result<&i32, &Self> {
|
958 - | if let SimpleUnion::Int(val) = &self {
|
2378 + | pub fn as_blob_payload(&self) -> ::std::result::Result<&crate::model::BlobPayloadEvent, &Self> {
|
2379 + | if let EventStream::BlobPayload(val) = &self {
|
959 2380 | ::std::result::Result::Ok(val)
|
960 2381 | } else {
|
961 2382 | ::std::result::Result::Err(self)
|
962 2383 | }
|
963 2384 | }
|
964 - | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
965 - | pub fn is_int(&self) -> bool {
|
966 - | self.as_int().is_ok()
|
2385 + | /// Returns true if this is a [`BlobPayload`](crate::model::EventStream::BlobPayload).
|
2386 + | pub fn is_blob_payload(&self) -> bool {
|
2387 + | self.as_blob_payload().is_ok()
|
967 2388 | }
|
968 - | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
2389 + | /// Tries to convert the enum instance into [`Headers`](crate::model::EventStream::Headers), extracting the inner [`HeadersEvent`](crate::model::HeadersEvent).
|
969 2390 | /// Returns `Err(&Self)` if it can't be converted.
|
970 - | pub fn as_string(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
971 - | if let SimpleUnion::String(val) = &self {
|
2391 + | pub fn as_headers(&self) -> ::std::result::Result<&crate::model::HeadersEvent, &Self> {
|
2392 + | if let EventStream::Headers(val) = &self {
|
972 2393 | ::std::result::Result::Ok(val)
|
973 2394 | } else {
|
974 2395 | ::std::result::Result::Err(self)
|
975 2396 | }
|
976 2397 | }
|
977 - | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
978 - | pub fn is_string(&self) -> bool {
|
979 - | self.as_string().is_ok()
|
2398 + | /// Returns true if this is a [`Headers`](crate::model::EventStream::Headers).
|
2399 + | pub fn is_headers(&self) -> bool {
|
2400 + | self.as_headers().is_ok()
|
2401 + | }
|
2402 + | /// Tries to convert the enum instance into [`HeadersAndExplicitPayload`](crate::model::EventStream::HeadersAndExplicitPayload), extracting the inner [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
2403 + | /// Returns `Err(&Self)` if it can't be converted.
|
2404 + | pub fn as_headers_and_explicit_payload(
|
2405 + | &self,
|
2406 + | ) -> ::std::result::Result<&crate::model::HeadersAndExplicitPayloadEvent, &Self> {
|
2407 + | if let EventStream::HeadersAndExplicitPayload(val) = &self {
|
2408 + | ::std::result::Result::Ok(val)
|
2409 + | } else {
|
2410 + | ::std::result::Result::Err(self)
|
2411 + | }
|
2412 + | }
|
2413 + | /// Returns true if this is a [`HeadersAndExplicitPayload`](crate::model::EventStream::HeadersAndExplicitPayload).
|
2414 + | pub fn is_headers_and_explicit_payload(&self) -> bool {
|
2415 + | self.as_headers_and_explicit_payload().is_ok()
|
2416 + | }
|
2417 + | /// Tries to convert the enum instance into [`HeadersAndImplicitPayload`](crate::model::EventStream::HeadersAndImplicitPayload), extracting the inner [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
2418 + | /// Returns `Err(&Self)` if it can't be converted.
|
2419 + | pub fn as_headers_and_implicit_payload(
|
2420 + | &self,
|
2421 + | ) -> ::std::result::Result<&crate::model::HeadersAndImplicitPayloadEvent, &Self> {
|
2422 + | if let EventStream::HeadersAndImplicitPayload(val) = &self {
|
2423 + | ::std::result::Result::Ok(val)
|
2424 + | } else {
|
2425 + | ::std::result::Result::Err(self)
|
2426 + | }
|
2427 + | }
|
2428 + | /// Returns true if this is a [`HeadersAndImplicitPayload`](crate::model::EventStream::HeadersAndImplicitPayload).
|
2429 + | pub fn is_headers_and_implicit_payload(&self) -> bool {
|
2430 + | self.as_headers_and_implicit_payload().is_ok()
|
2431 + | }
|
2432 + | /// Tries to convert the enum instance into [`StringPayload`](crate::model::EventStream::StringPayload), extracting the inner [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
2433 + | /// Returns `Err(&Self)` if it can't be converted.
|
2434 + | pub fn as_string_payload(
|
2435 + | &self,
|
2436 + | ) -> ::std::result::Result<&crate::model::StringPayloadEvent, &Self> {
|
2437 + | if let EventStream::StringPayload(val) = &self {
|
2438 + | ::std::result::Result::Ok(val)
|
2439 + | } else {
|
2440 + | ::std::result::Result::Err(self)
|
2441 + | }
|
2442 + | }
|
2443 + | /// Returns true if this is a [`StringPayload`](crate::model::EventStream::StringPayload).
|
2444 + | pub fn is_string_payload(&self) -> bool {
|
2445 + | self.as_string_payload().is_ok()
|
2446 + | }
|
2447 + | /// Tries to convert the enum instance into [`StructurePayload`](crate::model::EventStream::StructurePayload), extracting the inner [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
2448 + | /// Returns `Err(&Self)` if it can't be converted.
|
2449 + | pub fn as_structure_payload(
|
2450 + | &self,
|
2451 + | ) -> ::std::result::Result<&crate::model::StructurePayloadEvent, &Self> {
|
2452 + | if let EventStream::StructurePayload(val) = &self {
|
2453 + | ::std::result::Result::Ok(val)
|
2454 + | } else {
|
2455 + | ::std::result::Result::Err(self)
|
2456 + | }
|
2457 + | }
|
2458 + | /// Returns true if this is a [`StructurePayload`](crate::model::EventStream::StructurePayload).
|
2459 + | pub fn is_structure_payload(&self) -> bool {
|
2460 + | self.as_structure_payload().is_ok()
|
2461 + | }
|
2462 + | /// Tries to convert the enum instance into [`UnionPayload`](crate::model::EventStream::UnionPayload), extracting the inner [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
2463 + | /// Returns `Err(&Self)` if it can't be converted.
|
2464 + | pub fn as_union_payload(
|
2465 + | &self,
|
2466 + | ) -> ::std::result::Result<&crate::model::UnionPayloadEvent, &Self> {
|
2467 + | if let EventStream::UnionPayload(val) = &self {
|
2468 + | ::std::result::Result::Ok(val)
|
2469 + | } else {
|
2470 + | ::std::result::Result::Err(self)
|
2471 + | }
|
2472 + | }
|
2473 + | /// Returns true if this is a [`UnionPayload`](crate::model::EventStream::UnionPayload).
|
2474 + | pub fn is_union_payload(&self) -> bool {
|
2475 + | self.as_union_payload().is_ok()
|
980 2476 | }
|
981 2477 | }
|
982 - | #[pyo3::pyclass(name = "SimpleUnion")]
|
983 - | #[derive(
|
984 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
985 - | )]
|
986 - | pub struct PyUnionMarkerSimpleUnion(pub SimpleUnion);
|
2478 + | #[pyo3::pyclass(name = "EventStream")]
|
2479 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2480 + | pub struct PyUnionMarkerEventStream(pub EventStream);
|
987 2481 | #[::pyo3::pymethods]
|
988 - | impl PyUnionMarkerSimpleUnion {
|
2482 + | impl PyUnionMarkerEventStream {
|
989 2483 | #[staticmethod]
|
990 - | /// Creates a new union instance of [`Int`](crate::model::SimpleUnion::Int)
|
991 - | /// :param data int:
|
992 - | /// :rtype SimpleUnion:
|
993 - | pub fn int(data: i32) -> Self {
|
994 - | Self(SimpleUnion::Int(data))
|
2484 + | /// Creates a new union instance of [`BlobPayload`](crate::model::EventStream::BlobPayload)
|
2485 + | /// :param data rest_json.model.BlobPayloadEvent:
|
2486 + | /// :rtype EventStream:
|
2487 + | pub fn blob_payload(data: crate::model::BlobPayloadEvent) -> Self {
|
2488 + | Self(EventStream::BlobPayload(data))
|
2489 + | }
|
2490 + | /// Tries to convert the enum instance into [`BlobPayload`](crate::model::EventStream::BlobPayload), extracting the inner [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
2491 + | /// :rtype rest_json.model.BlobPayloadEvent:
|
2492 + | pub fn as_blob_payload(&self) -> ::pyo3::PyResult<crate::model::BlobPayloadEvent> {
|
2493 + | match self.0.as_blob_payload() {
|
2494 + | Ok(variant) => Ok(variant.clone()),
|
2495 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2496 + | r"EventStream variant is not of type rest_json.model.BlobPayloadEvent",
|
2497 + | )),
|
2498 + | }
|
2499 + | }
|
2500 + | /// Returns true if this is a [`BlobPayload`](crate::model::EventStream::BlobPayload).
|
2501 + | /// :rtype bool:
|
2502 + | pub fn is_blob_payload(&self) -> bool {
|
2503 + | self.0.is_blob_payload()
|
2504 + | }
|
2505 + | #[staticmethod]
|
2506 + | /// Creates a new union instance of [`Headers`](crate::model::EventStream::Headers)
|
2507 + | /// :param data rest_json.model.HeadersEvent:
|
2508 + | /// :rtype EventStream:
|
2509 + | pub fn headers(data: crate::model::HeadersEvent) -> Self {
|
2510 + | Self(EventStream::Headers(data))
|
2511 + | }
|
2512 + | /// Tries to convert the enum instance into [`Headers`](crate::model::EventStream::Headers), extracting the inner [`HeadersEvent`](crate::model::HeadersEvent).
|
2513 + | /// :rtype rest_json.model.HeadersEvent:
|
2514 + | pub fn as_headers(&self) -> ::pyo3::PyResult<crate::model::HeadersEvent> {
|
2515 + | match self.0.as_headers() {
|
2516 + | Ok(variant) => Ok(variant.clone()),
|
2517 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2518 + | r"EventStream variant is not of type rest_json.model.HeadersEvent",
|
2519 + | )),
|
2520 + | }
|
2521 + | }
|
2522 + | /// Returns true if this is a [`Headers`](crate::model::EventStream::Headers).
|
2523 + | /// :rtype bool:
|
2524 + | pub fn is_headers(&self) -> bool {
|
2525 + | self.0.is_headers()
|
2526 + | }
|
2527 + | #[staticmethod]
|
2528 + | /// Creates a new union instance of [`HeadersAndExplicitPayload`](crate::model::EventStream::HeadersAndExplicitPayload)
|
2529 + | /// :param data rest_json.model.HeadersAndExplicitPayloadEvent:
|
2530 + | /// :rtype EventStream:
|
2531 + | pub fn headers_and_explicit_payload(
|
2532 + | data: crate::model::HeadersAndExplicitPayloadEvent,
|
2533 + | ) -> Self {
|
2534 + | Self(EventStream::HeadersAndExplicitPayload(data))
|
2535 + | }
|
2536 + | /// Tries to convert the enum instance into [`HeadersAndExplicitPayload`](crate::model::EventStream::HeadersAndExplicitPayload), extracting the inner [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
2537 + | /// :rtype rest_json.model.HeadersAndExplicitPayloadEvent:
|
2538 + | pub fn as_headers_and_explicit_payload(
|
2539 + | &self,
|
2540 + | ) -> ::pyo3::PyResult<crate::model::HeadersAndExplicitPayloadEvent> {
|
2541 + | match self.0.as_headers_and_explicit_payload() {
|
2542 + | Ok(variant) => Ok(variant.clone()),
|
2543 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2544 + | r"EventStream variant is not of type rest_json.model.HeadersAndExplicitPayloadEvent",
|
2545 + | )),
|
2546 + | }
|
2547 + | }
|
2548 + | /// Returns true if this is a [`HeadersAndExplicitPayload`](crate::model::EventStream::HeadersAndExplicitPayload).
|
2549 + | /// :rtype bool:
|
2550 + | pub fn is_headers_and_explicit_payload(&self) -> bool {
|
2551 + | self.0.is_headers_and_explicit_payload()
|
2552 + | }
|
2553 + | #[staticmethod]
|
2554 + | /// Creates a new union instance of [`HeadersAndImplicitPayload`](crate::model::EventStream::HeadersAndImplicitPayload)
|
2555 + | /// :param data rest_json.model.HeadersAndImplicitPayloadEvent:
|
2556 + | /// :rtype EventStream:
|
2557 + | pub fn headers_and_implicit_payload(
|
2558 + | data: crate::model::HeadersAndImplicitPayloadEvent,
|
2559 + | ) -> Self {
|
2560 + | Self(EventStream::HeadersAndImplicitPayload(data))
|
2561 + | }
|
2562 + | /// Tries to convert the enum instance into [`HeadersAndImplicitPayload`](crate::model::EventStream::HeadersAndImplicitPayload), extracting the inner [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
2563 + | /// :rtype rest_json.model.HeadersAndImplicitPayloadEvent:
|
2564 + | pub fn as_headers_and_implicit_payload(
|
2565 + | &self,
|
2566 + | ) -> ::pyo3::PyResult<crate::model::HeadersAndImplicitPayloadEvent> {
|
2567 + | match self.0.as_headers_and_implicit_payload() {
|
2568 + | Ok(variant) => Ok(variant.clone()),
|
2569 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2570 + | r"EventStream variant is not of type rest_json.model.HeadersAndImplicitPayloadEvent",
|
2571 + | )),
|
995 2572 | }
|
996 - | /// Tries to convert the enum instance into [`Int`](crate::model::SimpleUnion::Int), extracting the inner [`i32`](i32).
|
997 - | /// :rtype int:
|
998 - | pub fn as_int(&self) -> ::pyo3::PyResult<i32> {
|
999 - | match self.0.as_int() {
|
1000 - | Ok(variant) => Ok(*variant),
|
2573 + | }
|
2574 + | /// Returns true if this is a [`HeadersAndImplicitPayload`](crate::model::EventStream::HeadersAndImplicitPayload).
|
2575 + | /// :rtype bool:
|
2576 + | pub fn is_headers_and_implicit_payload(&self) -> bool {
|
2577 + | self.0.is_headers_and_implicit_payload()
|
2578 + | }
|
2579 + | #[staticmethod]
|
2580 + | /// Creates a new union instance of [`StringPayload`](crate::model::EventStream::StringPayload)
|
2581 + | /// :param data rest_json.model.StringPayloadEvent:
|
2582 + | /// :rtype EventStream:
|
2583 + | pub fn string_payload(data: crate::model::StringPayloadEvent) -> Self {
|
2584 + | Self(EventStream::StringPayload(data))
|
2585 + | }
|
2586 + | /// Tries to convert the enum instance into [`StringPayload`](crate::model::EventStream::StringPayload), extracting the inner [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
2587 + | /// :rtype rest_json.model.StringPayloadEvent:
|
2588 + | pub fn as_string_payload(&self) -> ::pyo3::PyResult<crate::model::StringPayloadEvent> {
|
2589 + | match self.0.as_string_payload() {
|
2590 + | Ok(variant) => Ok(variant.clone()),
|
1001 2591 | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1002 - | r"SimpleUnion variant is not of type int",
|
2592 + | r"EventStream variant is not of type rest_json.model.StringPayloadEvent",
|
1003 2593 | )),
|
1004 2594 | }
|
1005 2595 | }
|
1006 - | /// Returns true if this is a [`Int`](crate::model::SimpleUnion::Int).
|
2596 + | /// Returns true if this is a [`StringPayload`](crate::model::EventStream::StringPayload).
|
1007 2597 | /// :rtype bool:
|
1008 - | pub fn is_int(&self) -> bool {
|
1009 - | self.0.is_int()
|
2598 + | pub fn is_string_payload(&self) -> bool {
|
2599 + | self.0.is_string_payload()
|
1010 2600 | }
|
1011 2601 | #[staticmethod]
|
1012 - | /// Creates a new union instance of [`String`](crate::model::SimpleUnion::String)
|
1013 - | /// :param data str:
|
1014 - | /// :rtype SimpleUnion:
|
1015 - | pub fn string(data: ::std::string::String) -> Self {
|
1016 - | Self(SimpleUnion::String(data))
|
2602 + | /// Creates a new union instance of [`StructurePayload`](crate::model::EventStream::StructurePayload)
|
2603 + | /// :param data rest_json.model.StructurePayloadEvent:
|
2604 + | /// :rtype EventStream:
|
2605 + | pub fn structure_payload(data: crate::model::StructurePayloadEvent) -> Self {
|
2606 + | Self(EventStream::StructurePayload(data))
|
2607 + | }
|
2608 + | /// Tries to convert the enum instance into [`StructurePayload`](crate::model::EventStream::StructurePayload), extracting the inner [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
2609 + | /// :rtype rest_json.model.StructurePayloadEvent:
|
2610 + | pub fn as_structure_payload(&self) -> ::pyo3::PyResult<crate::model::StructurePayloadEvent> {
|
2611 + | match self.0.as_structure_payload() {
|
2612 + | Ok(variant) => Ok(variant.clone()),
|
2613 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2614 + | r"EventStream variant is not of type rest_json.model.StructurePayloadEvent",
|
2615 + | )),
|
1017 2616 | }
|
1018 - | /// Tries to convert the enum instance into [`String`](crate::model::SimpleUnion::String), extracting the inner [`String`](::std::string::String).
|
1019 - | /// :rtype str:
|
1020 - | pub fn as_string(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1021 - | match self.0.as_string() {
|
2617 + | }
|
2618 + | /// Returns true if this is a [`StructurePayload`](crate::model::EventStream::StructurePayload).
|
2619 + | /// :rtype bool:
|
2620 + | pub fn is_structure_payload(&self) -> bool {
|
2621 + | self.0.is_structure_payload()
|
2622 + | }
|
2623 + | #[staticmethod]
|
2624 + | /// Creates a new union instance of [`UnionPayload`](crate::model::EventStream::UnionPayload)
|
2625 + | /// :param data rest_json.model.UnionPayloadEvent:
|
2626 + | /// :rtype EventStream:
|
2627 + | pub fn union_payload(data: crate::model::UnionPayloadEvent) -> Self {
|
2628 + | Self(EventStream::UnionPayload(data))
|
2629 + | }
|
2630 + | /// Tries to convert the enum instance into [`UnionPayload`](crate::model::EventStream::UnionPayload), extracting the inner [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
2631 + | /// :rtype rest_json.model.UnionPayloadEvent:
|
2632 + | pub fn as_union_payload(&self) -> ::pyo3::PyResult<crate::model::UnionPayloadEvent> {
|
2633 + | match self.0.as_union_payload() {
|
1022 2634 | Ok(variant) => Ok(variant.clone()),
|
1023 2635 | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1024 - | r"SimpleUnion variant is not of type str",
|
2636 + | r"EventStream variant is not of type rest_json.model.UnionPayloadEvent",
|
1025 2637 | )),
|
1026 2638 | }
|
1027 2639 | }
|
1028 - | /// Returns true if this is a [`String`](crate::model::SimpleUnion::String).
|
2640 + | /// Returns true if this is a [`UnionPayload`](crate::model::EventStream::UnionPayload).
|
1029 2641 | /// :rtype bool:
|
1030 - | pub fn is_string(&self) -> bool {
|
1031 - | self.0.is_string()
|
2642 + | pub fn is_union_payload(&self) -> bool {
|
2643 + | self.0.is_union_payload()
|
1032 2644 | }
|
1033 2645 | }
|
1034 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for SimpleUnion {
|
2646 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for EventStream {
|
1035 2647 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1036 - | PyUnionMarkerSimpleUnion(self).into_py(py)
|
2648 + | PyUnionMarkerEventStream(self).into_py(py)
|
1037 2649 | }
|
1038 2650 | }
|
1039 - | impl<'source> ::pyo3::FromPyObject<'source> for SimpleUnion {
|
2651 + | impl<'source> ::pyo3::FromPyObject<'source> for EventStream {
|
1040 2652 | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1041 - | let data: PyUnionMarkerSimpleUnion = obj.extract()?;
|
2653 + | let data: PyUnionMarkerEventStream = obj.extract()?;
|
1042 2654 | Ok(data.0)
|
1043 2655 | }
|
1044 2656 | }
|
1045 2657 |
|
1046 2658 | #[allow(missing_docs)] // documentation missing in model
|
1047 2659 | #[derive(
|
1048 2660 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1049 2661 | )]
|
1050 - | pub enum UnionWithJsonName {
|
1051 - | #[allow(missing_docs)] // documentation missing in model
|
1052 - | Bar(::std::string::String),
|
1053 - | #[allow(missing_docs)] // documentation missing in model
|
1054 - | Baz(::std::string::String),
|
2662 + | pub enum SingletonEventStream {
|
1055 2663 | #[allow(missing_docs)] // documentation missing in model
|
1056 - | Foo(::std::string::String),
|
2664 + | Singleton(crate::model::SingletonEvent),
|
1057 2665 | }
|
1058 - | impl UnionWithJsonName {
|
1059 - | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
2666 + | impl SingletonEventStream {
|
2667 + | #[allow(irrefutable_let_patterns)]
|
2668 + | /// Tries to convert the enum instance into [`Singleton`](crate::model::SingletonEventStream::Singleton), extracting the inner [`SingletonEvent`](crate::model::SingletonEvent).
|
1060 2669 | /// Returns `Err(&Self)` if it can't be converted.
|
1061 - | pub fn as_bar(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1062 - | if let UnionWithJsonName::Bar(val) = &self {
|
2670 + | pub fn as_singleton(&self) -> ::std::result::Result<&crate::model::SingletonEvent, &Self> {
|
2671 + | if let SingletonEventStream::Singleton(val) = &self {
|
1063 2672 | ::std::result::Result::Ok(val)
|
1064 2673 | } else {
|
1065 2674 | ::std::result::Result::Err(self)
|
1066 2675 | }
|
1067 2676 | }
|
1068 - | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
1069 - | pub fn is_bar(&self) -> bool {
|
1070 - | self.as_bar().is_ok()
|
2677 + | /// Returns true if this is a [`Singleton`](crate::model::SingletonEventStream::Singleton).
|
2678 + | pub fn is_singleton(&self) -> bool {
|
2679 + | self.as_singleton().is_ok()
|
1071 2680 | }
|
1072 - | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
1073 - | /// Returns `Err(&Self)` if it can't be converted.
|
1074 - | pub fn as_baz(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1075 - | if let UnionWithJsonName::Baz(val) = &self {
|
1076 - | ::std::result::Result::Ok(val)
|
1077 - | } else {
|
1078 - | ::std::result::Result::Err(self)
|
2681 + | }
|
2682 + | #[pyo3::pyclass(name = "SingletonEventStream")]
|
2683 + | #[derive(
|
2684 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2685 + | )]
|
2686 + | pub struct PyUnionMarkerSingletonEventStream(pub SingletonEventStream);
|
2687 + | #[::pyo3::pymethods]
|
2688 + | impl PyUnionMarkerSingletonEventStream {
|
2689 + | #[allow(irrefutable_let_patterns)]
|
2690 + | #[staticmethod]
|
2691 + | /// Creates a new union instance of [`Singleton`](crate::model::SingletonEventStream::Singleton)
|
2692 + | /// :param data rest_json.model.SingletonEvent:
|
2693 + | /// :rtype SingletonEventStream:
|
2694 + | pub fn singleton(data: crate::model::SingletonEvent) -> Self {
|
2695 + | Self(SingletonEventStream::Singleton(data))
|
2696 + | }
|
2697 + | /// Tries to convert the enum instance into [`Singleton`](crate::model::SingletonEventStream::Singleton), extracting the inner [`SingletonEvent`](crate::model::SingletonEvent).
|
2698 + | /// :rtype rest_json.model.SingletonEvent:
|
2699 + | pub fn as_singleton(&self) -> ::pyo3::PyResult<crate::model::SingletonEvent> {
|
2700 + | match self.0.as_singleton() {
|
2701 + | Ok(variant) => Ok(variant.clone()),
|
2702 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2703 + | r"SingletonEventStream variant is not of type rest_json.model.SingletonEvent",
|
2704 + | )),
|
1079 2705 | }
|
1080 2706 | }
|
1081 - | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
1082 - | pub fn is_baz(&self) -> bool {
|
1083 - | self.as_baz().is_ok()
|
2707 + | /// Returns true if this is a [`Singleton`](crate::model::SingletonEventStream::Singleton).
|
2708 + | /// :rtype bool:
|
2709 + | pub fn is_singleton(&self) -> bool {
|
2710 + | self.0.is_singleton()
|
1084 2711 | }
|
1085 - | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
1086 - | /// Returns `Err(&Self)` if it can't be converted.
|
1087 - | pub fn as_foo(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1088 - | if let UnionWithJsonName::Foo(val) = &self {
|
1089 - | ::std::result::Result::Ok(val)
|
1090 - | } else {
|
1091 - | ::std::result::Result::Err(self)
|
2712 + | }
|
2713 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for SingletonEventStream {
|
2714 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2715 + | PyUnionMarkerSingletonEventStream(self).into_py(py)
|
1092 2716 | }
|
2717 + | }
|
2718 + | impl<'source> ::pyo3::FromPyObject<'source> for SingletonEventStream {
|
2719 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2720 + | let data: PyUnionMarkerSingletonEventStream = obj.extract()?;
|
2721 + | Ok(data.0)
|
1093 2722 | }
|
1094 - | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
1095 - | pub fn is_foo(&self) -> bool {
|
1096 - | self.as_foo().is_ok()
|
2723 + | }
|
2724 + |
|
2725 + | #[::pyo3::pyclass]
|
2726 + | /// :param path str:
|
2727 + | /// :param message str:
|
2728 + | /// :rtype None:
|
2729 + | /// Describes one specific validation failure for an input member.
|
2730 + | #[derive(
|
2731 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2732 + | )]
|
2733 + | pub struct ValidationExceptionField {
|
2734 + | #[pyo3(get, set)]
|
2735 + | /// :type str:
|
2736 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
2737 + | pub path: ::std::string::String,
|
2738 + | #[pyo3(get, set)]
|
2739 + | /// :type str:
|
2740 + | /// A detailed description of the validation failure.
|
2741 + | pub message: ::std::string::String,
|
2742 + | }
|
2743 + | impl ValidationExceptionField {
|
2744 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
2745 + | pub fn path(&self) -> &str {
|
2746 + | use std::ops::Deref;
|
2747 + | self.path.deref()
|
2748 + | }
|
2749 + | /// A detailed description of the validation failure.
|
2750 + | pub fn message(&self) -> &str {
|
2751 + | use std::ops::Deref;
|
2752 + | self.message.deref()
|
1097 2753 | }
|
1098 2754 | }
|
1099 - | #[pyo3::pyclass(name = "UnionWithJsonName")]
|
2755 + | #[allow(clippy::new_without_default)]
|
2756 + | #[allow(clippy::too_many_arguments)]
|
2757 + | #[::pyo3::pymethods]
|
2758 + | impl ValidationExceptionField {
|
2759 + | #[new]
|
2760 + | pub fn new(path: ::std::string::String, message: ::std::string::String) -> Self {
|
2761 + | Self { path, message }
|
2762 + | }
|
2763 + | fn __repr__(&self) -> String {
|
2764 + | format!("{self:?}")
|
2765 + | }
|
2766 + | fn __str__(&self) -> String {
|
2767 + | format!("{self:?}")
|
2768 + | }
|
2769 + | }
|
2770 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ValidationExceptionField> {
|
2771 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2772 + | ob.extract::<ValidationExceptionField>().map(Box::new)
|
2773 + | }
|
2774 + | }
|
2775 + |
|
2776 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ValidationExceptionField> {
|
2777 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2778 + | (*self).into_py(py)
|
2779 + | }
|
2780 + | }
|
2781 + | impl ValidationExceptionField {
|
2782 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2783 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
2784 + | crate::model::validation_exception_field::Builder::default()
|
2785 + | }
|
2786 + | }
|
2787 + |
|
2788 + | #[::pyo3::pyclass]
|
2789 + | /// :param bar typing.Optional\[str\]:
|
2790 + | /// :param recursive_member typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested1\]:
|
2791 + | /// :rtype None:
|
2792 + | #[allow(missing_docs)] // documentation missing in model
|
1100 2793 | #[derive(
|
1101 2794 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1102 2795 | )]
|
1103 - | pub struct PyUnionMarkerUnionWithJsonName(pub UnionWithJsonName);
|
2796 + | pub struct RecursiveShapesInputOutputNested2 {
|
2797 + | #[pyo3(get, set)]
|
2798 + | /// :type typing.Optional\[str\]:
|
2799 + | #[allow(missing_docs)] // documentation missing in model
|
2800 + | pub bar: ::std::option::Option<::std::string::String>,
|
2801 + | #[pyo3(get, set)]
|
2802 + | /// :type typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested1\]:
|
2803 + | #[allow(missing_docs)] // documentation missing in model
|
2804 + | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
2805 + | }
|
2806 + | impl RecursiveShapesInputOutputNested2 {
|
2807 + | #[allow(missing_docs)] // documentation missing in model
|
2808 + | pub fn bar(&self) -> ::std::option::Option<&str> {
|
2809 + | self.bar.as_deref()
|
2810 + | }
|
2811 + | #[allow(missing_docs)] // documentation missing in model
|
2812 + | pub fn recursive_member(
|
2813 + | &self,
|
2814 + | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
2815 + | self.recursive_member.as_ref()
|
2816 + | }
|
2817 + | }
|
2818 + | #[allow(clippy::new_without_default)]
|
2819 + | #[allow(clippy::too_many_arguments)]
|
1104 2820 | #[::pyo3::pymethods]
|
1105 - | impl PyUnionMarkerUnionWithJsonName {
|
1106 - | #[staticmethod]
|
1107 - | /// Creates a new union instance of [`Bar`](crate::model::UnionWithJsonName::Bar)
|
1108 - | /// :param data str:
|
1109 - | /// :rtype UnionWithJsonName:
|
1110 - | pub fn bar(data: ::std::string::String) -> Self {
|
1111 - | Self(UnionWithJsonName::Bar(data))
|
2821 + | impl RecursiveShapesInputOutputNested2 {
|
2822 + | #[new]
|
2823 + | pub fn new(
|
2824 + | bar: ::std::option::Option<::std::string::String>,
|
2825 + | recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
2826 + | ) -> Self {
|
2827 + | Self {
|
2828 + | bar,
|
2829 + | recursive_member,
|
1112 2830 | }
|
1113 - | /// Tries to convert the enum instance into [`Bar`](crate::model::UnionWithJsonName::Bar), extracting the inner [`String`](::std::string::String).
|
1114 - | /// :rtype str:
|
1115 - | pub fn as_bar(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1116 - | match self.0.as_bar() {
|
1117 - | Ok(variant) => Ok(variant.clone()),
|
1118 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1119 - | r"UnionWithJsonName variant is not of type str",
|
1120 - | )),
|
1121 2831 | }
|
2832 + | fn __repr__(&self) -> String {
|
2833 + | format!("{self:?}")
|
1122 2834 | }
|
1123 - | /// Returns true if this is a [`Bar`](crate::model::UnionWithJsonName::Bar).
|
1124 - | /// :rtype bool:
|
1125 - | pub fn is_bar(&self) -> bool {
|
1126 - | self.0.is_bar()
|
2835 + | fn __str__(&self) -> String {
|
2836 + | format!("{self:?}")
|
1127 2837 | }
|
1128 - | #[staticmethod]
|
1129 - | /// Creates a new union instance of [`Baz`](crate::model::UnionWithJsonName::Baz)
|
1130 - | /// :param data str:
|
1131 - | /// :rtype UnionWithJsonName:
|
1132 - | pub fn baz(data: ::std::string::String) -> Self {
|
1133 - | Self(UnionWithJsonName::Baz(data))
|
2838 + | }
|
2839 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
2840 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2841 + | ob.extract::<RecursiveShapesInputOutputNested2>()
|
2842 + | .map(Box::new)
|
1134 2843 | }
|
1135 - | /// Tries to convert the enum instance into [`Baz`](crate::model::UnionWithJsonName::Baz), extracting the inner [`String`](::std::string::String).
|
1136 - | /// :rtype str:
|
1137 - | pub fn as_baz(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1138 - | match self.0.as_baz() {
|
1139 - | Ok(variant) => Ok(variant.clone()),
|
1140 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1141 - | r"UnionWithJsonName variant is not of type str",
|
1142 - | )),
|
2844 + | }
|
2845 + |
|
2846 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
2847 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2848 + | (*self).into_py(py)
|
2849 + | }
|
2850 + | }
|
2851 + | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
2852 + | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
2853 + | }
|
2854 + | impl RecursiveShapesInputOutputNested2 {
|
2855 + | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
2856 + | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
2857 + | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
1143 2858 | }
|
2859 + | }
|
2860 + |
|
2861 + | #[::pyo3::pyclass]
|
2862 + | /// :param a typing.Optional\[str\]:
|
2863 + | /// :param b typing.Optional\[str\]:
|
2864 + | /// :rtype None:
|
2865 + | #[allow(missing_docs)] // documentation missing in model
|
2866 + | #[derive(
|
2867 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2868 + | )]
|
2869 + | pub struct StructureListMember {
|
2870 + | #[pyo3(get, set)]
|
2871 + | /// :type typing.Optional\[str\]:
|
2872 + | #[allow(missing_docs)] // documentation missing in model
|
2873 + | pub a: ::std::option::Option<::std::string::String>,
|
2874 + | #[pyo3(get, set)]
|
2875 + | /// :type typing.Optional\[str\]:
|
2876 + | #[allow(missing_docs)] // documentation missing in model
|
2877 + | pub b: ::std::option::Option<::std::string::String>,
|
2878 + | }
|
2879 + | impl StructureListMember {
|
2880 + | #[allow(missing_docs)] // documentation missing in model
|
2881 + | pub fn a(&self) -> ::std::option::Option<&str> {
|
2882 + | self.a.as_deref()
|
1144 2883 | }
|
1145 - | /// Returns true if this is a [`Baz`](crate::model::UnionWithJsonName::Baz).
|
1146 - | /// :rtype bool:
|
1147 - | pub fn is_baz(&self) -> bool {
|
1148 - | self.0.is_baz()
|
2884 + | #[allow(missing_docs)] // documentation missing in model
|
2885 + | pub fn b(&self) -> ::std::option::Option<&str> {
|
2886 + | self.b.as_deref()
|
1149 2887 | }
|
1150 - | #[staticmethod]
|
1151 - | /// Creates a new union instance of [`Foo`](crate::model::UnionWithJsonName::Foo)
|
1152 - | /// :param data str:
|
1153 - | /// :rtype UnionWithJsonName:
|
1154 - | pub fn foo(data: ::std::string::String) -> Self {
|
1155 - | Self(UnionWithJsonName::Foo(data))
|
2888 + | }
|
2889 + | #[allow(clippy::new_without_default)]
|
2890 + | #[allow(clippy::too_many_arguments)]
|
2891 + | #[::pyo3::pymethods]
|
2892 + | impl StructureListMember {
|
2893 + | #[new]
|
2894 + | pub fn new(
|
2895 + | a: ::std::option::Option<::std::string::String>,
|
2896 + | b: ::std::option::Option<::std::string::String>,
|
2897 + | ) -> Self {
|
2898 + | Self { a, b }
|
1156 2899 | }
|
1157 - | /// Tries to convert the enum instance into [`Foo`](crate::model::UnionWithJsonName::Foo), extracting the inner [`String`](::std::string::String).
|
1158 - | /// :rtype str:
|
1159 - | pub fn as_foo(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1160 - | match self.0.as_foo() {
|
1161 - | Ok(variant) => Ok(variant.clone()),
|
1162 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1163 - | r"UnionWithJsonName variant is not of type str",
|
1164 - | )),
|
2900 + | fn __repr__(&self) -> String {
|
2901 + | format!("{self:?}")
|
1165 2902 | }
|
2903 + | fn __str__(&self) -> String {
|
2904 + | format!("{self:?}")
|
1166 2905 | }
|
1167 - | /// Returns true if this is a [`Foo`](crate::model::UnionWithJsonName::Foo).
|
1168 - | /// :rtype bool:
|
1169 - | pub fn is_foo(&self) -> bool {
|
1170 - | self.0.is_foo()
|
2906 + | }
|
2907 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructureListMember> {
|
2908 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2909 + | ob.extract::<StructureListMember>().map(Box::new)
|
1171 2910 | }
|
1172 2911 | }
|
1173 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for UnionWithJsonName {
|
2912 + |
|
2913 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructureListMember> {
|
1174 2914 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1175 - | PyUnionMarkerUnionWithJsonName(self).into_py(py)
|
2915 + | (*self).into_py(py)
|
1176 2916 | }
|
1177 2917 | }
|
1178 - | impl<'source> ::pyo3::FromPyObject<'source> for UnionWithJsonName {
|
1179 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1180 - | let data: PyUnionMarkerUnionWithJsonName = obj.extract()?;
|
1181 - | Ok(data.0)
|
2918 + | impl crate::constrained::Constrained for crate::model::StructureListMember {
|
2919 + | type Unconstrained = crate::model::structure_list_member_internal::Builder;
|
2920 + | }
|
2921 + | impl StructureListMember {
|
2922 + | /// Creates a new builder-style object to manufacture [`StructureListMember`](crate::model::StructureListMember).
|
2923 + | pub fn builder() -> crate::model::structure_list_member::Builder {
|
2924 + | crate::model::structure_list_member::Builder::default()
|
1182 2925 | }
|
1183 2926 | }
|
1184 2927 |
|
2928 + | #[::pyo3::pyclass]
|
2929 + | /// :param hi typing.Optional\[str\]:
|
2930 + | /// :rtype None:
|
1185 2931 | #[allow(missing_docs)] // documentation missing in model
|
1186 2932 | #[derive(
|
1187 2933 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1188 2934 | )]
|
1189 - | pub enum PlayerAction {
|
1190 - | /// Quit the game.
|
1191 - | Quit,
|
2935 + | pub struct GreetingStruct {
|
2936 + | #[pyo3(get, set)]
|
2937 + | /// :type typing.Optional\[str\]:
|
2938 + | #[allow(missing_docs)] // documentation missing in model
|
2939 + | pub hi: ::std::option::Option<::std::string::String>,
|
1192 2940 | }
|
1193 - | impl PlayerAction {
|
1194 - | #[allow(irrefutable_let_patterns)]
|
1195 - | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
1196 - | /// Returns `Err(&Self)` if it can't be converted.
|
1197 - | pub fn as_quit(&self) -> ::std::result::Result<(), &Self> {
|
1198 - | if let PlayerAction::Quit = &self {
|
1199 - | ::std::result::Result::Ok(())
|
1200 - | } else {
|
1201 - | ::std::result::Result::Err(self)
|
2941 + | impl GreetingStruct {
|
2942 + | #[allow(missing_docs)] // documentation missing in model
|
2943 + | pub fn hi(&self) -> ::std::option::Option<&str> {
|
2944 + | self.hi.as_deref()
|
1202 2945 | }
|
2946 + | }
|
2947 + | #[allow(clippy::new_without_default)]
|
2948 + | #[allow(clippy::too_many_arguments)]
|
2949 + | #[::pyo3::pymethods]
|
2950 + | impl GreetingStruct {
|
2951 + | #[new]
|
2952 + | pub fn new(hi: ::std::option::Option<::std::string::String>) -> Self {
|
2953 + | Self { hi }
|
1203 2954 | }
|
1204 - | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
1205 - | pub fn is_quit(&self) -> bool {
|
1206 - | self.as_quit().is_ok()
|
2955 + | fn __repr__(&self) -> String {
|
2956 + | format!("{self:?}")
|
2957 + | }
|
2958 + | fn __str__(&self) -> String {
|
2959 + | format!("{self:?}")
|
1207 2960 | }
|
1208 2961 | }
|
1209 - | #[pyo3::pyclass(name = "PlayerAction")]
|
2962 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<GreetingStruct> {
|
2963 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2964 + | ob.extract::<GreetingStruct>().map(Box::new)
|
2965 + | }
|
2966 + | }
|
2967 + |
|
2968 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<GreetingStruct> {
|
2969 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2970 + | (*self).into_py(py)
|
2971 + | }
|
2972 + | }
|
2973 + | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
2974 + | type Unconstrained = crate::model::greeting_struct_internal::Builder;
|
2975 + | }
|
2976 + | impl GreetingStruct {
|
2977 + | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
2978 + | pub fn builder() -> crate::model::greeting_struct::Builder {
|
2979 + | crate::model::greeting_struct::Builder::default()
|
2980 + | }
|
2981 + | }
|
2982 + |
|
2983 + | #[::pyo3::pyclass]
|
2984 + | /// :param salutation typing.Optional\[str\]:
|
2985 + | /// :rtype None:
|
2986 + | #[allow(missing_docs)] // documentation missing in model
|
1210 2987 | #[derive(
|
1211 2988 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1212 2989 | )]
|
1213 - | pub struct PyUnionMarkerPlayerAction(pub PlayerAction);
|
2990 + | pub struct RenamedGreeting {
|
2991 + | #[pyo3(get, set)]
|
2992 + | /// :type typing.Optional\[str\]:
|
2993 + | #[allow(missing_docs)] // documentation missing in model
|
2994 + | pub salutation: ::std::option::Option<::std::string::String>,
|
2995 + | }
|
2996 + | impl RenamedGreeting {
|
2997 + | #[allow(missing_docs)] // documentation missing in model
|
2998 + | pub fn salutation(&self) -> ::std::option::Option<&str> {
|
2999 + | self.salutation.as_deref()
|
3000 + | }
|
3001 + | }
|
3002 + | #[allow(clippy::new_without_default)]
|
3003 + | #[allow(clippy::too_many_arguments)]
|
1214 3004 | #[::pyo3::pymethods]
|
1215 - | impl PyUnionMarkerPlayerAction {
|
1216 - | #[allow(irrefutable_let_patterns)]
|
1217 - | #[staticmethod]
|
1218 - | /// Creates a new union instance of [`Quit`](crate::model::PlayerAction::Quit)
|
1219 - | /// :rtype PlayerAction:
|
1220 - | pub fn quit() -> Self {
|
1221 - | Self(PlayerAction::Quit)
|
3005 + | impl RenamedGreeting {
|
3006 + | #[new]
|
3007 + | pub fn new(salutation: ::std::option::Option<::std::string::String>) -> Self {
|
3008 + | Self { salutation }
|
1222 3009 | }
|
1223 - | /// Tries to convert the enum instance into [`Quit`](crate::model::PlayerAction::Quit), extracting the inner `()`.
|
1224 - | /// :rtype None:
|
1225 - | pub fn as_quit(&self) -> ::pyo3::PyResult<()> {
|
1226 - | self.0.as_quit().map_err(|_| {
|
1227 - | ::pyo3::exceptions::PyValueError::new_err("PlayerAction variant is not None")
|
1228 - | })
|
3010 + | fn __repr__(&self) -> String {
|
3011 + | format!("{self:?}")
|
1229 3012 | }
|
1230 - | /// Returns true if this is a [`Quit`](crate::model::PlayerAction::Quit).
|
1231 - | /// :rtype bool:
|
1232 - | pub fn is_quit(&self) -> bool {
|
1233 - | self.0.is_quit()
|
3013 + | fn __str__(&self) -> String {
|
3014 + | format!("{self:?}")
|
1234 3015 | }
|
1235 3016 | }
|
1236 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for PlayerAction {
|
3017 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RenamedGreeting> {
|
3018 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3019 + | ob.extract::<RenamedGreeting>().map(Box::new)
|
3020 + | }
|
3021 + | }
|
3022 + |
|
3023 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RenamedGreeting> {
|
1237 3024 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1238 - | PyUnionMarkerPlayerAction(self).into_py(py)
|
3025 + | (*self).into_py(py)
|
1239 3026 | }
|
1240 3027 | }
|
1241 - | impl<'source> ::pyo3::FromPyObject<'source> for PlayerAction {
|
1242 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1243 - | let data: PyUnionMarkerPlayerAction = obj.extract()?;
|
1244 - | Ok(data.0)
|
3028 + | impl crate::constrained::Constrained for crate::model::RenamedGreeting {
|
3029 + | type Unconstrained = crate::model::renamed_greeting_internal::Builder;
|
3030 + | }
|
3031 + | impl RenamedGreeting {
|
3032 + | /// Creates a new builder-style object to manufacture [`RenamedGreeting`](crate::model::RenamedGreeting).
|
3033 + | pub fn builder() -> crate::model::renamed_greeting::Builder {
|
3034 + | crate::model::renamed_greeting::Builder::default()
|
1245 3035 | }
|
1246 3036 | }
|
1247 3037 |
|
1248 3038 | #[::pyo3::pyclass]
|
1249 3039 | /// :rtype None:
|
1250 3040 | #[allow(missing_docs)] // documentation missing in model
|
1251 3041 | #[derive(
|
1252 3042 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1253 3043 | )]
|
1254 3044 | pub struct Unit {}
|
1255 3045 | #[allow(clippy::new_without_default)]
|
1256 3046 | #[allow(clippy::too_many_arguments)]
|
1257 3047 | #[::pyo3::pymethods]
|
1258 3048 | impl Unit {
|
1259 3049 | #[new]
|
1260 3050 | pub fn new() -> Self {
|
1261 3051 | Self {}
|
1262 3052 | }
|
1263 3053 | fn __repr__(&self) -> String {
|
1264 3054 | format!("{self:?}")
|
1265 3055 | }
|
1266 3056 | fn __str__(&self) -> String {
|
1267 3057 | format!("{self:?}")
|
1268 3058 | }
|
1269 3059 | }
|
1270 3060 | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Unit> {
|
1271 3061 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1272 3062 | ob.extract::<Unit>().map(Box::new)
|
1273 3063 | }
|
1274 3064 | }
|
1275 3065 |
|
1276 3066 | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Unit> {
|
1277 3067 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1278 3068 | (*self).into_py(py)
|
1279 3069 | }
|
1280 3070 | }
|
1281 3071 | impl crate::constrained::Constrained for crate::model::Unit {
|
1282 3072 | type Unconstrained = crate::model::unit_internal::Builder;
|
1283 3073 | }
|
1284 - | impl Unit {
|
1285 - | /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit).
|
1286 - | pub fn builder() -> crate::model::unit::Builder {
|
1287 - | crate::model::unit::Builder::default()
|
3074 + | impl Unit {
|
3075 + | /// Creates a new builder-style object to manufacture [`Unit`](crate::model::Unit).
|
3076 + | pub fn builder() -> crate::model::unit::Builder {
|
3077 + | crate::model::unit::Builder::default()
|
3078 + | }
|
3079 + | }
|
3080 + |
|
3081 + | #[::pyo3::pyclass]
|
3082 + | /// :param phrase str:
|
3083 + | /// :rtype None:
|
3084 + | #[allow(missing_docs)] // documentation missing in model
|
3085 + | #[derive(
|
3086 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3087 + | )]
|
3088 + | pub struct Farewell {
|
3089 + | #[pyo3(get, set)]
|
3090 + | /// :type str:
|
3091 + | #[allow(missing_docs)] // documentation missing in model
|
3092 + | pub phrase: ::std::string::String,
|
3093 + | }
|
3094 + | impl Farewell {
|
3095 + | #[allow(missing_docs)] // documentation missing in model
|
3096 + | pub fn phrase(&self) -> &str {
|
3097 + | use std::ops::Deref;
|
3098 + | self.phrase.deref()
|
3099 + | }
|
3100 + | }
|
3101 + | #[allow(clippy::new_without_default)]
|
3102 + | #[allow(clippy::too_many_arguments)]
|
3103 + | #[::pyo3::pymethods]
|
3104 + | impl Farewell {
|
3105 + | #[new]
|
3106 + | pub fn new(phrase: ::std::string::String) -> Self {
|
3107 + | Self { phrase }
|
3108 + | }
|
3109 + | fn __repr__(&self) -> String {
|
3110 + | format!("{self:?}")
|
3111 + | }
|
3112 + | fn __str__(&self) -> String {
|
3113 + | format!("{self:?}")
|
3114 + | }
|
3115 + | }
|
3116 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<Farewell> {
|
3117 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3118 + | ob.extract::<Farewell>().map(Box::new)
|
3119 + | }
|
3120 + | }
|
3121 + |
|
3122 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<Farewell> {
|
3123 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3124 + | (*self).into_py(py)
|
3125 + | }
|
3126 + | }
|
3127 + | impl crate::constrained::Constrained for crate::model::Farewell {
|
3128 + | type Unconstrained = crate::model::farewell_internal::Builder;
|
3129 + | }
|
3130 + | impl Farewell {
|
3131 + | /// Creates a new builder-style object to manufacture [`Farewell`](crate::model::Farewell).
|
3132 + | pub fn builder() -> crate::model::farewell::Builder {
|
3133 + | crate::model::farewell::Builder::default()
|
1288 3134 | }
|
1289 3135 | }
|
1290 3136 |
|
1291 - | /// A union with a representative set of types for members.
|
1292 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1293 - | pub enum MyUnion {
|
1294 - | #[allow(missing_docs)] // documentation missing in model
|
1295 - | BlobValue(::aws_smithy_http_server_python::types::Blob),
|
1296 - | #[allow(missing_docs)] // documentation missing in model
|
1297 - | BooleanValue(bool),
|
3137 + | #[::pyo3::pyclass]
|
3138 + | /// :param boolean_header typing.Optional\[bool\]:
|
3139 + | /// :param byte_header typing.Optional\[int\]:
|
3140 + | /// :param short_header typing.Optional\[int\]:
|
3141 + | /// :param int_header typing.Optional\[int\]:
|
3142 + | /// :param long_header typing.Optional\[int\]:
|
3143 + | /// :param blob_header typing.Optional\[rest_json.types.Blob\]:
|
3144 + | /// :param string_header typing.Optional\[str\]:
|
3145 + | /// :param timestamp_header typing.Optional\[rest_json.types.DateTime\]:
|
3146 + | /// :rtype None:
|
3147 + | #[allow(missing_docs)] // documentation missing in model
|
3148 + | #[derive(
|
3149 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3150 + | )]
|
3151 + | pub struct HeadersEvent {
|
3152 + | #[pyo3(get, set)]
|
3153 + | /// :type typing.Optional\[bool\]:
|
1298 3154 | #[allow(missing_docs)] // documentation missing in model
|
1299 - | EnumValue(crate::model::FooEnum),
|
3155 + | pub boolean_header: ::std::option::Option<bool>,
|
3156 + | #[pyo3(get, set)]
|
3157 + | /// :type typing.Optional\[int\]:
|
1300 3158 | #[allow(missing_docs)] // documentation missing in model
|
1301 - | ListValue(::std::vec::Vec<::std::string::String>),
|
3159 + | pub byte_header: ::std::option::Option<i8>,
|
3160 + | #[pyo3(get, set)]
|
3161 + | /// :type typing.Optional\[int\]:
|
1302 3162 | #[allow(missing_docs)] // documentation missing in model
|
1303 - | MapValue(::std::collections::HashMap<::std::string::String, ::std::string::String>),
|
3163 + | pub short_header: ::std::option::Option<i16>,
|
3164 + | #[pyo3(get, set)]
|
3165 + | /// :type typing.Optional\[int\]:
|
1304 3166 | #[allow(missing_docs)] // documentation missing in model
|
1305 - | NumberValue(i32),
|
3167 + | pub int_header: ::std::option::Option<i32>,
|
3168 + | #[pyo3(get, set)]
|
3169 + | /// :type typing.Optional\[int\]:
|
1306 3170 | #[allow(missing_docs)] // documentation missing in model
|
1307 - | RenamedStructureValue(crate::model::RenamedGreeting),
|
3171 + | pub long_header: ::std::option::Option<i64>,
|
3172 + | #[pyo3(get, set)]
|
3173 + | /// :type typing.Optional\[rest_json.types.Blob\]:
|
1308 3174 | #[allow(missing_docs)] // documentation missing in model
|
1309 - | StringValue(::std::string::String),
|
3175 + | pub blob_header: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3176 + | #[pyo3(get, set)]
|
3177 + | /// :type typing.Optional\[str\]:
|
1310 3178 | #[allow(missing_docs)] // documentation missing in model
|
1311 - | StructureValue(crate::model::GreetingStruct),
|
3179 + | pub string_header: ::std::option::Option<::std::string::String>,
|
3180 + | #[pyo3(get, set)]
|
3181 + | /// :type typing.Optional\[rest_json.types.DateTime\]:
|
1312 3182 | #[allow(missing_docs)] // documentation missing in model
|
1313 - | TimestampValue(::aws_smithy_http_server_python::types::DateTime),
|
3183 + | pub timestamp_header: ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
1314 3184 | }
|
1315 - | impl MyUnion {
|
1316 - | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_http_server_python::types::Blob).
|
1317 - | /// Returns `Err(&Self)` if it can't be converted.
|
1318 - | pub fn as_blob_value(
|
1319 - | &self,
|
1320 - | ) -> ::std::result::Result<&::aws_smithy_http_server_python::types::Blob, &Self> {
|
1321 - | if let MyUnion::BlobValue(val) = &self {
|
1322 - | ::std::result::Result::Ok(val)
|
1323 - | } else {
|
1324 - | ::std::result::Result::Err(self)
|
1325 - | }
|
1326 - | }
|
1327 - | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
1328 - | pub fn is_blob_value(&self) -> bool {
|
1329 - | self.as_blob_value().is_ok()
|
1330 - | }
|
1331 - | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
1332 - | /// Returns `Err(&Self)` if it can't be converted.
|
1333 - | pub fn as_boolean_value(&self) -> ::std::result::Result<&bool, &Self> {
|
1334 - | if let MyUnion::BooleanValue(val) = &self {
|
1335 - | ::std::result::Result::Ok(val)
|
1336 - | } else {
|
1337 - | ::std::result::Result::Err(self)
|
1338 - | }
|
1339 - | }
|
1340 - | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
1341 - | pub fn is_boolean_value(&self) -> bool {
|
1342 - | self.as_boolean_value().is_ok()
|
1343 - | }
|
1344 - | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
1345 - | /// Returns `Err(&Self)` if it can't be converted.
|
1346 - | pub fn as_enum_value(&self) -> ::std::result::Result<&crate::model::FooEnum, &Self> {
|
1347 - | if let MyUnion::EnumValue(val) = &self {
|
1348 - | ::std::result::Result::Ok(val)
|
1349 - | } else {
|
1350 - | ::std::result::Result::Err(self)
|
1351 - | }
|
1352 - | }
|
1353 - | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
1354 - | pub fn is_enum_value(&self) -> bool {
|
1355 - | self.as_enum_value().is_ok()
|
1356 - | }
|
1357 - | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
1358 - | /// Returns `Err(&Self)` if it can't be converted.
|
1359 - | pub fn as_list_value(
|
1360 - | &self,
|
1361 - | ) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> {
|
1362 - | if let MyUnion::ListValue(val) = &self {
|
1363 - | ::std::result::Result::Ok(val)
|
1364 - | } else {
|
1365 - | ::std::result::Result::Err(self)
|
1366 - | }
|
1367 - | }
|
1368 - | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
1369 - | pub fn is_list_value(&self) -> bool {
|
1370 - | self.as_list_value().is_ok()
|
1371 - | }
|
1372 - | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
1373 - | /// Returns `Err(&Self)` if it can't be converted.
|
1374 - | pub fn as_map_value(
|
1375 - | &self,
|
1376 - | ) -> ::std::result::Result<
|
1377 - | &::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1378 - | &Self,
|
1379 - | > {
|
1380 - | if let MyUnion::MapValue(val) = &self {
|
1381 - | ::std::result::Result::Ok(val)
|
1382 - | } else {
|
1383 - | ::std::result::Result::Err(self)
|
1384 - | }
|
1385 - | }
|
1386 - | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
1387 - | pub fn is_map_value(&self) -> bool {
|
1388 - | self.as_map_value().is_ok()
|
1389 - | }
|
1390 - | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
1391 - | /// Returns `Err(&Self)` if it can't be converted.
|
1392 - | pub fn as_number_value(&self) -> ::std::result::Result<&i32, &Self> {
|
1393 - | if let MyUnion::NumberValue(val) = &self {
|
1394 - | ::std::result::Result::Ok(val)
|
1395 - | } else {
|
1396 - | ::std::result::Result::Err(self)
|
1397 - | }
|
1398 - | }
|
1399 - | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
1400 - | pub fn is_number_value(&self) -> bool {
|
1401 - | self.as_number_value().is_ok()
|
1402 - | }
|
1403 - | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
1404 - | /// Returns `Err(&Self)` if it can't be converted.
|
1405 - | pub fn as_renamed_structure_value(
|
1406 - | &self,
|
1407 - | ) -> ::std::result::Result<&crate::model::RenamedGreeting, &Self> {
|
1408 - | if let MyUnion::RenamedStructureValue(val) = &self {
|
1409 - | ::std::result::Result::Ok(val)
|
1410 - | } else {
|
1411 - | ::std::result::Result::Err(self)
|
1412 - | }
|
3185 + | impl HeadersEvent {
|
3186 + | #[allow(missing_docs)] // documentation missing in model
|
3187 + | pub fn boolean_header(&self) -> ::std::option::Option<bool> {
|
3188 + | self.boolean_header
|
1413 3189 | }
|
1414 - | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
1415 - | pub fn is_renamed_structure_value(&self) -> bool {
|
1416 - | self.as_renamed_structure_value().is_ok()
|
3190 + | #[allow(missing_docs)] // documentation missing in model
|
3191 + | pub fn byte_header(&self) -> ::std::option::Option<i8> {
|
3192 + | self.byte_header
|
1417 3193 | }
|
1418 - | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
1419 - | /// Returns `Err(&Self)` if it can't be converted.
|
1420 - | pub fn as_string_value(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
1421 - | if let MyUnion::StringValue(val) = &self {
|
1422 - | ::std::result::Result::Ok(val)
|
1423 - | } else {
|
1424 - | ::std::result::Result::Err(self)
|
3194 + | #[allow(missing_docs)] // documentation missing in model
|
3195 + | pub fn short_header(&self) -> ::std::option::Option<i16> {
|
3196 + | self.short_header
|
1425 3197 | }
|
3198 + | #[allow(missing_docs)] // documentation missing in model
|
3199 + | pub fn int_header(&self) -> ::std::option::Option<i32> {
|
3200 + | self.int_header
|
1426 3201 | }
|
1427 - | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
1428 - | pub fn is_string_value(&self) -> bool {
|
1429 - | self.as_string_value().is_ok()
|
3202 + | #[allow(missing_docs)] // documentation missing in model
|
3203 + | pub fn long_header(&self) -> ::std::option::Option<i64> {
|
3204 + | self.long_header
|
1430 3205 | }
|
1431 - | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
1432 - | /// Returns `Err(&Self)` if it can't be converted.
|
1433 - | pub fn as_structure_value(
|
3206 + | #[allow(missing_docs)] // documentation missing in model
|
3207 + | pub fn blob_header(
|
1434 3208 | &self,
|
1435 - | ) -> ::std::result::Result<&crate::model::GreetingStruct, &Self> {
|
1436 - | if let MyUnion::StructureValue(val) = &self {
|
1437 - | ::std::result::Result::Ok(val)
|
1438 - | } else {
|
1439 - | ::std::result::Result::Err(self)
|
1440 - | }
|
3209 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
3210 + | self.blob_header.as_ref()
|
1441 3211 | }
|
1442 - | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
1443 - | pub fn is_structure_value(&self) -> bool {
|
1444 - | self.as_structure_value().is_ok()
|
3212 + | #[allow(missing_docs)] // documentation missing in model
|
3213 + | pub fn string_header(&self) -> ::std::option::Option<&str> {
|
3214 + | self.string_header.as_deref()
|
1445 3215 | }
|
1446 - | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_http_server_python::types::DateTime).
|
1447 - | /// Returns `Err(&Self)` if it can't be converted.
|
1448 - | pub fn as_timestamp_value(
|
3216 + | #[allow(missing_docs)] // documentation missing in model
|
3217 + | pub fn timestamp_header(
|
1449 3218 | &self,
|
1450 - | ) -> ::std::result::Result<&::aws_smithy_http_server_python::types::DateTime, &Self> {
|
1451 - | if let MyUnion::TimestampValue(val) = &self {
|
1452 - | ::std::result::Result::Ok(val)
|
1453 - | } else {
|
1454 - | ::std::result::Result::Err(self)
|
1455 - | }
|
1456 - | }
|
1457 - | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
1458 - | pub fn is_timestamp_value(&self) -> bool {
|
1459 - | self.as_timestamp_value().is_ok()
|
3219 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::DateTime> {
|
3220 + | self.timestamp_header.as_ref()
|
1460 3221 | }
|
1461 3222 | }
|
1462 - | #[pyo3::pyclass(name = "MyUnion")]
|
1463 - | #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
1464 - | pub struct PyUnionMarkerMyUnion(pub MyUnion);
|
3223 + | #[allow(clippy::new_without_default)]
|
3224 + | #[allow(clippy::too_many_arguments)]
|
1465 3225 | #[::pyo3::pymethods]
|
1466 - | impl PyUnionMarkerMyUnion {
|
1467 - | #[staticmethod]
|
1468 - | /// Creates a new union instance of [`BlobValue`](crate::model::MyUnion::BlobValue)
|
1469 - | /// :param data rest_json.types.Blob:
|
1470 - | /// :rtype MyUnion:
|
1471 - | pub fn blob_value(data: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
1472 - | Self(MyUnion::BlobValue(data))
|
3226 + | impl HeadersEvent {
|
3227 + | #[new]
|
3228 + | pub fn new(
|
3229 + | boolean_header: ::std::option::Option<bool>,
|
3230 + | byte_header: ::std::option::Option<i8>,
|
3231 + | short_header: ::std::option::Option<i16>,
|
3232 + | int_header: ::std::option::Option<i32>,
|
3233 + | long_header: ::std::option::Option<i64>,
|
3234 + | blob_header: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3235 + | string_header: ::std::option::Option<::std::string::String>,
|
3236 + | timestamp_header: ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
3237 + | ) -> Self {
|
3238 + | Self {
|
3239 + | boolean_header,
|
3240 + | byte_header,
|
3241 + | short_header,
|
3242 + | int_header,
|
3243 + | long_header,
|
3244 + | blob_header,
|
3245 + | string_header,
|
3246 + | timestamp_header,
|
1473 3247 | }
|
1474 - | /// Tries to convert the enum instance into [`BlobValue`](crate::model::MyUnion::BlobValue), extracting the inner [`Blob`](::aws_smithy_http_server_python::types::Blob).
|
1475 - | /// :rtype rest_json.types.Blob:
|
1476 - | pub fn as_blob_value(&self) -> ::pyo3::PyResult<::aws_smithy_http_server_python::types::Blob> {
|
1477 - | match self.0.as_blob_value() {
|
1478 - | Ok(variant) => Ok(variant.clone()),
|
1479 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1480 - | r"MyUnion variant is not of type rest_json.types.Blob",
|
1481 - | )),
|
1482 3248 | }
|
3249 + | fn __repr__(&self) -> String {
|
3250 + | format!("{self:?}")
|
1483 3251 | }
|
1484 - | /// Returns true if this is a [`BlobValue`](crate::model::MyUnion::BlobValue).
|
1485 - | /// :rtype bool:
|
1486 - | pub fn is_blob_value(&self) -> bool {
|
1487 - | self.0.is_blob_value()
|
3252 + | fn __str__(&self) -> String {
|
3253 + | format!("{self:?}")
|
1488 3254 | }
|
1489 - | #[staticmethod]
|
1490 - | /// Creates a new union instance of [`BooleanValue`](crate::model::MyUnion::BooleanValue)
|
1491 - | /// :param data bool:
|
1492 - | /// :rtype MyUnion:
|
1493 - | pub fn boolean_value(data: bool) -> Self {
|
1494 - | Self(MyUnion::BooleanValue(data))
|
3255 + | }
|
3256 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<HeadersEvent> {
|
3257 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3258 + | ob.extract::<HeadersEvent>().map(Box::new)
|
1495 3259 | }
|
1496 - | /// Tries to convert the enum instance into [`BooleanValue`](crate::model::MyUnion::BooleanValue), extracting the inner [`bool`](bool).
|
1497 - | /// :rtype bool:
|
1498 - | pub fn as_boolean_value(&self) -> ::pyo3::PyResult<bool> {
|
1499 - | match self.0.as_boolean_value() {
|
1500 - | Ok(variant) => Ok(*variant),
|
1501 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1502 - | r"MyUnion variant is not of type bool",
|
1503 - | )),
|
3260 + | }
|
3261 + |
|
3262 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<HeadersEvent> {
|
3263 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3264 + | (*self).into_py(py)
|
1504 3265 | }
|
3266 + | }
|
3267 + | impl crate::constrained::Constrained for crate::model::HeadersEvent {
|
3268 + | type Unconstrained = crate::model::headers_event_internal::Builder;
|
3269 + | }
|
3270 + | impl HeadersEvent {
|
3271 + | /// Creates a new builder-style object to manufacture [`HeadersEvent`](crate::model::HeadersEvent).
|
3272 + | pub fn builder() -> crate::model::headers_event::Builder {
|
3273 + | crate::model::headers_event::Builder::default()
|
1505 3274 | }
|
1506 - | /// Returns true if this is a [`BooleanValue`](crate::model::MyUnion::BooleanValue).
|
1507 - | /// :rtype bool:
|
1508 - | pub fn is_boolean_value(&self) -> bool {
|
1509 - | self.0.is_boolean_value()
|
3275 + | }
|
3276 + |
|
3277 + | #[::pyo3::pyclass]
|
3278 + | /// :param payload typing.Optional\[rest_json.types.Blob\]:
|
3279 + | /// :rtype None:
|
3280 + | #[allow(missing_docs)] // documentation missing in model
|
3281 + | #[derive(
|
3282 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3283 + | )]
|
3284 + | pub struct BlobPayloadEvent {
|
3285 + | #[pyo3(get, set)]
|
3286 + | /// :type typing.Optional\[rest_json.types.Blob\]:
|
3287 + | #[allow(missing_docs)] // documentation missing in model
|
3288 + | pub payload: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3289 + | }
|
3290 + | impl BlobPayloadEvent {
|
3291 + | #[allow(missing_docs)] // documentation missing in model
|
3292 + | pub fn payload(&self) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
3293 + | self.payload.as_ref()
|
1510 3294 | }
|
1511 - | #[staticmethod]
|
1512 - | /// Creates a new union instance of [`EnumValue`](crate::model::MyUnion::EnumValue)
|
1513 - | /// :param data rest_json.model.FooEnum:
|
1514 - | /// :rtype MyUnion:
|
1515 - | pub fn enum_value(data: crate::model::FooEnum) -> Self {
|
1516 - | Self(MyUnion::EnumValue(data))
|
3295 + | }
|
3296 + | #[allow(clippy::new_without_default)]
|
3297 + | #[allow(clippy::too_many_arguments)]
|
3298 + | #[::pyo3::pymethods]
|
3299 + | impl BlobPayloadEvent {
|
3300 + | #[new]
|
3301 + | pub fn new(
|
3302 + | payload: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3303 + | ) -> Self {
|
3304 + | Self { payload }
|
1517 3305 | }
|
1518 - | /// Tries to convert the enum instance into [`EnumValue`](crate::model::MyUnion::EnumValue), extracting the inner [`FooEnum`](crate::model::FooEnum).
|
1519 - | /// :rtype rest_json.model.FooEnum:
|
1520 - | pub fn as_enum_value(&self) -> ::pyo3::PyResult<crate::model::FooEnum> {
|
1521 - | match self.0.as_enum_value() {
|
1522 - | Ok(variant) => Ok(variant.clone()),
|
1523 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1524 - | r"MyUnion variant is not of type rest_json.model.FooEnum",
|
1525 - | )),
|
3306 + | fn __repr__(&self) -> String {
|
3307 + | format!("{self:?}")
|
1526 3308 | }
|
3309 + | fn __str__(&self) -> String {
|
3310 + | format!("{self:?}")
|
1527 3311 | }
|
1528 - | /// Returns true if this is a [`EnumValue`](crate::model::MyUnion::EnumValue).
|
1529 - | /// :rtype bool:
|
1530 - | pub fn is_enum_value(&self) -> bool {
|
1531 - | self.0.is_enum_value()
|
3312 + | }
|
3313 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<BlobPayloadEvent> {
|
3314 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3315 + | ob.extract::<BlobPayloadEvent>().map(Box::new)
|
1532 3316 | }
|
1533 - | #[staticmethod]
|
1534 - | /// Creates a new union instance of [`ListValue`](crate::model::MyUnion::ListValue)
|
1535 - | /// :param data typing.List\[str\]:
|
1536 - | /// :rtype MyUnion:
|
1537 - | pub fn list_value(data: ::std::vec::Vec<::std::string::String>) -> Self {
|
1538 - | Self(MyUnion::ListValue(data))
|
3317 + | }
|
3318 + |
|
3319 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<BlobPayloadEvent> {
|
3320 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3321 + | (*self).into_py(py)
|
1539 3322 | }
|
1540 - | /// Tries to convert the enum instance into [`ListValue`](crate::model::MyUnion::ListValue), extracting the inner [`Vec`](::std::vec::Vec).
|
1541 - | /// :rtype typing.List\[str\]:
|
1542 - | pub fn as_list_value(&self) -> ::pyo3::PyResult<::std::vec::Vec<::std::string::String>> {
|
1543 - | match self.0.as_list_value() {
|
1544 - | Ok(variant) => Ok(variant.clone()),
|
1545 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1546 - | r"MyUnion variant is not of type typing.List\[str\]",
|
1547 - | )),
|
3323 + | }
|
3324 + | impl crate::constrained::Constrained for crate::model::BlobPayloadEvent {
|
3325 + | type Unconstrained = crate::model::blob_payload_event_internal::Builder;
|
3326 + | }
|
3327 + | impl BlobPayloadEvent {
|
3328 + | /// Creates a new builder-style object to manufacture [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
3329 + | pub fn builder() -> crate::model::blob_payload_event::Builder {
|
3330 + | crate::model::blob_payload_event::Builder::default()
|
1548 3331 | }
|
3332 + | }
|
3333 + |
|
3334 + | #[::pyo3::pyclass]
|
3335 + | /// :param payload typing.Optional\[str\]:
|
3336 + | /// :rtype None:
|
3337 + | #[allow(missing_docs)] // documentation missing in model
|
3338 + | #[derive(
|
3339 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3340 + | )]
|
3341 + | pub struct StringPayloadEvent {
|
3342 + | #[pyo3(get, set)]
|
3343 + | /// :type typing.Optional\[str\]:
|
3344 + | #[allow(missing_docs)] // documentation missing in model
|
3345 + | pub payload: ::std::option::Option<::std::string::String>,
|
3346 + | }
|
3347 + | impl StringPayloadEvent {
|
3348 + | #[allow(missing_docs)] // documentation missing in model
|
3349 + | pub fn payload(&self) -> ::std::option::Option<&str> {
|
3350 + | self.payload.as_deref()
|
1549 3351 | }
|
1550 - | /// Returns true if this is a [`ListValue`](crate::model::MyUnion::ListValue).
|
1551 - | /// :rtype bool:
|
1552 - | pub fn is_list_value(&self) -> bool {
|
1553 - | self.0.is_list_value()
|
3352 + | }
|
3353 + | #[allow(clippy::new_without_default)]
|
3354 + | #[allow(clippy::too_many_arguments)]
|
3355 + | #[::pyo3::pymethods]
|
3356 + | impl StringPayloadEvent {
|
3357 + | #[new]
|
3358 + | pub fn new(payload: ::std::option::Option<::std::string::String>) -> Self {
|
3359 + | Self { payload }
|
1554 3360 | }
|
1555 - | #[staticmethod]
|
1556 - | /// Creates a new union instance of [`MapValue`](crate::model::MyUnion::MapValue)
|
1557 - | /// :param data typing.Dict\[str, str\]:
|
1558 - | /// :rtype MyUnion:
|
1559 - | pub fn map_value(
|
1560 - | data: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
1561 - | ) -> Self {
|
1562 - | Self(MyUnion::MapValue(data))
|
3361 + | fn __repr__(&self) -> String {
|
3362 + | format!("{self:?}")
|
1563 3363 | }
|
1564 - | /// Tries to convert the enum instance into [`MapValue`](crate::model::MyUnion::MapValue), extracting the inner [`HashMap`](::std::collections::HashMap).
|
1565 - | /// :rtype typing.Dict\[str, str\]:
|
1566 - | pub fn as_map_value(
|
1567 - | &self,
|
1568 - | ) -> ::pyo3::PyResult<::std::collections::HashMap<::std::string::String, ::std::string::String>>
|
1569 - | {
|
1570 - | match self.0.as_map_value() {
|
1571 - | Ok(variant) => Ok(variant.clone()),
|
1572 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1573 - | r"MyUnion variant is not of type typing.Dict\[str, str\]",
|
1574 - | )),
|
3364 + | fn __str__(&self) -> String {
|
3365 + | format!("{self:?}")
|
1575 3366 | }
|
3367 + | }
|
3368 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StringPayloadEvent> {
|
3369 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3370 + | ob.extract::<StringPayloadEvent>().map(Box::new)
|
1576 3371 | }
|
1577 - | /// Returns true if this is a [`MapValue`](crate::model::MyUnion::MapValue).
|
1578 - | /// :rtype bool:
|
1579 - | pub fn is_map_value(&self) -> bool {
|
1580 - | self.0.is_map_value()
|
3372 + | }
|
3373 + |
|
3374 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StringPayloadEvent> {
|
3375 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3376 + | (*self).into_py(py)
|
1581 3377 | }
|
1582 - | #[staticmethod]
|
1583 - | /// Creates a new union instance of [`NumberValue`](crate::model::MyUnion::NumberValue)
|
1584 - | /// :param data int:
|
1585 - | /// :rtype MyUnion:
|
1586 - | pub fn number_value(data: i32) -> Self {
|
1587 - | Self(MyUnion::NumberValue(data))
|
3378 + | }
|
3379 + | impl crate::constrained::Constrained for crate::model::StringPayloadEvent {
|
3380 + | type Unconstrained = crate::model::string_payload_event_internal::Builder;
|
3381 + | }
|
3382 + | impl StringPayloadEvent {
|
3383 + | /// Creates a new builder-style object to manufacture [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
3384 + | pub fn builder() -> crate::model::string_payload_event::Builder {
|
3385 + | crate::model::string_payload_event::Builder::default()
|
1588 3386 | }
|
1589 - | /// Tries to convert the enum instance into [`NumberValue`](crate::model::MyUnion::NumberValue), extracting the inner [`i32`](i32).
|
1590 - | /// :rtype int:
|
1591 - | pub fn as_number_value(&self) -> ::pyo3::PyResult<i32> {
|
1592 - | match self.0.as_number_value() {
|
1593 - | Ok(variant) => Ok(*variant),
|
1594 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1595 - | r"MyUnion variant is not of type int",
|
1596 - | )),
|
3387 + | }
|
3388 + |
|
3389 + | #[::pyo3::pyclass]
|
3390 + | /// :param payload typing.Optional\[rest_json.model.PayloadStructure\]:
|
3391 + | /// :rtype None:
|
3392 + | #[allow(missing_docs)] // documentation missing in model
|
3393 + | #[derive(
|
3394 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3395 + | )]
|
3396 + | pub struct StructurePayloadEvent {
|
3397 + | #[pyo3(get, set)]
|
3398 + | /// :type typing.Optional\[rest_json.model.PayloadStructure\]:
|
3399 + | #[allow(missing_docs)] // documentation missing in model
|
3400 + | pub payload: ::std::option::Option<crate::model::PayloadStructure>,
|
3401 + | }
|
3402 + | impl StructurePayloadEvent {
|
3403 + | #[allow(missing_docs)] // documentation missing in model
|
3404 + | pub fn payload(&self) -> ::std::option::Option<&crate::model::PayloadStructure> {
|
3405 + | self.payload.as_ref()
|
1597 3406 | }
|
3407 + | }
|
3408 + | #[allow(clippy::new_without_default)]
|
3409 + | #[allow(clippy::too_many_arguments)]
|
3410 + | #[::pyo3::pymethods]
|
3411 + | impl StructurePayloadEvent {
|
3412 + | #[new]
|
3413 + | pub fn new(payload: ::std::option::Option<crate::model::PayloadStructure>) -> Self {
|
3414 + | Self { payload }
|
1598 3415 | }
|
1599 - | /// Returns true if this is a [`NumberValue`](crate::model::MyUnion::NumberValue).
|
1600 - | /// :rtype bool:
|
1601 - | pub fn is_number_value(&self) -> bool {
|
1602 - | self.0.is_number_value()
|
3416 + | fn __repr__(&self) -> String {
|
3417 + | format!("{self:?}")
|
1603 3418 | }
|
1604 - | #[staticmethod]
|
1605 - | /// Creates a new union instance of [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue)
|
1606 - | /// :param data rest_json.model.RenamedGreeting:
|
1607 - | /// :rtype MyUnion:
|
1608 - | pub fn renamed_structure_value(data: crate::model::RenamedGreeting) -> Self {
|
1609 - | Self(MyUnion::RenamedStructureValue(data))
|
3419 + | fn __str__(&self) -> String {
|
3420 + | format!("{self:?}")
|
1610 3421 | }
|
1611 - | /// Tries to convert the enum instance into [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue), extracting the inner [`RenamedGreeting`](crate::model::RenamedGreeting).
|
1612 - | /// :rtype rest_json.model.RenamedGreeting:
|
1613 - | pub fn as_renamed_structure_value(&self) -> ::pyo3::PyResult<crate::model::RenamedGreeting> {
|
1614 - | match self.0.as_renamed_structure_value() {
|
1615 - | Ok(variant) => Ok(variant.clone()),
|
1616 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1617 - | r"MyUnion variant is not of type rest_json.model.RenamedGreeting",
|
1618 - | )),
|
3422 + | }
|
3423 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructurePayloadEvent> {
|
3424 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3425 + | ob.extract::<StructurePayloadEvent>().map(Box::new)
|
1619 3426 | }
|
3427 + | }
|
3428 + |
|
3429 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructurePayloadEvent> {
|
3430 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3431 + | (*self).into_py(py)
|
1620 3432 | }
|
1621 - | /// Returns true if this is a [`RenamedStructureValue`](crate::model::MyUnion::RenamedStructureValue).
|
1622 - | /// :rtype bool:
|
1623 - | pub fn is_renamed_structure_value(&self) -> bool {
|
1624 - | self.0.is_renamed_structure_value()
|
3433 + | }
|
3434 + | impl crate::constrained::Constrained for crate::model::StructurePayloadEvent {
|
3435 + | type Unconstrained = crate::model::structure_payload_event_internal::Builder;
|
3436 + | }
|
3437 + | impl StructurePayloadEvent {
|
3438 + | /// Creates a new builder-style object to manufacture [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
3439 + | pub fn builder() -> crate::model::structure_payload_event::Builder {
|
3440 + | crate::model::structure_payload_event::Builder::default()
|
1625 3441 | }
|
1626 - | #[staticmethod]
|
1627 - | /// Creates a new union instance of [`StringValue`](crate::model::MyUnion::StringValue)
|
1628 - | /// :param data str:
|
1629 - | /// :rtype MyUnion:
|
1630 - | pub fn string_value(data: ::std::string::String) -> Self {
|
1631 - | Self(MyUnion::StringValue(data))
|
3442 + | }
|
3443 + |
|
3444 + | #[::pyo3::pyclass]
|
3445 + | /// :param payload typing.Optional\[rest_json.model.PayloadUnion\]:
|
3446 + | /// :rtype None:
|
3447 + | #[allow(missing_docs)] // documentation missing in model
|
3448 + | #[derive(
|
3449 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3450 + | )]
|
3451 + | pub struct UnionPayloadEvent {
|
3452 + | #[pyo3(get, set)]
|
3453 + | /// :type typing.Optional\[rest_json.model.PayloadUnion\]:
|
3454 + | #[allow(missing_docs)] // documentation missing in model
|
3455 + | pub payload: ::std::option::Option<crate::model::PayloadUnion>,
|
3456 + | }
|
3457 + | impl UnionPayloadEvent {
|
3458 + | #[allow(missing_docs)] // documentation missing in model
|
3459 + | pub fn payload(&self) -> ::std::option::Option<&crate::model::PayloadUnion> {
|
3460 + | self.payload.as_ref()
|
1632 3461 | }
|
1633 - | /// Tries to convert the enum instance into [`StringValue`](crate::model::MyUnion::StringValue), extracting the inner [`String`](::std::string::String).
|
1634 - | /// :rtype str:
|
1635 - | pub fn as_string_value(&self) -> ::pyo3::PyResult<::std::string::String> {
|
1636 - | match self.0.as_string_value() {
|
1637 - | Ok(variant) => Ok(variant.clone()),
|
1638 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1639 - | r"MyUnion variant is not of type str",
|
1640 - | )),
|
3462 + | }
|
3463 + | #[allow(clippy::new_without_default)]
|
3464 + | #[allow(clippy::too_many_arguments)]
|
3465 + | #[::pyo3::pymethods]
|
3466 + | impl UnionPayloadEvent {
|
3467 + | #[new]
|
3468 + | pub fn new(payload: ::std::option::Option<crate::model::PayloadUnion>) -> Self {
|
3469 + | Self { payload }
|
1641 3470 | }
|
3471 + | fn __repr__(&self) -> String {
|
3472 + | format!("{self:?}")
|
1642 3473 | }
|
1643 - | /// Returns true if this is a [`StringValue`](crate::model::MyUnion::StringValue).
|
1644 - | /// :rtype bool:
|
1645 - | pub fn is_string_value(&self) -> bool {
|
1646 - | self.0.is_string_value()
|
3474 + | fn __str__(&self) -> String {
|
3475 + | format!("{self:?}")
|
1647 3476 | }
|
1648 - | #[staticmethod]
|
1649 - | /// Creates a new union instance of [`StructureValue`](crate::model::MyUnion::StructureValue)
|
1650 - | /// :param data rest_json.model.GreetingStruct:
|
1651 - | /// :rtype MyUnion:
|
1652 - | pub fn structure_value(data: crate::model::GreetingStruct) -> Self {
|
1653 - | Self(MyUnion::StructureValue(data))
|
3477 + | }
|
3478 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<UnionPayloadEvent> {
|
3479 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3480 + | ob.extract::<UnionPayloadEvent>().map(Box::new)
|
1654 3481 | }
|
1655 - | /// Tries to convert the enum instance into [`StructureValue`](crate::model::MyUnion::StructureValue), extracting the inner [`GreetingStruct`](crate::model::GreetingStruct).
|
1656 - | /// :rtype rest_json.model.GreetingStruct:
|
1657 - | pub fn as_structure_value(&self) -> ::pyo3::PyResult<crate::model::GreetingStruct> {
|
1658 - | match self.0.as_structure_value() {
|
1659 - | Ok(variant) => Ok(variant.clone()),
|
1660 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1661 - | r"MyUnion variant is not of type rest_json.model.GreetingStruct",
|
1662 - | )),
|
3482 + | }
|
3483 + |
|
3484 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<UnionPayloadEvent> {
|
3485 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3486 + | (*self).into_py(py)
|
1663 3487 | }
|
3488 + | }
|
3489 + | impl crate::constrained::Constrained for crate::model::UnionPayloadEvent {
|
3490 + | type Unconstrained = crate::model::union_payload_event_internal::Builder;
|
3491 + | }
|
3492 + | impl UnionPayloadEvent {
|
3493 + | /// Creates a new builder-style object to manufacture [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
3494 + | pub fn builder() -> crate::model::union_payload_event::Builder {
|
3495 + | crate::model::union_payload_event::Builder::default()
|
1664 3496 | }
|
1665 - | /// Returns true if this is a [`StructureValue`](crate::model::MyUnion::StructureValue).
|
1666 - | /// :rtype bool:
|
1667 - | pub fn is_structure_value(&self) -> bool {
|
1668 - | self.0.is_structure_value()
|
3497 + | }
|
3498 + |
|
3499 + | #[::pyo3::pyclass]
|
3500 + | /// :param header typing.Optional\[str\]:
|
3501 + | /// :param payload typing.Optional\[rest_json.model.PayloadStructure\]:
|
3502 + | /// :rtype None:
|
3503 + | #[allow(missing_docs)] // documentation missing in model
|
3504 + | #[derive(
|
3505 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3506 + | )]
|
3507 + | pub struct HeadersAndExplicitPayloadEvent {
|
3508 + | #[pyo3(get, set)]
|
3509 + | /// :type typing.Optional\[str\]:
|
3510 + | #[allow(missing_docs)] // documentation missing in model
|
3511 + | pub header: ::std::option::Option<::std::string::String>,
|
3512 + | #[pyo3(get, set)]
|
3513 + | /// :type typing.Optional\[rest_json.model.PayloadStructure\]:
|
3514 + | #[allow(missing_docs)] // documentation missing in model
|
3515 + | pub payload: ::std::option::Option<crate::model::PayloadStructure>,
|
3516 + | }
|
3517 + | impl HeadersAndExplicitPayloadEvent {
|
3518 + | #[allow(missing_docs)] // documentation missing in model
|
3519 + | pub fn header(&self) -> ::std::option::Option<&str> {
|
3520 + | self.header.as_deref()
|
3521 + | }
|
3522 + | #[allow(missing_docs)] // documentation missing in model
|
3523 + | pub fn payload(&self) -> ::std::option::Option<&crate::model::PayloadStructure> {
|
3524 + | self.payload.as_ref()
|
1669 3525 | }
|
1670 - | #[staticmethod]
|
1671 - | /// Creates a new union instance of [`TimestampValue`](crate::model::MyUnion::TimestampValue)
|
1672 - | /// :param data rest_json.types.DateTime:
|
1673 - | /// :rtype MyUnion:
|
1674 - | pub fn timestamp_value(data: ::aws_smithy_http_server_python::types::DateTime) -> Self {
|
1675 - | Self(MyUnion::TimestampValue(data))
|
3526 + | }
|
3527 + | #[allow(clippy::new_without_default)]
|
3528 + | #[allow(clippy::too_many_arguments)]
|
3529 + | #[::pyo3::pymethods]
|
3530 + | impl HeadersAndExplicitPayloadEvent {
|
3531 + | #[new]
|
3532 + | pub fn new(
|
3533 + | header: ::std::option::Option<::std::string::String>,
|
3534 + | payload: ::std::option::Option<crate::model::PayloadStructure>,
|
3535 + | ) -> Self {
|
3536 + | Self { header, payload }
|
1676 3537 | }
|
1677 - | /// Tries to convert the enum instance into [`TimestampValue`](crate::model::MyUnion::TimestampValue), extracting the inner [`DateTime`](::aws_smithy_http_server_python::types::DateTime).
|
1678 - | /// :rtype rest_json.types.DateTime:
|
1679 - | pub fn as_timestamp_value(
|
1680 - | &self,
|
1681 - | ) -> ::pyo3::PyResult<::aws_smithy_http_server_python::types::DateTime> {
|
1682 - | match self.0.as_timestamp_value() {
|
1683 - | Ok(variant) => Ok(variant.clone()),
|
1684 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
1685 - | r"MyUnion variant is not of type rest_json.types.DateTime",
|
1686 - | )),
|
3538 + | fn __repr__(&self) -> String {
|
3539 + | format!("{self:?}")
|
1687 3540 | }
|
3541 + | fn __str__(&self) -> String {
|
3542 + | format!("{self:?}")
|
1688 3543 | }
|
1689 - | /// Returns true if this is a [`TimestampValue`](crate::model::MyUnion::TimestampValue).
|
1690 - | /// :rtype bool:
|
1691 - | pub fn is_timestamp_value(&self) -> bool {
|
1692 - | self.0.is_timestamp_value()
|
3544 + | }
|
3545 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<HeadersAndExplicitPayloadEvent> {
|
3546 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3547 + | ob.extract::<HeadersAndExplicitPayloadEvent>().map(Box::new)
|
1693 3548 | }
|
1694 3549 | }
|
1695 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for MyUnion {
|
3550 + |
|
3551 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<HeadersAndExplicitPayloadEvent> {
|
1696 3552 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1697 - | PyUnionMarkerMyUnion(self).into_py(py)
|
3553 + | (*self).into_py(py)
|
1698 3554 | }
|
1699 3555 | }
|
1700 - | impl<'source> ::pyo3::FromPyObject<'source> for MyUnion {
|
1701 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1702 - | let data: PyUnionMarkerMyUnion = obj.extract()?;
|
1703 - | Ok(data.0)
|
3556 + | impl crate::constrained::Constrained for crate::model::HeadersAndExplicitPayloadEvent {
|
3557 + | type Unconstrained = crate::model::headers_and_explicit_payload_event_internal::Builder;
|
3558 + | }
|
3559 + | impl HeadersAndExplicitPayloadEvent {
|
3560 + | /// Creates a new builder-style object to manufacture [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
3561 + | pub fn builder() -> crate::model::headers_and_explicit_payload_event::Builder {
|
3562 + | crate::model::headers_and_explicit_payload_event::Builder::default()
|
1704 3563 | }
|
1705 3564 | }
|
1706 3565 |
|
1707 3566 | #[::pyo3::pyclass]
|
1708 - | /// :param salutation typing.Optional\[str\]:
|
3567 + | /// :param header typing.Optional\[str\]:
|
3568 + | /// :param payload typing.Optional\[str\]:
|
1709 3569 | /// :rtype None:
|
1710 3570 | #[allow(missing_docs)] // documentation missing in model
|
1711 3571 | #[derive(
|
1712 3572 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1713 3573 | )]
|
1714 - | pub struct RenamedGreeting {
|
3574 + | pub struct HeadersAndImplicitPayloadEvent {
|
1715 3575 | #[pyo3(get, set)]
|
1716 3576 | /// :type typing.Optional\[str\]:
|
1717 3577 | #[allow(missing_docs)] // documentation missing in model
|
1718 - | pub salutation: ::std::option::Option<::std::string::String>,
|
3578 + | pub header: ::std::option::Option<::std::string::String>,
|
3579 + | #[pyo3(get, set)]
|
3580 + | /// :type typing.Optional\[str\]:
|
3581 + | #[allow(missing_docs)] // documentation missing in model
|
3582 + | pub payload: ::std::option::Option<::std::string::String>,
|
1719 3583 | }
|
1720 - | impl RenamedGreeting {
|
3584 + | impl HeadersAndImplicitPayloadEvent {
|
1721 3585 | #[allow(missing_docs)] // documentation missing in model
|
1722 - | pub fn salutation(&self) -> ::std::option::Option<&str> {
|
1723 - | self.salutation.as_deref()
|
3586 + | pub fn header(&self) -> ::std::option::Option<&str> {
|
3587 + | self.header.as_deref()
|
3588 + | }
|
3589 + | #[allow(missing_docs)] // documentation missing in model
|
3590 + | pub fn payload(&self) -> ::std::option::Option<&str> {
|
3591 + | self.payload.as_deref()
|
1724 3592 | }
|
1725 3593 | }
|
1726 3594 | #[allow(clippy::new_without_default)]
|
1727 3595 | #[allow(clippy::too_many_arguments)]
|
1728 3596 | #[::pyo3::pymethods]
|
1729 - | impl RenamedGreeting {
|
3597 + | impl HeadersAndImplicitPayloadEvent {
|
1730 3598 | #[new]
|
1731 - | pub fn new(salutation: ::std::option::Option<::std::string::String>) -> Self {
|
1732 - | Self { salutation }
|
3599 + | pub fn new(
|
3600 + | header: ::std::option::Option<::std::string::String>,
|
3601 + | payload: ::std::option::Option<::std::string::String>,
|
3602 + | ) -> Self {
|
3603 + | Self { header, payload }
|
1733 3604 | }
|
1734 3605 | fn __repr__(&self) -> String {
|
1735 3606 | format!("{self:?}")
|
1736 3607 | }
|
1737 3608 | fn __str__(&self) -> String {
|
1738 3609 | format!("{self:?}")
|
1739 3610 | }
|
1740 3611 | }
|
1741 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RenamedGreeting> {
|
3612 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<HeadersAndImplicitPayloadEvent> {
|
1742 3613 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1743 - | ob.extract::<RenamedGreeting>().map(Box::new)
|
3614 + | ob.extract::<HeadersAndImplicitPayloadEvent>().map(Box::new)
|
1744 3615 | }
|
1745 3616 | }
|
1746 3617 |
|
1747 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RenamedGreeting> {
|
3618 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<HeadersAndImplicitPayloadEvent> {
|
1748 3619 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1749 3620 | (*self).into_py(py)
|
1750 3621 | }
|
1751 3622 | }
|
1752 - | impl crate::constrained::Constrained for crate::model::RenamedGreeting {
|
1753 - | type Unconstrained = crate::model::renamed_greeting_internal::Builder;
|
3623 + | impl crate::constrained::Constrained for crate::model::HeadersAndImplicitPayloadEvent {
|
3624 + | type Unconstrained = crate::model::headers_and_implicit_payload_event_internal::Builder;
|
1754 3625 | }
|
1755 - | impl RenamedGreeting {
|
1756 - | /// Creates a new builder-style object to manufacture [`RenamedGreeting`](crate::model::RenamedGreeting).
|
1757 - | pub fn builder() -> crate::model::renamed_greeting::Builder {
|
1758 - | crate::model::renamed_greeting::Builder::default()
|
3626 + | impl HeadersAndImplicitPayloadEvent {
|
3627 + | /// Creates a new builder-style object to manufacture [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
3628 + | pub fn builder() -> crate::model::headers_and_implicit_payload_event::Builder {
|
3629 + | crate::model::headers_and_implicit_payload_event::Builder::default()
|
1759 3630 | }
|
1760 3631 | }
|
1761 3632 |
|
1762 3633 | #[::pyo3::pyclass]
|
1763 - | /// :param hi typing.Optional\[str\]:
|
3634 + | /// :param value typing.Optional\[str\]:
|
1764 3635 | /// :rtype None:
|
1765 3636 | #[allow(missing_docs)] // documentation missing in model
|
1766 3637 | #[derive(
|
1767 3638 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1768 3639 | )]
|
1769 - | pub struct GreetingStruct {
|
3640 + | pub struct SingletonEvent {
|
1770 3641 | #[pyo3(get, set)]
|
1771 3642 | /// :type typing.Optional\[str\]:
|
1772 3643 | #[allow(missing_docs)] // documentation missing in model
|
1773 - | pub hi: ::std::option::Option<::std::string::String>,
|
3644 + | pub value: ::std::option::Option<::std::string::String>,
|
1774 3645 | }
|
1775 - | impl GreetingStruct {
|
3646 + | impl SingletonEvent {
|
1776 3647 | #[allow(missing_docs)] // documentation missing in model
|
1777 - | pub fn hi(&self) -> ::std::option::Option<&str> {
|
1778 - | self.hi.as_deref()
|
3648 + | pub fn value(&self) -> ::std::option::Option<&str> {
|
3649 + | self.value.as_deref()
|
1779 3650 | }
|
1780 3651 | }
|
1781 3652 | #[allow(clippy::new_without_default)]
|
1782 3653 | #[allow(clippy::too_many_arguments)]
|
1783 3654 | #[::pyo3::pymethods]
|
1784 - | impl GreetingStruct {
|
3655 + | impl SingletonEvent {
|
1785 3656 | #[new]
|
1786 - | pub fn new(hi: ::std::option::Option<::std::string::String>) -> Self {
|
1787 - | Self { hi }
|
3657 + | pub fn new(value: ::std::option::Option<::std::string::String>) -> Self {
|
3658 + | Self { value }
|
1788 3659 | }
|
1789 3660 | fn __repr__(&self) -> String {
|
1790 3661 | format!("{self:?}")
|
1791 3662 | }
|
1792 3663 | fn __str__(&self) -> String {
|
1793 3664 | format!("{self:?}")
|
1794 3665 | }
|
1795 3666 | }
|
1796 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<GreetingStruct> {
|
3667 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<SingletonEvent> {
|
1797 3668 | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
1798 - | ob.extract::<GreetingStruct>().map(Box::new)
|
3669 + | ob.extract::<SingletonEvent>().map(Box::new)
|
1799 3670 | }
|
1800 3671 | }
|
1801 3672 |
|
1802 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<GreetingStruct> {
|
3673 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<SingletonEvent> {
|
1803 3674 | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
1804 3675 | (*self).into_py(py)
|
1805 3676 | }
|
1806 3677 | }
|
1807 - | impl crate::constrained::Constrained for crate::model::GreetingStruct {
|
1808 - | type Unconstrained = crate::model::greeting_struct_internal::Builder;
|
1809 - | }
|
1810 - | impl GreetingStruct {
|
1811 - | /// Creates a new builder-style object to manufacture [`GreetingStruct`](crate::model::GreetingStruct).
|
1812 - | pub fn builder() -> crate::model::greeting_struct::Builder {
|
1813 - | crate::model::greeting_struct::Builder::default()
|
3678 + | impl SingletonEvent {
|
3679 + | /// Creates a new builder-style object to manufacture [`SingletonEvent`](crate::model::SingletonEvent).
|
3680 + | pub fn builder() -> crate::model::singleton_event::Builder {
|
3681 + | crate::model::singleton_event::Builder::default()
|
1814 3682 | }
|
1815 3683 | }
|
1816 3684 |
|
1817 3685 | #[::pyo3::pyclass]
|
3686 + | /// :param structure_member typing.Optional\[str\]:
|
3687 + | /// :rtype None:
|
1818 3688 | #[allow(missing_docs)] // documentation missing in model
|
1819 3689 | #[derive(
|
1820 - | ::std::clone::Clone,
|
1821 - | ::std::cmp::Eq,
|
1822 - | ::std::cmp::Ord,
|
1823 - | ::std::cmp::PartialEq,
|
1824 - | ::std::cmp::PartialOrd,
|
1825 - | ::std::fmt::Debug,
|
1826 - | ::std::hash::Hash,
|
3690 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1827 3691 | )]
|
1828 - | pub enum FooEnum {
|
1829 - | #[allow(missing_docs)] // documentation missing in model
|
1830 - | Zero,
|
1831 - | #[allow(missing_docs)] // documentation missing in model
|
1832 - | One,
|
3692 + | pub struct PayloadStructure {
|
3693 + | #[pyo3(get, set)]
|
3694 + | /// :type typing.Optional\[str\]:
|
1833 3695 | #[allow(missing_docs)] // documentation missing in model
|
1834 - | Bar,
|
3696 + | pub structure_member: ::std::option::Option<::std::string::String>,
|
3697 + | }
|
3698 + | impl PayloadStructure {
|
1835 3699 | #[allow(missing_docs)] // documentation missing in model
|
1836 - | Baz,
|
3700 + | pub fn structure_member(&self) -> ::std::option::Option<&str> {
|
3701 + | self.structure_member.as_deref()
|
3702 + | }
|
3703 + | }
|
3704 + | #[allow(clippy::new_without_default)]
|
3705 + | #[allow(clippy::too_many_arguments)]
|
3706 + | #[::pyo3::pymethods]
|
3707 + | impl PayloadStructure {
|
3708 + | #[new]
|
3709 + | pub fn new(structure_member: ::std::option::Option<::std::string::String>) -> Self {
|
3710 + | Self { structure_member }
|
3711 + | }
|
3712 + | fn __repr__(&self) -> String {
|
3713 + | format!("{self:?}")
|
3714 + | }
|
3715 + | fn __str__(&self) -> String {
|
3716 + | format!("{self:?}")
|
3717 + | }
|
3718 + | }
|
3719 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<PayloadStructure> {
|
3720 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3721 + | ob.extract::<PayloadStructure>().map(Box::new)
|
3722 + | }
|
3723 + | }
|
3724 + |
|
3725 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<PayloadStructure> {
|
3726 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3727 + | (*self).into_py(py)
|
3728 + | }
|
3729 + | }
|
3730 + | impl crate::constrained::Constrained for crate::model::PayloadStructure {
|
3731 + | type Unconstrained = crate::model::payload_structure_internal::Builder;
|
3732 + | }
|
3733 + | impl PayloadStructure {
|
3734 + | /// Creates a new builder-style object to manufacture [`PayloadStructure`](crate::model::PayloadStructure).
|
3735 + | pub fn builder() -> crate::model::payload_structure::Builder {
|
3736 + | crate::model::payload_structure::Builder::default()
|
3737 + | }
|
3738 + | }
|
3739 + |
|
3740 + | #[allow(missing_docs)] // documentation missing in model
|
3741 + | #[derive(
|
3742 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3743 + | )]
|
3744 + | pub enum PayloadUnion {
|
1837 3745 | #[allow(missing_docs)] // documentation missing in model
|
1838 - | Foo,
|
3746 + | UnionMember(::std::string::String),
|
1839 3747 | }
|
1840 - | pub(crate) mod foo_enum_internal {
|
3748 + | impl PayloadUnion {
|
3749 + | #[allow(irrefutable_let_patterns)]
|
3750 + | /// Tries to convert the enum instance into [`UnionMember`](crate::model::PayloadUnion::UnionMember), extracting the inner [`String`](::std::string::String).
|
3751 + | /// Returns `Err(&Self)` if it can't be converted.
|
3752 + | pub fn as_union_member(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
3753 + | if let PayloadUnion::UnionMember(val) = &self {
|
3754 + | ::std::result::Result::Ok(val)
|
3755 + | } else {
|
3756 + | ::std::result::Result::Err(self)
|
3757 + | }
|
3758 + | }
|
3759 + | /// Returns true if this is a [`UnionMember`](crate::model::PayloadUnion::UnionMember).
|
3760 + | pub fn is_union_member(&self) -> bool {
|
3761 + | self.as_union_member().is_ok()
|
3762 + | }
|
3763 + | }
|
3764 + | #[pyo3::pyclass(name = "PayloadUnion")]
|
3765 + | #[derive(
|
3766 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
3767 + | )]
|
3768 + | pub struct PyUnionMarkerPayloadUnion(pub PayloadUnion);
|
3769 + | #[::pyo3::pymethods]
|
3770 + | impl PyUnionMarkerPayloadUnion {
|
3771 + | #[allow(irrefutable_let_patterns)]
|
3772 + | #[staticmethod]
|
3773 + | /// Creates a new union instance of [`UnionMember`](crate::model::PayloadUnion::UnionMember)
|
3774 + | /// :param data str:
|
3775 + | /// :rtype PayloadUnion:
|
3776 + | pub fn union_member(data: ::std::string::String) -> Self {
|
3777 + | Self(PayloadUnion::UnionMember(data))
|
3778 + | }
|
3779 + | /// Tries to convert the enum instance into [`UnionMember`](crate::model::PayloadUnion::UnionMember), extracting the inner [`String`](::std::string::String).
|
3780 + | /// :rtype str:
|
3781 + | pub fn as_union_member(&self) -> ::pyo3::PyResult<::std::string::String> {
|
3782 + | match self.0.as_union_member() {
|
3783 + | Ok(variant) => Ok(variant.clone()),
|
3784 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
3785 + | r"PayloadUnion variant is not of type str",
|
3786 + | )),
|
3787 + | }
|
3788 + | }
|
3789 + | /// Returns true if this is a [`UnionMember`](crate::model::PayloadUnion::UnionMember).
|
3790 + | /// :rtype bool:
|
3791 + | pub fn is_union_member(&self) -> bool {
|
3792 + | self.0.is_union_member()
|
3793 + | }
|
3794 + | }
|
3795 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for PayloadUnion {
|
3796 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
3797 + | PyUnionMarkerPayloadUnion(self).into_py(py)
|
3798 + | }
|
3799 + | }
|
3800 + | impl<'source> ::pyo3::FromPyObject<'source> for PayloadUnion {
|
3801 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
3802 + | let data: PyUnionMarkerPayloadUnion = obj.extract()?;
|
3803 + | Ok(data.0)
|
3804 + | }
|
3805 + | }
|
3806 + | pub(crate) mod string_set_internal {
|
3807 + |
|
3808 + | #[allow(clippy::enum_variant_names)]
|
1841 3809 | #[derive(Debug, PartialEq)]
|
1842 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
3810 + | pub(crate) enum ConstraintViolation {
|
3811 + | /// Constraint violation error when the list does not contain unique items
|
3812 + | UniqueItems {
|
3813 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3814 + | /// at least two elements.
|
3815 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3816 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3817 + | /// Nothing is guaranteed about the order of the indices.
|
3818 + | duplicate_indices: ::std::vec::Vec<usize>,
|
3819 + | /// The original vector, that contains duplicate items.
|
3820 + | original: ::std::vec::Vec<::std::string::String>,
|
3821 + | },
|
3822 + | }
|
3823 + |
|
3824 + | impl ::std::fmt::Display for ConstraintViolation {
|
3825 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3826 + | let message = match self {
|
3827 + | Self::UniqueItems { duplicate_indices, .. } =>
|
3828 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#StringSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3829 + | };
|
3830 + | write!(f, "{message}")
|
3831 + | }
|
3832 + | }
|
3833 + |
|
3834 + | impl ::std::error::Error for ConstraintViolation {}
|
3835 + | impl ConstraintViolation {
|
3836 + | pub(crate) fn as_validation_exception_field(
|
3837 + | self,
|
3838 + | path: ::std::string::String,
|
3839 + | ) -> crate::model::ValidationExceptionField {
|
3840 + | match self {
|
3841 + | Self::UniqueItems { duplicate_indices, .. } =>
|
3842 + | crate::model::ValidationExceptionField {
|
3843 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
3844 + | path,
|
3845 + | },
|
3846 + | }
|
3847 + | }
|
3848 + | }
|
3849 + | }
|
3850 + | pub(crate) mod foo_enum_list_internal {
|
3851 + |
|
3852 + | #[allow(clippy::enum_variant_names)]
|
3853 + | #[derive(Debug, PartialEq)]
|
3854 + | pub(crate) enum ConstraintViolation {
|
3855 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
3856 + | /// The first component of the tuple is the index in the collection where the
|
3857 + | /// first constraint violation was found.
|
3858 + | #[doc(hidden)]
|
3859 + | Member(usize, crate::model::foo_enum_internal::ConstraintViolation),
|
3860 + | }
|
3861 + |
|
3862 + | impl ::std::fmt::Display for ConstraintViolation {
|
3863 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3864 + | let message = match self {
|
3865 + | Self::Member(index, failing_member) => format!(
|
3866 + | "Value at index {index} failed to satisfy constraint. {}",
|
3867 + | failing_member
|
3868 + | ),
|
3869 + | };
|
3870 + | write!(f, "{message}")
|
3871 + | }
|
3872 + | }
|
3873 + |
|
3874 + | impl ::std::error::Error for ConstraintViolation {}
|
3875 + | impl ConstraintViolation {
|
3876 + | pub(crate) fn as_validation_exception_field(
|
3877 + | self,
|
3878 + | path: ::std::string::String,
|
3879 + | ) -> crate::model::ValidationExceptionField {
|
3880 + | match self {
|
3881 + | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
3882 + | .as_validation_exception_field(path + "/" + &index.to_string()),
|
3883 + | }
|
3884 + | }
|
3885 + | }
|
3886 + | }
|
3887 + | pub(crate) mod integer_set_internal {
|
3888 + |
|
3889 + | #[allow(clippy::enum_variant_names)]
|
3890 + | #[derive(Debug, PartialEq)]
|
3891 + | pub(crate) enum ConstraintViolation {
|
3892 + | /// Constraint violation error when the list does not contain unique items
|
3893 + | UniqueItems {
|
3894 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
3895 + | /// at least two elements.
|
3896 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
3897 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
3898 + | /// Nothing is guaranteed about the order of the indices.
|
3899 + | duplicate_indices: ::std::vec::Vec<usize>,
|
3900 + | /// The original vector, that contains duplicate items.
|
3901 + | original: ::std::vec::Vec<i32>,
|
3902 + | },
|
3903 + | }
|
1843 3904 |
|
1844 3905 | impl ::std::fmt::Display for ConstraintViolation {
|
1845 3906 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
1846 - | write!(
|
1847 - | f,
|
1848 - | r#"Value provided for 'aws.protocoltests.shared#FooEnum' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#
|
1849 - | )
|
3907 + | let message = match self {
|
3908 + | Self::UniqueItems { duplicate_indices, .. } =>
|
3909 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
3910 + | };
|
3911 + | write!(f, "{message}")
|
1850 3912 | }
|
1851 3913 | }
|
1852 3914 |
|
1853 3915 | impl ::std::error::Error for ConstraintViolation {}
|
1854 3916 | impl ConstraintViolation {
|
1855 3917 | pub(crate) fn as_validation_exception_field(
|
1856 3918 | self,
|
1857 3919 | path: ::std::string::String,
|
1858 3920 | ) -> crate::model::ValidationExceptionField {
|
3921 + | match self {
|
3922 + | Self::UniqueItems { duplicate_indices, .. } =>
|
1859 3923 | crate::model::ValidationExceptionField {
|
1860 - | message: format!(
|
1861 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Foo, Baz, Bar, 1, 0]"#,
|
1862 - | &path
|
1863 - | ),
|
3924 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
1864 3925 | path,
|
3926 + | },
|
1865 3927 | }
|
1866 3928 | }
|
1867 3929 | }
|
1868 3930 | }
|
1869 - | impl ::std::convert::TryFrom<&str> for FooEnum {
|
1870 - | type Error = crate::model::foo_enum_internal::ConstraintViolation;
|
1871 - | fn try_from(
|
1872 - | s: &str,
|
1873 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
1874 - | match s {
|
1875 - | "0" => Ok(FooEnum::Zero),
|
1876 - | "1" => Ok(FooEnum::One),
|
1877 - | "Bar" => Ok(FooEnum::Bar),
|
1878 - | "Baz" => Ok(FooEnum::Baz),
|
1879 - | "Foo" => Ok(FooEnum::Foo),
|
1880 - | _ => Err(crate::model::foo_enum_internal::ConstraintViolation(
|
1881 - | s.to_owned(),
|
1882 - | )),
|
3931 + | /// See [`NestedPayload`](crate::model::NestedPayload).
|
3932 + | pub(crate) mod nested_payload_internal {
|
3933 + |
|
3934 + | impl ::std::convert::From<Builder> for crate::model::NestedPayload {
|
3935 + | fn from(builder: Builder) -> Self {
|
3936 + | builder.build()
|
1883 3937 | }
|
1884 3938 | }
|
1885 - | }
|
1886 - | impl ::std::convert::TryFrom<::std::string::String> for FooEnum {
|
1887 - | type Error = crate::model::foo_enum_internal::ConstraintViolation;
|
1888 - | fn try_from(
|
1889 - | s: ::std::string::String,
|
1890 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
1891 - | {
|
1892 - | s.as_str().try_into()
|
3939 + | /// A builder for [`NestedPayload`](crate::model::NestedPayload).
|
3940 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3941 + | pub(crate) struct Builder {
|
3942 + | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
3943 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
1893 3944 | }
|
1894 - | }
|
1895 - | impl std::str::FromStr for FooEnum {
|
1896 - | type Err = crate::model::foo_enum_internal::ConstraintViolation;
|
1897 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
1898 - | Self::try_from(s)
|
3945 + | impl Builder {
|
3946 + | #[allow(missing_docs)] // documentation missing in model
|
3947 + | pub(crate) fn set_greeting(
|
3948 + | mut self,
|
3949 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3950 + | ) -> Self {
|
3951 + | self.greeting = input.map(|v| v.into());
|
3952 + | self
|
1899 3953 | }
|
1900 - | }
|
1901 - | impl FooEnum {
|
1902 - | /// Returns the `&str` value of the enum member.
|
1903 - | pub fn as_str(&self) -> &str {
|
1904 - | match self {
|
1905 - | FooEnum::Zero => "0",
|
1906 - | FooEnum::One => "1",
|
1907 - | FooEnum::Bar => "Bar",
|
1908 - | FooEnum::Baz => "Baz",
|
1909 - | FooEnum::Foo => "Foo",
|
3954 + | #[allow(missing_docs)] // documentation missing in model
|
3955 + | pub(crate) fn set_name(
|
3956 + | mut self,
|
3957 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3958 + | ) -> Self {
|
3959 + | self.name = input.map(|v| v.into());
|
3960 + | self
|
3961 + | }
|
3962 + | /// Consumes the builder and constructs a [`NestedPayload`](crate::model::NestedPayload).
|
3963 + | pub fn build(self) -> crate::model::NestedPayload {
|
3964 + | self.build_enforcing_all_constraints()
|
1910 3965 | }
|
3966 + | fn build_enforcing_all_constraints(self) -> crate::model::NestedPayload {
|
3967 + | crate::model::NestedPayload {
|
3968 + | greeting: self.greeting,
|
3969 + | name: self.name,
|
1911 3970 | }
|
1912 - | /// Returns all the `&str` representations of the enum members.
|
1913 - | pub const fn values() -> &'static [&'static str] {
|
1914 - | &["0", "1", "Bar", "Baz", "Foo"]
|
1915 3971 | }
|
1916 - | }
|
1917 - | impl ::std::convert::AsRef<str> for FooEnum {
|
1918 - | fn as_ref(&self) -> &str {
|
1919 - | self.as_str()
|
1920 3972 | }
|
1921 3973 | }
|
1922 - | #[::pyo3::pymethods]
|
1923 - | impl FooEnum {
|
1924 - | #[getter]
|
1925 - | pub fn name(&self) -> &str {
|
1926 - | match self {
|
1927 - | FooEnum::Zero => "Zero",
|
1928 - | FooEnum::One => "One",
|
1929 - | FooEnum::Bar => "Bar",
|
1930 - | FooEnum::Baz => "Baz",
|
1931 - | FooEnum::Foo => "Foo",
|
3974 + | /// See [`NestedPayload`](crate::model::NestedPayload).
|
3975 + | pub mod nested_payload {
|
3976 + |
|
3977 + | impl ::std::convert::From<Builder> for crate::model::NestedPayload {
|
3978 + | fn from(builder: Builder) -> Self {
|
3979 + | builder.build()
|
1932 3980 | }
|
1933 3981 | }
|
1934 - | #[getter]
|
1935 - | pub fn value(&self) -> &str {
|
1936 - | self.as_str()
|
3982 + | /// A builder for [`NestedPayload`](crate::model::NestedPayload).
|
3983 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3984 + | pub struct Builder {
|
3985 + | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
3986 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
1937 3987 | }
|
1938 - | fn __repr__(&self) -> String {
|
1939 - | self.as_str().to_owned()
|
3988 + | impl Builder {
|
3989 + | #[allow(missing_docs)] // documentation missing in model
|
3990 + | pub fn greeting(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
3991 + | self.greeting = input;
|
3992 + | self
|
3993 + | }
|
3994 + | #[allow(missing_docs)] // documentation missing in model
|
3995 + | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
3996 + | self.name = input;
|
3997 + | self
|
3998 + | }
|
3999 + | /// Consumes the builder and constructs a [`NestedPayload`](crate::model::NestedPayload).
|
4000 + | pub fn build(self) -> crate::model::NestedPayload {
|
4001 + | self.build_enforcing_required_and_enum_traits()
|
4002 + | }
|
4003 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::NestedPayload {
|
4004 + | crate::model::NestedPayload {
|
4005 + | greeting: self.greeting,
|
4006 + | name: self.name,
|
1940 4007 | }
|
1941 - | fn __str__(&self) -> String {
|
1942 - | self.as_str().to_owned()
|
1943 4008 | }
|
1944 - | }
|
1945 - | impl crate::constrained::Constrained for FooEnum {
|
1946 - | type Unconstrained = ::std::string::String;
|
1947 - | }
|
1948 - |
|
1949 - | impl ::std::convert::From<::std::string::String>
|
1950 - | for crate::constrained::MaybeConstrained<crate::model::FooEnum>
|
1951 - | {
|
1952 - | fn from(value: ::std::string::String) -> Self {
|
1953 - | Self::Unconstrained(value)
|
1954 4009 | }
|
1955 4010 | }
|
4011 + | /// See [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
4012 + | pub mod complex_nested_error_data {
|
1956 4013 |
|
1957 - | #[allow(missing_docs)] // documentation missing in model
|
1958 - | ///
|
1959 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
1960 - | /// [constraint traits]. Use [`StringSet::try_from`] to construct values of this type.
|
1961 - | ///
|
1962 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
1963 - | ///
|
1964 - | #[derive(
|
1965 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
1966 - | )]
|
1967 - | pub(crate) struct StringSet(pub(crate) ::std::vec::Vec<::std::string::String>);
|
1968 - | impl StringSet {
|
1969 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<::std::string::String>`].
|
1970 - | pub fn into_inner(self) -> ::std::vec::Vec<::std::string::String> {
|
1971 - | self.0
|
4014 + | impl ::std::convert::From<Builder> for crate::model::ComplexNestedErrorData {
|
4015 + | fn from(builder: Builder) -> Self {
|
4016 + | builder.build()
|
1972 4017 | }
|
1973 - |
|
1974 - | fn check_unique_items(
|
1975 - | items: ::std::vec::Vec<::std::string::String>,
|
1976 - | ) -> ::std::result::Result<
|
1977 - | ::std::vec::Vec<::std::string::String>,
|
1978 - | crate::model::string_set_internal::ConstraintViolation,
|
1979 - | > {
|
1980 - | let mut seen = ::std::collections::HashMap::new();
|
1981 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
1982 - | for (idx, item) in items.iter().enumerate() {
|
1983 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
1984 - | duplicate_indices.push(prev_idx);
|
1985 4018 | }
|
4019 + | /// A builder for [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
4020 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4021 + | pub struct Builder {
|
4022 + | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
1986 4023 | }
|
1987 - |
|
1988 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
1989 - | for idx in &duplicate_indices {
|
1990 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
1991 - | last_duplicate_indices.push(prev_idx);
|
4024 + | impl Builder {
|
4025 + | #[allow(missing_docs)] // documentation missing in model
|
4026 + | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4027 + | self.foo = input;
|
4028 + | self
|
1992 4029 | }
|
4030 + | /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
4031 + | pub fn build(self) -> crate::model::ComplexNestedErrorData {
|
4032 + | self.build_enforcing_required_and_enum_traits()
|
1993 4033 | }
|
1994 - | duplicate_indices.extend(last_duplicate_indices);
|
4034 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::ComplexNestedErrorData {
|
4035 + | crate::model::ComplexNestedErrorData { foo: self.foo }
|
4036 + | }
|
4037 + | }
|
4038 + | }
|
4039 + | pub(crate) mod foo_enum_set_internal {
|
1995 4040 |
|
1996 - | if !duplicate_indices.is_empty() {
|
1997 - | debug_assert!(duplicate_indices.len() >= 2);
|
1998 - | Err(
|
1999 - | crate::model::string_set_internal::ConstraintViolation::UniqueItems {
|
2000 - | duplicate_indices,
|
2001 - | original: items,
|
4041 + | #[allow(clippy::enum_variant_names)]
|
4042 + | #[derive(Debug, PartialEq)]
|
4043 + | pub(crate) enum ConstraintViolation {
|
4044 + | /// Constraint violation error when the list does not contain unique items
|
4045 + | UniqueItems {
|
4046 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4047 + | /// at least two elements.
|
4048 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4049 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4050 + | /// Nothing is guaranteed about the order of the indices.
|
4051 + | duplicate_indices: ::std::vec::Vec<usize>,
|
4052 + | /// The original vector, that contains duplicate items.
|
4053 + | original: ::std::vec::Vec<crate::model::FooEnum>,
|
2002 4054 | },
|
2003 - | )
|
2004 - | } else {
|
2005 - | Ok(items)
|
4055 + | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4056 + | /// The first component of the tuple is the index in the collection where the
|
4057 + | /// first constraint violation was found.
|
4058 + | #[doc(hidden)]
|
4059 + | Member(usize, crate::model::foo_enum_internal::ConstraintViolation),
|
4060 + | }
|
4061 + |
|
4062 + | impl ::std::fmt::Display for ConstraintViolation {
|
4063 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4064 + | let message = match self {
|
4065 + | Self::UniqueItems { duplicate_indices, .. } =>
|
4066 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#FooEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4067 + | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
4068 + | failing_member)
|
4069 + | };
|
4070 + | write!(f, "{message}")
|
2006 4071 | }
|
2007 4072 | }
|
2008 - | }
|
2009 - | impl ::std::convert::TryFrom<::std::vec::Vec<::std::string::String>> for StringSet {
|
2010 - | type Error = crate::model::string_set_internal::ConstraintViolation;
|
2011 - |
|
2012 - | /// Constructs a `StringSet` from an [`::std::vec::Vec<::std::string::String>`], failing when the provided value does not satisfy the modeled constraints.
|
2013 - | fn try_from(
|
2014 - | value: ::std::vec::Vec<::std::string::String>,
|
2015 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2016 - | let value = Self::check_unique_items(value)?;
|
2017 4073 |
|
2018 - | Ok(Self(value))
|
4074 + | impl ::std::error::Error for ConstraintViolation {}
|
4075 + | impl ConstraintViolation {
|
4076 + | pub(crate) fn as_validation_exception_field(
|
4077 + | self,
|
4078 + | path: ::std::string::String,
|
4079 + | ) -> crate::model::ValidationExceptionField {
|
4080 + | match self {
|
4081 + | Self::UniqueItems { duplicate_indices, .. } =>
|
4082 + | crate::model::ValidationExceptionField {
|
4083 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4084 + | path,
|
4085 + | },
|
4086 + | Self::Member(index, member_constraint_violation) =>
|
4087 + | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
4088 + | }
|
2019 4089 | }
|
2020 - | }
|
2021 - |
|
2022 - | impl ::std::convert::From<StringSet> for ::std::vec::Vec<::std::string::String> {
|
2023 - | fn from(value: StringSet) -> Self {
|
2024 - | value.into_inner()
|
2025 4090 | }
|
2026 4091 | }
|
2027 - | impl crate::constrained::Constrained for StringSet {
|
2028 - | type Unconstrained = crate::unconstrained::string_set_unconstrained::StringSetUnconstrained;
|
2029 - | }
|
4092 + | pub(crate) mod foo_enum_map_internal {
|
2030 4093 |
|
2031 - | #[::pyo3::pyclass]
|
2032 - | /// :param a typing.Optional\[str\]:
|
2033 - | /// :param b typing.Optional\[str\]:
|
2034 - | /// :rtype None:
|
2035 - | #[allow(missing_docs)] // documentation missing in model
|
2036 - | #[derive(
|
2037 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2038 - | )]
|
2039 - | pub struct StructureListMember {
|
2040 - | #[pyo3(get, set)]
|
2041 - | /// :type typing.Optional\[str\]:
|
2042 - | #[allow(missing_docs)] // documentation missing in model
|
2043 - | pub a: ::std::option::Option<::std::string::String>,
|
2044 - | #[pyo3(get, set)]
|
2045 - | /// :type typing.Optional\[str\]:
|
2046 - | #[allow(missing_docs)] // documentation missing in model
|
2047 - | pub b: ::std::option::Option<::std::string::String>,
|
2048 - | }
|
2049 - | impl StructureListMember {
|
2050 - | #[allow(missing_docs)] // documentation missing in model
|
2051 - | pub fn a(&self) -> ::std::option::Option<&str> {
|
2052 - | self.a.as_deref()
|
2053 - | }
|
2054 - | #[allow(missing_docs)] // documentation missing in model
|
2055 - | pub fn b(&self) -> ::std::option::Option<&str> {
|
2056 - | self.b.as_deref()
|
4094 + | #[allow(clippy::enum_variant_names)]
|
4095 + | #[derive(Debug, PartialEq)]
|
4096 + | pub(crate) enum ConstraintViolation {
|
4097 + | #[doc(hidden)]
|
4098 + | Value(
|
4099 + | ::std::string::String,
|
4100 + | crate::model::foo_enum_internal::ConstraintViolation,
|
4101 + | ),
|
2057 4102 | }
|
2058 - | }
|
2059 - | #[allow(clippy::new_without_default)]
|
2060 - | #[allow(clippy::too_many_arguments)]
|
2061 - | #[::pyo3::pymethods]
|
2062 - | impl StructureListMember {
|
2063 - | #[new]
|
2064 - | pub fn new(
|
2065 - | a: ::std::option::Option<::std::string::String>,
|
2066 - | b: ::std::option::Option<::std::string::String>,
|
2067 - | ) -> Self {
|
2068 - | Self { a, b }
|
4103 + |
|
4104 + | impl ::std::fmt::Display for ConstraintViolation {
|
4105 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4106 + | match self {
|
4107 + | Self::Value(_, value_constraint_violation) => {
|
4108 + | write!(f, "{}", value_constraint_violation)
|
2069 4109 | }
|
2070 - | fn __repr__(&self) -> String {
|
2071 - | format!("{self:?}")
|
2072 4110 | }
|
2073 - | fn __str__(&self) -> String {
|
2074 - | format!("{self:?}")
|
2075 4111 | }
|
2076 - | }
|
2077 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<StructureListMember> {
|
2078 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2079 - | ob.extract::<StructureListMember>().map(Box::new)
|
2080 4112 | }
|
2081 - | }
|
2082 4113 |
|
2083 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<StructureListMember> {
|
2084 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2085 - | (*self).into_py(py)
|
4114 + | impl ::std::error::Error for ConstraintViolation {}
|
4115 + | impl ConstraintViolation {
|
4116 + | pub(crate) fn as_validation_exception_field(
|
4117 + | self,
|
4118 + | path: ::std::string::String,
|
4119 + | ) -> crate::model::ValidationExceptionField {
|
4120 + | match self {
|
4121 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4122 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4123 + | }
|
2086 4124 | }
|
2087 - | }
|
2088 - | impl crate::constrained::Constrained for crate::model::StructureListMember {
|
2089 - | type Unconstrained = crate::model::structure_list_member_internal::Builder;
|
2090 - | }
|
2091 - | impl StructureListMember {
|
2092 - | /// Creates a new builder-style object to manufacture [`StructureListMember`](crate::model::StructureListMember).
|
2093 - | pub fn builder() -> crate::model::structure_list_member::Builder {
|
2094 - | crate::model::structure_list_member::Builder::default()
|
2095 4125 | }
|
2096 4126 | }
|
4127 + | pub(crate) mod integer_enum_set_internal {
|
2097 4128 |
|
2098 - | #[::pyo3::pyclass]
|
2099 - | /// :param foo typing.Optional\[str\]:
|
2100 - | /// :param nested typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested2\]:
|
2101 - | /// :rtype None:
|
2102 - | #[allow(missing_docs)] // documentation missing in model
|
2103 - | #[derive(
|
2104 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2105 - | )]
|
2106 - | pub struct RecursiveShapesInputOutputNested1 {
|
2107 - | #[pyo3(get, set)]
|
2108 - | /// :type typing.Optional\[str\]:
|
2109 - | #[allow(missing_docs)] // documentation missing in model
|
2110 - | pub foo: ::std::option::Option<::std::string::String>,
|
2111 - | #[pyo3(get, set)]
|
2112 - | /// :type typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested2\]:
|
2113 - | #[allow(missing_docs)] // documentation missing in model
|
2114 - | pub nested:
|
2115 - | ::std::option::Option<::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>>,
|
2116 - | }
|
2117 - | impl RecursiveShapesInputOutputNested1 {
|
2118 - | #[allow(missing_docs)] // documentation missing in model
|
2119 - | pub fn foo(&self) -> ::std::option::Option<&str> {
|
2120 - | self.foo.as_deref()
|
4129 + | #[allow(clippy::enum_variant_names)]
|
4130 + | #[derive(Debug, PartialEq)]
|
4131 + | pub(crate) enum ConstraintViolation {
|
4132 + | /// Constraint violation error when the list does not contain unique items
|
4133 + | UniqueItems {
|
4134 + | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4135 + | /// at least two elements.
|
4136 + | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4137 + | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4138 + | /// Nothing is guaranteed about the order of the indices.
|
4139 + | duplicate_indices: ::std::vec::Vec<usize>,
|
4140 + | /// The original vector, that contains duplicate items.
|
4141 + | original: ::std::vec::Vec<i32>,
|
4142 + | },
|
2121 4143 | }
|
2122 - | #[allow(missing_docs)] // documentation missing in model
|
2123 - | pub fn nested(
|
2124 - | &self,
|
2125 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested2> {
|
2126 - | self.nested.as_deref()
|
4144 + |
|
4145 + | impl ::std::fmt::Display for ConstraintViolation {
|
4146 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4147 + | let message = match self {
|
4148 + | Self::UniqueItems { duplicate_indices, .. } =>
|
4149 + | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4150 + | };
|
4151 + | write!(f, "{message}")
|
2127 4152 | }
|
2128 - | }
|
2129 - | #[allow(clippy::new_without_default)]
|
2130 - | #[allow(clippy::too_many_arguments)]
|
2131 - | #[::pyo3::pymethods]
|
2132 - | impl RecursiveShapesInputOutputNested1 {
|
2133 - | #[new]
|
2134 - | pub fn new(
|
2135 - | foo: ::std::option::Option<::std::string::String>,
|
2136 - | nested: ::std::option::Option<
|
2137 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
2138 - | >,
|
2139 - | ) -> Self {
|
2140 - | Self { foo, nested }
|
2141 4153 | }
|
2142 - | fn __repr__(&self) -> String {
|
2143 - | format!("{self:?}")
|
4154 + |
|
4155 + | impl ::std::error::Error for ConstraintViolation {}
|
4156 + | impl ConstraintViolation {
|
4157 + | pub(crate) fn as_validation_exception_field(
|
4158 + | self,
|
4159 + | path: ::std::string::String,
|
4160 + | ) -> crate::model::ValidationExceptionField {
|
4161 + | match self {
|
4162 + | Self::UniqueItems { duplicate_indices, .. } =>
|
4163 + | crate::model::ValidationExceptionField {
|
4164 + | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4165 + | path,
|
4166 + | },
|
2144 4167 | }
|
2145 - | fn __str__(&self) -> String {
|
2146 - | format!("{self:?}")
|
2147 4168 | }
|
2148 - | }
|
2149 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
2150 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2151 - | ob.extract::<RecursiveShapesInputOutputNested1>()
|
2152 - | .map(Box::new)
|
2153 4169 | }
|
2154 4170 | }
|
4171 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4172 + | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
2155 4173 |
|
2156 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested1> {
|
2157 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2158 - | (*self).into_py(py)
|
4174 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
4175 + | fn from(builder: Builder) -> Self {
|
4176 + | builder.build()
|
2159 4177 | }
|
2160 - | }
|
2161 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested1 {
|
2162 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested1_internal::Builder;
|
2163 - | }
|
2164 - | impl RecursiveShapesInputOutputNested1 {
|
2165 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
2166 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested1::Builder {
|
2167 - | crate::model::recursive_shapes_input_output_nested1::Builder::default()
|
2168 4178 | }
|
2169 - | }
|
2170 - |
|
2171 - | #[::pyo3::pyclass]
|
2172 - | /// :param bar typing.Optional\[str\]:
|
2173 - | /// :param recursive_member typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested1\]:
|
2174 - | /// :rtype None:
|
2175 - | #[allow(missing_docs)] // documentation missing in model
|
2176 - | #[derive(
|
2177 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2178 - | )]
|
2179 - | pub struct RecursiveShapesInputOutputNested2 {
|
2180 - | #[pyo3(get, set)]
|
2181 - | /// :type typing.Optional\[str\]:
|
2182 - | #[allow(missing_docs)] // documentation missing in model
|
2183 - | pub bar: ::std::option::Option<::std::string::String>,
|
2184 - | #[pyo3(get, set)]
|
2185 - | /// :type typing.Optional\[rest_json.model.RecursiveShapesInputOutputNested1\]:
|
2186 - | #[allow(missing_docs)] // documentation missing in model
|
2187 - | pub recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
2188 - | }
|
2189 - | impl RecursiveShapesInputOutputNested2 {
|
4179 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4180 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4181 + | pub(crate) struct Builder {
|
4182 + | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
4183 + | pub(crate) nested: ::std::option::Option<
|
4184 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4185 + | >,
|
4186 + | }
|
4187 + | impl Builder {
|
2190 4188 | #[allow(missing_docs)] // documentation missing in model
|
2191 - | pub fn bar(&self) -> ::std::option::Option<&str> {
|
2192 - | self.bar.as_deref()
|
4189 + | pub(crate) fn set_foo(
|
4190 + | mut self,
|
4191 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4192 + | ) -> Self {
|
4193 + | self.foo = input.map(|v| v.into());
|
4194 + | self
|
2193 4195 | }
|
2194 4196 | #[allow(missing_docs)] // documentation missing in model
|
2195 - | pub fn recursive_member(
|
2196 - | &self,
|
2197 - | ) -> ::std::option::Option<&crate::model::RecursiveShapesInputOutputNested1> {
|
2198 - | self.recursive_member.as_ref()
|
2199 - | }
|
2200 - | }
|
2201 - | #[allow(clippy::new_without_default)]
|
2202 - | #[allow(clippy::too_many_arguments)]
|
2203 - | #[::pyo3::pymethods]
|
2204 - | impl RecursiveShapesInputOutputNested2 {
|
2205 - | #[new]
|
2206 - | pub fn new(
|
2207 - | bar: ::std::option::Option<::std::string::String>,
|
2208 - | recursive_member: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
4197 + | pub(crate) fn set_nested(
|
4198 + | mut self,
|
4199 + | input: Option<
|
4200 + | impl ::std::convert::Into<
|
4201 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4202 + | >,
|
4203 + | >,
|
2209 4204 | ) -> Self {
|
2210 - | Self {
|
2211 - | bar,
|
2212 - | recursive_member,
|
4205 + | self.nested = input.map(|v| v.into());
|
4206 + | self
|
2213 4207 | }
|
4208 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4209 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4210 + | self.build_enforcing_all_constraints()
|
2214 4211 | }
|
2215 - | fn __repr__(&self) -> String {
|
2216 - | format!("{self:?}")
|
4212 + | fn build_enforcing_all_constraints(
|
4213 + | self,
|
4214 + | ) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4215 + | crate::model::RecursiveShapesInputOutputNested1 {
|
4216 + | foo: self.foo,
|
4217 + | nested: self.nested,
|
2217 4218 | }
|
2218 - | fn __str__(&self) -> String {
|
2219 - | format!("{self:?}")
|
2220 4219 | }
|
2221 - | }
|
2222 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
2223 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2224 - | ob.extract::<RecursiveShapesInputOutputNested2>()
|
2225 - | .map(Box::new)
|
2226 4220 | }
|
2227 4221 | }
|
4222 + | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4223 + | pub mod recursive_shapes_input_output_nested1 {
|
2228 4224 |
|
2229 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<RecursiveShapesInputOutputNested2> {
|
2230 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2231 - | (*self).into_py(py)
|
4225 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
4226 + | fn from(builder: Builder) -> Self {
|
4227 + | builder.build()
|
2232 4228 | }
|
2233 - | }
|
2234 - | impl crate::constrained::Constrained for crate::model::RecursiveShapesInputOutputNested2 {
|
2235 - | type Unconstrained = crate::model::recursive_shapes_input_output_nested2_internal::Builder;
|
2236 - | }
|
2237 - | impl RecursiveShapesInputOutputNested2 {
|
2238 - | /// Creates a new builder-style object to manufacture [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
2239 - | pub fn builder() -> crate::model::recursive_shapes_input_output_nested2::Builder {
|
2240 - | crate::model::recursive_shapes_input_output_nested2::Builder::default()
|
2241 4229 | }
|
2242 - | }
|
2243 - |
|
2244 - | #[allow(missing_docs)] // documentation missing in model
|
2245 - | ///
|
2246 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2247 - | /// [constraint traits]. Use [`IntegerEnumSet::try_from`] to construct values of this type.
|
2248 - | ///
|
2249 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2250 - | ///
|
2251 - | #[derive(
|
2252 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2253 - | )]
|
2254 - | pub(crate) struct IntegerEnumSet(pub(crate) ::std::vec::Vec<i32>);
|
2255 - | impl IntegerEnumSet {
|
2256 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
2257 - | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
2258 - | self.0
|
4230 + | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4231 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4232 + | pub struct Builder {
|
4233 + | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
4234 + | pub(crate) nested: ::std::option::Option<
|
4235 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4236 + | >,
|
2259 4237 | }
|
2260 - |
|
2261 - | fn check_unique_items(
|
2262 - | items: ::std::vec::Vec<i32>,
|
2263 - | ) -> ::std::result::Result<
|
2264 - | ::std::vec::Vec<i32>,
|
2265 - | crate::model::integer_enum_set_internal::ConstraintViolation,
|
2266 - | > {
|
2267 - | let mut seen = ::std::collections::HashMap::new();
|
2268 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2269 - | for (idx, item) in items.iter().enumerate() {
|
2270 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2271 - | duplicate_indices.push(prev_idx);
|
4238 + | impl Builder {
|
4239 + | #[allow(missing_docs)] // documentation missing in model
|
4240 + | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4241 + | self.foo = input;
|
4242 + | self
|
2272 4243 | }
|
4244 + | #[allow(missing_docs)] // documentation missing in model
|
4245 + | pub fn nested(
|
4246 + | mut self,
|
4247 + | input: ::std::option::Option<
|
4248 + | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4249 + | >,
|
4250 + | ) -> Self {
|
4251 + | self.nested = input;
|
4252 + | self
|
2273 4253 | }
|
2274 - |
|
2275 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2276 - | for idx in &duplicate_indices {
|
2277 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2278 - | last_duplicate_indices.push(prev_idx);
|
4254 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4255 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4256 + | self.build_enforcing_required_and_enum_traits()
|
2279 4257 | }
|
4258 + | fn build_enforcing_required_and_enum_traits(
|
4259 + | self,
|
4260 + | ) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4261 + | crate::model::RecursiveShapesInputOutputNested1 {
|
4262 + | foo: self.foo,
|
4263 + | nested: self.nested,
|
2280 4264 | }
|
2281 - | duplicate_indices.extend(last_duplicate_indices);
|
2282 - |
|
2283 - | if !duplicate_indices.is_empty() {
|
2284 - | debug_assert!(duplicate_indices.len() >= 2);
|
2285 - | Err(
|
2286 - | crate::model::integer_enum_set_internal::ConstraintViolation::UniqueItems {
|
2287 - | duplicate_indices,
|
2288 - | original: items,
|
2289 - | },
|
2290 - | )
|
2291 - | } else {
|
2292 - | Ok(items)
|
2293 4265 | }
|
2294 4266 | }
|
2295 4267 | }
|
2296 - | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerEnumSet {
|
2297 - | type Error = crate::model::integer_enum_set_internal::ConstraintViolation;
|
4268 + | pub(crate) mod dense_set_map_internal {
|
2298 4269 |
|
2299 - | /// Constructs a `IntegerEnumSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
2300 - | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
2301 - | let value = Self::check_unique_items(value)?;
|
4270 + | #[allow(clippy::enum_variant_names)]
|
4271 + | #[derive(Debug, PartialEq)]
|
4272 + | pub(crate) enum ConstraintViolation {
|
4273 + | #[doc(hidden)]
|
4274 + | Value(
|
4275 + | ::std::string::String,
|
4276 + | crate::model::string_set_internal::ConstraintViolation,
|
4277 + | ),
|
4278 + | }
|
2302 4279 |
|
2303 - | Ok(Self(value))
|
4280 + | impl ::std::fmt::Display for ConstraintViolation {
|
4281 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4282 + | match self {
|
4283 + | Self::Value(_, value_constraint_violation) => {
|
4284 + | write!(f, "{}", value_constraint_violation)
|
4285 + | }
|
4286 + | }
|
4287 + | }
|
2304 4288 | }
|
2305 - | }
|
2306 4289 |
|
2307 - | impl ::std::convert::From<IntegerEnumSet> for ::std::vec::Vec<i32> {
|
2308 - | fn from(value: IntegerEnumSet) -> Self {
|
2309 - | value.into_inner()
|
4290 + | impl ::std::error::Error for ConstraintViolation {}
|
4291 + | impl ConstraintViolation {
|
4292 + | pub(crate) fn as_validation_exception_field(
|
4293 + | self,
|
4294 + | path: ::std::string::String,
|
4295 + | ) -> crate::model::ValidationExceptionField {
|
4296 + | match self {
|
4297 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4298 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
4299 + | }
|
4300 + | }
|
2310 4301 | }
|
2311 4302 | }
|
2312 - | impl crate::constrained::Constrained for IntegerEnumSet {
|
2313 - | type Unconstrained =
|
2314 - | crate::unconstrained::integer_enum_set_unconstrained::IntegerEnumSetUnconstrained;
|
2315 - | }
|
4303 + | pub(crate) mod sparse_set_map_internal {
|
2316 4304 |
|
2317 - | #[allow(missing_docs)] // documentation missing in model
|
2318 - | ///
|
2319 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2320 - | /// [constraint traits]. Use [`FooEnumSet::try_from`] to construct values of this type.
|
2321 - | ///
|
2322 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2323 - | ///
|
2324 - | #[derive(
|
2325 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2326 - | )]
|
2327 - | pub(crate) struct FooEnumSet(pub(crate) ::std::vec::Vec<crate::model::FooEnum>);
|
2328 - | impl FooEnumSet {
|
2329 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<crate::model::FooEnum>`].
|
2330 - | pub fn into_inner(self) -> ::std::vec::Vec<crate::model::FooEnum> {
|
2331 - | self.0
|
4305 + | #[allow(clippy::enum_variant_names)]
|
4306 + | #[derive(Debug, PartialEq)]
|
4307 + | pub(crate) enum ConstraintViolation {
|
4308 + | #[doc(hidden)]
|
4309 + | Value(
|
4310 + | ::std::string::String,
|
4311 + | crate::model::string_set_internal::ConstraintViolation,
|
4312 + | ),
|
2332 4313 | }
|
2333 4314 |
|
2334 - | fn check_unique_items(
|
2335 - | items: ::std::vec::Vec<crate::model::FooEnum>,
|
2336 - | ) -> ::std::result::Result<
|
2337 - | ::std::vec::Vec<crate::model::FooEnum>,
|
2338 - | crate::model::foo_enum_set_internal::ConstraintViolation,
|
2339 - | > {
|
2340 - | let mut seen = ::std::collections::HashMap::new();
|
2341 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2342 - | for (idx, item) in items.iter().enumerate() {
|
2343 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2344 - | duplicate_indices.push(prev_idx);
|
4315 + | impl ::std::fmt::Display for ConstraintViolation {
|
4316 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4317 + | match self {
|
4318 + | Self::Value(_, value_constraint_violation) => {
|
4319 + | write!(f, "{}", value_constraint_violation)
|
4320 + | }
|
4321 + | }
|
2345 4322 | }
|
2346 4323 | }
|
2347 4324 |
|
2348 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2349 - | for idx in &duplicate_indices {
|
2350 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2351 - | last_duplicate_indices.push(prev_idx);
|
4325 + | impl ::std::error::Error for ConstraintViolation {}
|
4326 + | impl ConstraintViolation {
|
4327 + | pub(crate) fn as_validation_exception_field(
|
4328 + | self,
|
4329 + | path: ::std::string::String,
|
4330 + | ) -> crate::model::ValidationExceptionField {
|
4331 + | match self {
|
4332 + | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4333 + | .as_validation_exception_field(path + "/" + key.as_str()),
|
2352 4334 | }
|
2353 4335 | }
|
2354 - | duplicate_indices.extend(last_duplicate_indices);
|
4336 + | }
|
4337 + | }
|
4338 + | pub(crate) mod my_union_internal {
|
2355 4339 |
|
2356 - | if !duplicate_indices.is_empty() {
|
2357 - | debug_assert!(duplicate_indices.len() >= 2);
|
2358 - | Err(
|
2359 - | crate::model::foo_enum_set_internal::ConstraintViolation::UniqueItems {
|
2360 - | duplicate_indices,
|
2361 - | original: items,
|
2362 - | },
|
2363 - | )
|
2364 - | } else {
|
2365 - | Ok(items)
|
4340 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4341 + | #[allow(clippy::enum_variant_names)]
|
4342 + | pub(crate) enum ConstraintViolation {
|
4343 + | EnumValue(crate::model::foo_enum_internal::ConstraintViolation),
|
4344 + | }
|
4345 + | impl ::std::fmt::Display for ConstraintViolation {
|
4346 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4347 + | match self {
|
4348 + | Self::EnumValue(inner) => write!(f, "{inner}"),
|
2366 4349 | }
|
2367 4350 | }
|
2368 - | }
|
2369 - | impl ::std::convert::TryFrom<::std::vec::Vec<crate::model::FooEnum>> for FooEnumSet {
|
2370 - | type Error = crate::model::foo_enum_set_internal::ConstraintViolation;
|
2371 - |
|
2372 - | /// Constructs a `FooEnumSet` from an [`::std::vec::Vec<crate::model::FooEnum>`], failing when the provided value does not satisfy the modeled constraints.
|
2373 - | fn try_from(
|
2374 - | value: ::std::vec::Vec<crate::model::FooEnum>,
|
2375 - | ) -> ::std::result::Result<Self, Self::Error> {
|
2376 - | let value = Self::check_unique_items(value)?;
|
2377 - |
|
2378 - | Ok(Self(value))
|
2379 4351 | }
|
2380 - | }
|
2381 4352 |
|
2382 - | impl ::std::convert::From<FooEnumSet> for ::std::vec::Vec<crate::model::FooEnum> {
|
2383 - | fn from(value: FooEnumSet) -> Self {
|
2384 - | value.into_inner()
|
4353 + | impl ::std::error::Error for ConstraintViolation {}
|
4354 + | impl ConstraintViolation {
|
4355 + | pub(crate) fn as_validation_exception_field(
|
4356 + | self,
|
4357 + | path: ::std::string::String,
|
4358 + | ) -> crate::model::ValidationExceptionField {
|
4359 + | match self {
|
4360 + | Self::EnumValue(inner) => inner.as_validation_exception_field(path + "/enumValue"),
|
4361 + | }
|
4362 + | }
|
2385 4363 | }
|
2386 4364 | }
|
2387 - | impl crate::constrained::Constrained for FooEnumSet {
|
2388 - | type Unconstrained = crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained;
|
2389 - | }
|
4365 + | /// See [`TestConfig`](crate::model::TestConfig).
|
4366 + | pub(crate) mod test_config_internal {
|
2390 4367 |
|
2391 - | #[::pyo3::pyclass]
|
2392 - | /// :param foo typing.Optional\[str\]:
|
2393 - | /// :rtype None:
|
2394 - | #[allow(missing_docs)] // documentation missing in model
|
2395 - | #[derive(
|
2396 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2397 - | )]
|
2398 - | pub struct ComplexNestedErrorData {
|
2399 - | #[pyo3(get, set)]
|
2400 - | /// :type typing.Optional\[str\]:
|
2401 - | #[allow(missing_docs)] // documentation missing in model
|
2402 - | pub foo: ::std::option::Option<::std::string::String>,
|
2403 - | }
|
2404 - | impl ComplexNestedErrorData {
|
4368 + | impl ::std::convert::From<Builder> for crate::model::TestConfig {
|
4369 + | fn from(builder: Builder) -> Self {
|
4370 + | builder.build()
|
4371 + | }
|
4372 + | }
|
4373 + | /// A builder for [`TestConfig`](crate::model::TestConfig).
|
4374 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4375 + | pub(crate) struct Builder {
|
4376 + | pub(crate) timeout: ::std::option::Option<i32>,
|
4377 + | }
|
4378 + | impl Builder {
|
2405 4379 | #[allow(missing_docs)] // documentation missing in model
|
2406 - | pub fn foo(&self) -> ::std::option::Option<&str> {
|
2407 - | self.foo.as_deref()
|
4380 + | pub(crate) fn set_timeout(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
4381 + | self.timeout = input.map(|v| v.into());
|
4382 + | self
|
2408 4383 | }
|
2409 - | }
|
2410 - | #[allow(clippy::new_without_default)]
|
2411 - | #[allow(clippy::too_many_arguments)]
|
2412 - | #[::pyo3::pymethods]
|
2413 - | impl ComplexNestedErrorData {
|
2414 - | #[new]
|
2415 - | pub fn new(foo: ::std::option::Option<::std::string::String>) -> Self {
|
2416 - | Self { foo }
|
4384 + | /// Consumes the builder and constructs a [`TestConfig`](crate::model::TestConfig).
|
4385 + | pub fn build(self) -> crate::model::TestConfig {
|
4386 + | self.build_enforcing_all_constraints()
|
2417 4387 | }
|
2418 - | fn __repr__(&self) -> String {
|
2419 - | format!("{self:?}")
|
4388 + | fn build_enforcing_all_constraints(self) -> crate::model::TestConfig {
|
4389 + | crate::model::TestConfig {
|
4390 + | timeout: self.timeout,
|
2420 4391 | }
|
2421 - | fn __str__(&self) -> String {
|
2422 - | format!("{self:?}")
|
2423 4392 | }
|
2424 - | }
|
2425 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<ComplexNestedErrorData> {
|
2426 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2427 - | ob.extract::<ComplexNestedErrorData>().map(Box::new)
|
2428 4393 | }
|
2429 4394 | }
|
4395 + | /// See [`TestConfig`](crate::model::TestConfig).
|
4396 + | pub mod test_config {
|
2430 4397 |
|
2431 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<ComplexNestedErrorData> {
|
2432 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2433 - | (*self).into_py(py)
|
4398 + | impl ::std::convert::From<Builder> for crate::model::TestConfig {
|
4399 + | fn from(builder: Builder) -> Self {
|
4400 + | builder.build()
|
2434 4401 | }
|
2435 - | }
|
2436 - | impl ComplexNestedErrorData {
|
2437 - | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
2438 - | pub fn builder() -> crate::model::complex_nested_error_data::Builder {
|
2439 - | crate::model::complex_nested_error_data::Builder::default()
|
2440 4402 | }
|
2441 - | }
|
2442 - |
|
2443 - | #[allow(missing_docs)] // documentation missing in model
|
2444 - | #[derive(
|
2445 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2446 - | )]
|
2447 - | pub enum UnionPayload {
|
4403 + | /// A builder for [`TestConfig`](crate::model::TestConfig).
|
4404 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4405 + | pub struct Builder {
|
4406 + | pub(crate) timeout: ::std::option::Option<i32>,
|
4407 + | }
|
4408 + | impl Builder {
|
2448 4409 | #[allow(missing_docs)] // documentation missing in model
|
2449 - | Greeting(::std::string::String),
|
2450 - | }
|
2451 - | impl UnionPayload {
|
2452 - | #[allow(irrefutable_let_patterns)]
|
2453 - | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
2454 - | /// Returns `Err(&Self)` if it can't be converted.
|
2455 - | pub fn as_greeting(&self) -> ::std::result::Result<&::std::string::String, &Self> {
|
2456 - | if let UnionPayload::Greeting(val) = &self {
|
2457 - | ::std::result::Result::Ok(val)
|
2458 - | } else {
|
2459 - | ::std::result::Result::Err(self)
|
4410 + | pub fn timeout(mut self, input: ::std::option::Option<i32>) -> Self {
|
4411 + | self.timeout = input;
|
4412 + | self
|
4413 + | }
|
4414 + | /// Consumes the builder and constructs a [`TestConfig`](crate::model::TestConfig).
|
4415 + | pub fn build(self) -> crate::model::TestConfig {
|
4416 + | self.build_enforcing_required_and_enum_traits()
|
4417 + | }
|
4418 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::TestConfig {
|
4419 + | crate::model::TestConfig {
|
4420 + | timeout: self.timeout,
|
2460 4421 | }
|
2461 4422 | }
|
2462 - | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
2463 - | pub fn is_greeting(&self) -> bool {
|
2464 - | self.as_greeting().is_ok()
|
2465 4423 | }
|
2466 4424 | }
|
2467 - | #[pyo3::pyclass(name = "UnionPayload")]
|
2468 - | #[derive(
|
2469 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2470 - | )]
|
2471 - | pub struct PyUnionMarkerUnionPayload(pub UnionPayload);
|
2472 - | #[::pyo3::pymethods]
|
2473 - | impl PyUnionMarkerUnionPayload {
|
2474 - | #[allow(irrefutable_let_patterns)]
|
2475 - | #[staticmethod]
|
2476 - | /// Creates a new union instance of [`Greeting`](crate::model::UnionPayload::Greeting)
|
2477 - | /// :param data str:
|
2478 - | /// :rtype UnionPayload:
|
2479 - | pub fn greeting(data: ::std::string::String) -> Self {
|
2480 - | Self(UnionPayload::Greeting(data))
|
4425 + | /// See [`PayloadConfig`](crate::model::PayloadConfig).
|
4426 + | pub(crate) mod payload_config_internal {
|
4427 + |
|
4428 + | impl ::std::convert::From<Builder> for crate::model::PayloadConfig {
|
4429 + | fn from(builder: Builder) -> Self {
|
4430 + | builder.build()
|
2481 4431 | }
|
2482 - | /// Tries to convert the enum instance into [`Greeting`](crate::model::UnionPayload::Greeting), extracting the inner [`String`](::std::string::String).
|
2483 - | /// :rtype str:
|
2484 - | pub fn as_greeting(&self) -> ::pyo3::PyResult<::std::string::String> {
|
2485 - | match self.0.as_greeting() {
|
2486 - | Ok(variant) => Ok(variant.clone()),
|
2487 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
2488 - | r"UnionPayload variant is not of type str",
|
2489 - | )),
|
2490 4432 | }
|
4433 + | /// A builder for [`PayloadConfig`](crate::model::PayloadConfig).
|
4434 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4435 + | pub(crate) struct Builder {
|
4436 + | pub(crate) data: ::std::option::Option<i32>,
|
2491 4437 | }
|
2492 - | /// Returns true if this is a [`Greeting`](crate::model::UnionPayload::Greeting).
|
2493 - | /// :rtype bool:
|
2494 - | pub fn is_greeting(&self) -> bool {
|
2495 - | self.0.is_greeting()
|
4438 + | impl Builder {
|
4439 + | #[allow(missing_docs)] // documentation missing in model
|
4440 + | pub(crate) fn set_data(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
4441 + | self.data = input.map(|v| v.into());
|
4442 + | self
|
2496 4443 | }
|
2497 - | }
|
2498 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for UnionPayload {
|
2499 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2500 - | PyUnionMarkerUnionPayload(self).into_py(py)
|
4444 + | /// Consumes the builder and constructs a [`PayloadConfig`](crate::model::PayloadConfig).
|
4445 + | pub fn build(self) -> crate::model::PayloadConfig {
|
4446 + | self.build_enforcing_all_constraints()
|
4447 + | }
|
4448 + | fn build_enforcing_all_constraints(self) -> crate::model::PayloadConfig {
|
4449 + | crate::model::PayloadConfig { data: self.data }
|
2501 4450 | }
|
2502 - | }
|
2503 - | impl<'source> ::pyo3::FromPyObject<'source> for UnionPayload {
|
2504 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2505 - | let data: PyUnionMarkerUnionPayload = obj.extract()?;
|
2506 - | Ok(data.0)
|
2507 4451 | }
|
2508 4452 | }
|
4453 + | /// See [`PayloadConfig`](crate::model::PayloadConfig).
|
4454 + | pub mod payload_config {
|
2509 4455 |
|
2510 - | #[::pyo3::pyclass]
|
2511 - | #[allow(missing_docs)] // documentation missing in model
|
2512 - | #[derive(
|
2513 - | ::std::clone::Clone,
|
2514 - | ::std::cmp::Eq,
|
2515 - | ::std::cmp::Ord,
|
2516 - | ::std::cmp::PartialEq,
|
2517 - | ::std::cmp::PartialOrd,
|
2518 - | ::std::fmt::Debug,
|
2519 - | ::std::hash::Hash,
|
2520 - | )]
|
2521 - | pub enum StringEnum {
|
2522 - | #[allow(missing_docs)] // documentation missing in model
|
2523 - | V,
|
2524 - | }
|
2525 - | pub(crate) mod string_enum_internal {
|
2526 - | #[derive(Debug, PartialEq)]
|
2527 - | pub struct ConstraintViolation(pub(crate) ::std::string::String);
|
2528 - |
|
2529 - | impl ::std::fmt::Display for ConstraintViolation {
|
2530 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2531 - | write!(
|
2532 - | f,
|
2533 - | r#"Value provided for 'aws.protocoltests.restjson#StringEnum' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#
|
2534 - | )
|
2535 - | }
|
4456 + | impl ::std::convert::From<Builder> for crate::model::PayloadConfig {
|
4457 + | fn from(builder: Builder) -> Self {
|
4458 + | builder.build()
|
2536 4459 | }
|
2537 - |
|
2538 - | impl ::std::error::Error for ConstraintViolation {}
|
2539 - | impl ConstraintViolation {
|
2540 - | pub(crate) fn as_validation_exception_field(
|
2541 - | self,
|
2542 - | path: ::std::string::String,
|
2543 - | ) -> crate::model::ValidationExceptionField {
|
2544 - | crate::model::ValidationExceptionField {
|
2545 - | message: format!(
|
2546 - | r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [enumvalue]"#,
|
2547 - | &path
|
2548 - | ),
|
2549 - | path,
|
2550 4460 | }
|
4461 + | /// A builder for [`PayloadConfig`](crate::model::PayloadConfig).
|
4462 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4463 + | pub struct Builder {
|
4464 + | pub(crate) data: ::std::option::Option<i32>,
|
2551 4465 | }
|
4466 + | impl Builder {
|
4467 + | #[allow(missing_docs)] // documentation missing in model
|
4468 + | pub fn data(mut self, input: ::std::option::Option<i32>) -> Self {
|
4469 + | self.data = input;
|
4470 + | self
|
2552 4471 | }
|
2553 - | }
|
2554 - | impl ::std::convert::TryFrom<&str> for StringEnum {
|
2555 - | type Error = crate::model::string_enum_internal::ConstraintViolation;
|
2556 - | fn try_from(
|
2557 - | s: &str,
|
2558 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
|
2559 - | match s {
|
2560 - | "enumvalue" => Ok(StringEnum::V),
|
2561 - | _ => Err(crate::model::string_enum_internal::ConstraintViolation(
|
2562 - | s.to_owned(),
|
2563 - | )),
|
4472 + | /// Consumes the builder and constructs a [`PayloadConfig`](crate::model::PayloadConfig).
|
4473 + | pub fn build(self) -> crate::model::PayloadConfig {
|
4474 + | self.build_enforcing_required_and_enum_traits()
|
2564 4475 | }
|
4476 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::PayloadConfig {
|
4477 + | crate::model::PayloadConfig { data: self.data }
|
2565 4478 | }
|
2566 - | }
|
2567 - | impl ::std::convert::TryFrom<::std::string::String> for StringEnum {
|
2568 - | type Error = crate::model::string_enum_internal::ConstraintViolation;
|
2569 - | fn try_from(
|
2570 - | s: ::std::string::String,
|
2571 - | ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
|
2572 - | {
|
2573 - | s.as_str().try_into()
|
2574 4479 | }
|
2575 4480 | }
|
2576 - | impl std::str::FromStr for StringEnum {
|
2577 - | type Err = crate::model::string_enum_internal::ConstraintViolation;
|
2578 - | fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
|
2579 - | Self::try_from(s)
|
4481 + | /// See [`Defaults`](crate::model::Defaults).
|
4482 + | pub(crate) mod defaults_internal {
|
4483 + |
|
4484 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4485 + | /// Holds one variant for each of the ways the builder can fail.
|
4486 + | #[non_exhaustive]
|
4487 + | #[allow(clippy::enum_variant_names)]
|
4488 + | pub(crate) enum ConstraintViolation {
|
4489 + | /// Constraint violation occurred building member `default_enum` when building `Defaults`.
|
4490 + | #[doc(hidden)]
|
4491 + | DefaultEnum(crate::model::test_enum_internal::ConstraintViolation),
|
2580 4492 | }
|
2581 - | }
|
2582 - | impl StringEnum {
|
2583 - | /// Returns the `&str` value of the enum member.
|
2584 - | pub fn as_str(&self) -> &str {
|
4493 + | impl ::std::fmt::Display for ConstraintViolation {
|
4494 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2585 4495 | match self {
|
2586 - | StringEnum::V => "enumvalue",
|
2587 - | }
|
4496 + | ConstraintViolation::DefaultEnum(_) => write!(f, "constraint violation occurred building member `default_enum` when building `Defaults`"),
|
2588 4497 | }
|
2589 - | /// Returns all the `&str` representations of the enum members.
|
2590 - | pub const fn values() -> &'static [&'static str] {
|
2591 - | &["enumvalue"]
|
2592 4498 | }
|
2593 - | }
|
2594 - | impl ::std::convert::AsRef<str> for StringEnum {
|
2595 - | fn as_ref(&self) -> &str {
|
2596 - | self.as_str()
|
2597 4499 | }
|
2598 - | }
|
2599 - | #[::pyo3::pymethods]
|
2600 - | impl StringEnum {
|
2601 - | #[getter]
|
2602 - | pub fn name(&self) -> &str {
|
4500 + | impl ::std::error::Error for ConstraintViolation {}
|
4501 + | impl ConstraintViolation {
|
4502 + | pub(crate) fn as_validation_exception_field(
|
4503 + | self,
|
4504 + | path: ::std::string::String,
|
4505 + | ) -> crate::model::ValidationExceptionField {
|
2603 4506 | match self {
|
2604 - | StringEnum::V => "V",
|
4507 + | ConstraintViolation::DefaultEnum(inner) => {
|
4508 + | inner.as_validation_exception_field(path + "/defaultEnum")
|
2605 4509 | }
|
2606 4510 | }
|
2607 - | #[getter]
|
2608 - | pub fn value(&self) -> &str {
|
2609 - | self.as_str()
|
2610 4511 | }
|
2611 - | fn __repr__(&self) -> String {
|
2612 - | self.as_str().to_owned()
|
2613 4512 | }
|
2614 - | fn __str__(&self) -> String {
|
2615 - | self.as_str().to_owned()
|
4513 + | impl ::std::convert::From<Builder>
|
4514 + | for crate::constrained::MaybeConstrained<crate::model::Defaults>
|
4515 + | {
|
4516 + | fn from(builder: Builder) -> Self {
|
4517 + | Self::Unconstrained(builder)
|
2616 4518 | }
|
2617 - | }
|
2618 - | impl crate::constrained::Constrained for StringEnum {
|
2619 - | type Unconstrained = ::std::string::String;
|
2620 - | }
|
2621 - |
|
2622 - | impl ::std::convert::From<::std::string::String>
|
2623 - | for crate::constrained::MaybeConstrained<crate::model::StringEnum>
|
2624 - | {
|
2625 - | fn from(value: ::std::string::String) -> Self {
|
2626 - | Self::Unconstrained(value)
|
2627 4519 | }
|
2628 - | }
|
4520 + | impl ::std::convert::TryFrom<Builder> for crate::model::Defaults {
|
4521 + | type Error = ConstraintViolation;
|
2629 4522 |
|
2630 - | #[::pyo3::pyclass]
|
2631 - | /// :param greeting typing.Optional\[str\]:
|
2632 - | /// :param name typing.Optional\[str\]:
|
2633 - | /// :rtype None:
|
2634 - | #[allow(missing_docs)] // documentation missing in model
|
2635 - | #[derive(
|
2636 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2637 - | )]
|
2638 - | pub struct NestedPayload {
|
2639 - | #[pyo3(get, set)]
|
2640 - | /// :type typing.Optional\[str\]:
|
2641 - | #[allow(missing_docs)] // documentation missing in model
|
2642 - | pub greeting: ::std::option::Option<::std::string::String>,
|
2643 - | #[pyo3(get, set)]
|
2644 - | /// :type typing.Optional\[str\]:
|
2645 - | #[allow(missing_docs)] // documentation missing in model
|
2646 - | pub name: ::std::option::Option<::std::string::String>,
|
2647 - | }
|
2648 - | impl NestedPayload {
|
4523 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
4524 + | builder.build()
|
4525 + | }
|
4526 + | }
|
4527 + | /// A builder for [`Defaults`](crate::model::Defaults).
|
4528 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4529 + | pub(crate) struct Builder {
|
4530 + | pub(crate) default_string: ::std::option::Option<::std::string::String>,
|
4531 + | pub(crate) default_boolean: ::std::option::Option<bool>,
|
4532 + | pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
4533 + | pub(crate) default_document_map:
|
4534 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4535 + | pub(crate) default_document_string:
|
4536 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4537 + | pub(crate) default_document_boolean:
|
4538 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4539 + | pub(crate) default_document_list:
|
4540 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4541 + | pub(crate) default_null_document:
|
4542 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4543 + | pub(crate) default_timestamp:
|
4544 + | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
4545 + | pub(crate) default_blob:
|
4546 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4547 + | pub(crate) default_byte: ::std::option::Option<i8>,
|
4548 + | pub(crate) default_short: ::std::option::Option<i16>,
|
4549 + | pub(crate) default_integer: ::std::option::Option<i32>,
|
4550 + | pub(crate) default_long: ::std::option::Option<i64>,
|
4551 + | pub(crate) default_float: ::std::option::Option<f32>,
|
4552 + | pub(crate) default_double: ::std::option::Option<f64>,
|
4553 + | pub(crate) default_map: ::std::option::Option<
|
4554 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4555 + | >,
|
4556 + | pub(crate) default_enum:
|
4557 + | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TestEnum>>,
|
4558 + | pub(crate) default_int_enum: ::std::option::Option<i32>,
|
4559 + | pub(crate) empty_string: ::std::option::Option<::std::string::String>,
|
4560 + | pub(crate) false_boolean: ::std::option::Option<bool>,
|
4561 + | pub(crate) empty_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4562 + | pub(crate) zero_byte: ::std::option::Option<i8>,
|
4563 + | pub(crate) zero_short: ::std::option::Option<i16>,
|
4564 + | pub(crate) zero_integer: ::std::option::Option<i32>,
|
4565 + | pub(crate) zero_long: ::std::option::Option<i64>,
|
4566 + | pub(crate) zero_float: ::std::option::Option<f32>,
|
4567 + | pub(crate) zero_double: ::std::option::Option<f64>,
|
4568 + | }
|
4569 + | impl Builder {
|
2649 4570 | #[allow(missing_docs)] // documentation missing in model
|
2650 - | pub fn greeting(&self) -> ::std::option::Option<&str> {
|
2651 - | self.greeting.as_deref()
|
4571 + | pub(crate) fn set_default_string(
|
4572 + | mut self,
|
4573 + | input: impl ::std::convert::Into<::std::string::String>,
|
4574 + | ) -> Self {
|
4575 + | self.default_string = Some(input.into());
|
4576 + | self
|
2652 4577 | }
|
2653 4578 | #[allow(missing_docs)] // documentation missing in model
|
2654 - | pub fn name(&self) -> ::std::option::Option<&str> {
|
2655 - | self.name.as_deref()
|
4579 + | pub(crate) fn set_default_boolean(
|
4580 + | mut self,
|
4581 + | input: impl ::std::convert::Into<bool>,
|
4582 + | ) -> Self {
|
4583 + | self.default_boolean = Some(input.into());
|
4584 + | self
|
2656 4585 | }
|
2657 - | }
|
2658 - | #[allow(clippy::new_without_default)]
|
2659 - | #[allow(clippy::too_many_arguments)]
|
2660 - | #[::pyo3::pymethods]
|
2661 - | impl NestedPayload {
|
2662 - | #[new]
|
2663 - | pub fn new(
|
2664 - | greeting: ::std::option::Option<::std::string::String>,
|
2665 - | name: ::std::option::Option<::std::string::String>,
|
4586 + | #[allow(missing_docs)] // documentation missing in model
|
4587 + | pub(crate) fn set_default_list(
|
4588 + | mut self,
|
4589 + | input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
|
2666 4590 | ) -> Self {
|
2667 - | Self { greeting, name }
|
4591 + | self.default_list = Some(input.into());
|
4592 + | self
|
2668 4593 | }
|
2669 - | fn __repr__(&self) -> String {
|
2670 - | format!("{self:?}")
|
4594 + | #[allow(missing_docs)] // documentation missing in model
|
4595 + | pub(crate) fn set_default_document_map(
|
4596 + | mut self,
|
4597 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
4598 + | ) -> Self {
|
4599 + | self.default_document_map = Some(input.into());
|
4600 + | self
|
2671 4601 | }
|
2672 - | fn __str__(&self) -> String {
|
2673 - | format!("{self:?}")
|
4602 + | #[allow(missing_docs)] // documentation missing in model
|
4603 + | pub(crate) fn set_default_document_string(
|
4604 + | mut self,
|
4605 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
4606 + | ) -> Self {
|
4607 + | self.default_document_string = Some(input.into());
|
4608 + | self
|
2674 4609 | }
|
2675 - | }
|
2676 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<NestedPayload> {
|
2677 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
2678 - | ob.extract::<NestedPayload>().map(Box::new)
|
4610 + | #[allow(missing_docs)] // documentation missing in model
|
4611 + | pub(crate) fn set_default_document_boolean(
|
4612 + | mut self,
|
4613 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
4614 + | ) -> Self {
|
4615 + | self.default_document_boolean = Some(input.into());
|
4616 + | self
|
2679 4617 | }
|
2680 - | }
|
2681 - |
|
2682 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<NestedPayload> {
|
2683 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
2684 - | (*self).into_py(py)
|
4618 + | #[allow(missing_docs)] // documentation missing in model
|
4619 + | pub(crate) fn set_default_document_list(
|
4620 + | mut self,
|
4621 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
4622 + | ) -> Self {
|
4623 + | self.default_document_list = Some(input.into());
|
4624 + | self
|
2685 4625 | }
|
2686 - | }
|
2687 - | impl crate::constrained::Constrained for crate::model::NestedPayload {
|
2688 - | type Unconstrained = crate::model::nested_payload_internal::Builder;
|
2689 - | }
|
2690 - | impl NestedPayload {
|
2691 - | /// Creates a new builder-style object to manufacture [`NestedPayload`](crate::model::NestedPayload).
|
2692 - | pub fn builder() -> crate::model::nested_payload::Builder {
|
2693 - | crate::model::nested_payload::Builder::default()
|
4626 + | #[allow(missing_docs)] // documentation missing in model
|
4627 + | pub(crate) fn set_default_null_document(
|
4628 + | mut self,
|
4629 + | input: Option<
|
4630 + | impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
4631 + | >,
|
4632 + | ) -> Self {
|
4633 + | self.default_null_document = input.map(|v| v.into());
|
4634 + | self
|
2694 4635 | }
|
2695 - | }
|
2696 - |
|
2697 - | #[allow(missing_docs)] // documentation missing in model
|
2698 - | ///
|
2699 - | /// This is a constrained type because its corresponding modeled Smithy shape has one or more
|
2700 - | /// [constraint traits]. Use [`IntegerSet::try_from`] to construct values of this type.
|
2701 - | ///
|
2702 - | /// [constraint traits]: https://smithy.io/2.0/spec/constraint-traits.html
|
2703 - | ///
|
2704 - | #[derive(
|
2705 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
2706 - | )]
|
2707 - | pub(crate) struct IntegerSet(pub(crate) ::std::vec::Vec<i32>);
|
2708 - | impl IntegerSet {
|
2709 - | /// Consumes the value, returning the underlying [`::std::vec::Vec<i32>`].
|
2710 - | pub fn into_inner(self) -> ::std::vec::Vec<i32> {
|
2711 - | self.0
|
4636 + | #[allow(missing_docs)] // documentation missing in model
|
4637 + | pub(crate) fn set_default_timestamp(
|
4638 + | mut self,
|
4639 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::DateTime>,
|
4640 + | ) -> Self {
|
4641 + | self.default_timestamp = Some(input.into());
|
4642 + | self
|
2712 4643 | }
|
2713 - |
|
2714 - | fn check_unique_items(
|
2715 - | items: ::std::vec::Vec<i32>,
|
2716 - | ) -> ::std::result::Result<
|
2717 - | ::std::vec::Vec<i32>,
|
2718 - | crate::model::integer_set_internal::ConstraintViolation,
|
2719 - | > {
|
2720 - | let mut seen = ::std::collections::HashMap::new();
|
2721 - | let mut duplicate_indices = ::std::vec::Vec::new();
|
2722 - | for (idx, item) in items.iter().enumerate() {
|
2723 - | if let Some(prev_idx) = seen.insert(item, idx) {
|
2724 - | duplicate_indices.push(prev_idx);
|
4644 + | #[allow(missing_docs)] // documentation missing in model
|
4645 + | pub(crate) fn set_default_blob(
|
4646 + | mut self,
|
4647 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>,
|
4648 + | ) -> Self {
|
4649 + | self.default_blob = Some(input.into());
|
4650 + | self
|
2725 4651 | }
|
4652 + | #[allow(missing_docs)] // documentation missing in model
|
4653 + | pub(crate) fn set_default_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
4654 + | self.default_byte = Some(input.into());
|
4655 + | self
|
2726 4656 | }
|
2727 - |
|
2728 - | let mut last_duplicate_indices = ::std::vec::Vec::new();
|
2729 - | for idx in &duplicate_indices {
|
2730 - | if let Some(prev_idx) = seen.remove(&items[*idx]) {
|
2731 - | last_duplicate_indices.push(prev_idx);
|
4657 + | #[allow(missing_docs)] // documentation missing in model
|
4658 + | pub(crate) fn set_default_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
4659 + | self.default_short = Some(input.into());
|
4660 + | self
|
2732 4661 | }
|
4662 + | #[allow(missing_docs)] // documentation missing in model
|
4663 + | pub(crate) fn set_default_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
4664 + | self.default_integer = Some(input.into());
|
4665 + | self
|
2733 4666 | }
|
2734 - | duplicate_indices.extend(last_duplicate_indices);
|
2735 - |
|
2736 - | if !duplicate_indices.is_empty() {
|
2737 - | debug_assert!(duplicate_indices.len() >= 2);
|
2738 - | Err(
|
2739 - | crate::model::integer_set_internal::ConstraintViolation::UniqueItems {
|
2740 - | duplicate_indices,
|
2741 - | original: items,
|
2742 - | },
|
2743 - | )
|
2744 - | } else {
|
2745 - | Ok(items)
|
4667 + | #[allow(missing_docs)] // documentation missing in model
|
4668 + | pub(crate) fn set_default_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
4669 + | self.default_long = Some(input.into());
|
4670 + | self
|
2746 4671 | }
|
4672 + | #[allow(missing_docs)] // documentation missing in model
|
4673 + | pub(crate) fn set_default_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
4674 + | self.default_float = Some(input.into());
|
4675 + | self
|
2747 4676 | }
|
2748 - | }
|
2749 - | impl ::std::convert::TryFrom<::std::vec::Vec<i32>> for IntegerSet {
|
2750 - | type Error = crate::model::integer_set_internal::ConstraintViolation;
|
2751 - |
|
2752 - | /// Constructs a `IntegerSet` from an [`::std::vec::Vec<i32>`], failing when the provided value does not satisfy the modeled constraints.
|
2753 - | fn try_from(value: ::std::vec::Vec<i32>) -> ::std::result::Result<Self, Self::Error> {
|
2754 - | let value = Self::check_unique_items(value)?;
|
2755 - |
|
2756 - | Ok(Self(value))
|
4677 + | #[allow(missing_docs)] // documentation missing in model
|
4678 + | pub(crate) fn set_default_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
4679 + | self.default_double = Some(input.into());
|
4680 + | self
|
2757 4681 | }
|
2758 - | }
|
2759 - |
|
2760 - | impl ::std::convert::From<IntegerSet> for ::std::vec::Vec<i32> {
|
2761 - | fn from(value: IntegerSet) -> Self {
|
2762 - | value.into_inner()
|
4682 + | #[allow(missing_docs)] // documentation missing in model
|
4683 + | pub(crate) fn set_default_map(
|
4684 + | mut self,
|
4685 + | input: impl ::std::convert::Into<
|
4686 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4687 + | >,
|
4688 + | ) -> Self {
|
4689 + | self.default_map = Some(input.into());
|
4690 + | self
|
2763 4691 | }
|
2764 - | }
|
2765 - | impl crate::constrained::Constrained for IntegerSet {
|
2766 - | type Unconstrained = crate::unconstrained::integer_set_unconstrained::IntegerSetUnconstrained;
|
2767 - | }
|
2768 - |
|
2769 - | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2770 - | pub mod validation_exception_field {
|
2771 - |
|
2772 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2773 - | /// Holds one variant for each of the ways the builder can fail.
|
2774 - | #[allow(clippy::enum_variant_names)]
|
2775 - | pub enum ConstraintViolation {
|
2776 - | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
2777 - | MissingPath,
|
2778 - | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
2779 - | MissingMessage,
|
4692 + | #[allow(missing_docs)] // documentation missing in model
|
4693 + | pub(crate) fn set_default_enum(
|
4694 + | mut self,
|
4695 + | input: impl ::std::convert::Into<
|
4696 + | crate::constrained::MaybeConstrained<crate::model::TestEnum>,
|
4697 + | >,
|
4698 + | ) -> Self {
|
4699 + | self.default_enum = Some(input.into());
|
4700 + | self
|
2780 4701 | }
|
2781 - | impl ::std::fmt::Display for ConstraintViolation {
|
2782 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
2783 - | match self {
|
2784 - | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
2785 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
4702 + | #[allow(missing_docs)] // documentation missing in model
|
4703 + | pub(crate) fn set_default_int_enum(
|
4704 + | mut self,
|
4705 + | input: impl ::std::convert::Into<i32>,
|
4706 + | ) -> Self {
|
4707 + | self.default_int_enum = Some(input.into());
|
4708 + | self
|
4709 + | }
|
4710 + | #[allow(missing_docs)] // documentation missing in model
|
4711 + | pub(crate) fn set_empty_string(
|
4712 + | mut self,
|
4713 + | input: impl ::std::convert::Into<::std::string::String>,
|
4714 + | ) -> Self {
|
4715 + | self.empty_string = Some(input.into());
|
4716 + | self
|
4717 + | }
|
4718 + | #[allow(missing_docs)] // documentation missing in model
|
4719 + | pub(crate) fn set_false_boolean(mut self, input: impl ::std::convert::Into<bool>) -> Self {
|
4720 + | self.false_boolean = Some(input.into());
|
4721 + | self
|
2786 4722 | }
|
4723 + | #[allow(missing_docs)] // documentation missing in model
|
4724 + | pub(crate) fn set_empty_blob(
|
4725 + | mut self,
|
4726 + | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>,
|
4727 + | ) -> Self {
|
4728 + | self.empty_blob = Some(input.into());
|
4729 + | self
|
2787 4730 | }
|
4731 + | #[allow(missing_docs)] // documentation missing in model
|
4732 + | pub(crate) fn set_zero_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
4733 + | self.zero_byte = Some(input.into());
|
4734 + | self
|
2788 4735 | }
|
2789 - | impl ::std::error::Error for ConstraintViolation {}
|
2790 - | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
2791 - | type Error = ConstraintViolation;
|
2792 - |
|
2793 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
2794 - | builder.build()
|
4736 + | #[allow(missing_docs)] // documentation missing in model
|
4737 + | pub(crate) fn set_zero_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
4738 + | self.zero_short = Some(input.into());
|
4739 + | self
|
2795 4740 | }
|
4741 + | #[allow(missing_docs)] // documentation missing in model
|
4742 + | pub(crate) fn set_zero_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
4743 + | self.zero_integer = Some(input.into());
|
4744 + | self
|
2796 4745 | }
|
2797 - | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
2798 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2799 - | pub struct Builder {
|
2800 - | pub(crate) path: ::std::option::Option<::std::string::String>,
|
2801 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
4746 + | #[allow(missing_docs)] // documentation missing in model
|
4747 + | pub(crate) fn set_zero_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
4748 + | self.zero_long = Some(input.into());
|
4749 + | self
|
2802 4750 | }
|
2803 - | impl Builder {
|
2804 - | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
2805 - | pub fn path(mut self, input: ::std::string::String) -> Self {
|
2806 - | self.path = Some(input);
|
4751 + | #[allow(missing_docs)] // documentation missing in model
|
4752 + | pub(crate) fn set_zero_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
4753 + | self.zero_float = Some(input.into());
|
2807 4754 | self
|
2808 4755 | }
|
2809 - | /// A detailed description of the validation failure.
|
2810 - | pub fn message(mut self, input: ::std::string::String) -> Self {
|
2811 - | self.message = Some(input);
|
4756 + | #[allow(missing_docs)] // documentation missing in model
|
4757 + | pub(crate) fn set_zero_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
4758 + | self.zero_double = Some(input.into());
|
2812 4759 | self
|
2813 4760 | }
|
2814 - | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
4761 + | /// Consumes the builder and constructs a [`Defaults`](crate::model::Defaults).
|
2815 4762 | ///
|
2816 - | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
4763 + | /// The builder fails to construct a [`Defaults`](crate::model::Defaults) if a [`ConstraintViolation`] occurs.
|
2817 4764 | ///
|
2818 - | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
2819 - | self.build_enforcing_required_and_enum_traits()
|
4765 + | pub fn build(self) -> Result<crate::model::Defaults, ConstraintViolation> {
|
4766 + | self.build_enforcing_all_constraints()
|
2820 4767 | }
|
2821 - | fn build_enforcing_required_and_enum_traits(
|
4768 + | fn build_enforcing_all_constraints(
|
2822 4769 | self,
|
2823 - | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
2824 - | Ok(crate::model::ValidationExceptionField {
|
2825 - | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
2826 - | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
4770 + | ) -> Result<crate::model::Defaults, ConstraintViolation> {
|
4771 + | Ok(crate::model::Defaults {
|
4772 + | default_string: self.default_string.unwrap_or_else(|| String::from("hi")),
|
4773 + | default_boolean: self.default_boolean.unwrap_or(true),
|
4774 + | default_list: self.default_list.unwrap_or_default(),
|
4775 + | default_document_map: self.default_document_map.unwrap_or_else(|| {
|
4776 + | ::aws_smithy_types::Document::Object(::std::collections::HashMap::new()).into()
|
4777 + | }),
|
4778 + | default_document_string: self.default_document_string.unwrap_or_else(|| {
|
4779 + | ::aws_smithy_types::Document::String(::std::string::String::from("hi")).into()
|
4780 + | }),
|
4781 + | default_document_boolean: self
|
4782 + | .default_document_boolean
|
4783 + | .unwrap_or(::aws_smithy_types::Document::Bool(true).into()),
|
4784 + | default_document_list: self.default_document_list.unwrap_or_else(|| {
|
4785 + | ::aws_smithy_types::Document::Array(::std::vec::Vec::new()).into()
|
4786 + | }),
|
4787 + | default_null_document: self.default_null_document,
|
4788 + | default_timestamp: self.default_timestamp.unwrap_or_else(|| {
|
4789 + | ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64).into()
|
4790 + | }),
|
4791 + | default_blob: self
|
4792 + | .default_blob
|
4793 + | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("YWJj").into()),
|
4794 + | default_byte: self.default_byte.unwrap_or(1i8),
|
4795 + | default_short: self.default_short.unwrap_or(1i16),
|
4796 + | default_integer: self.default_integer.unwrap_or(10i32),
|
4797 + | default_long: self.default_long.unwrap_or(100i64),
|
4798 + | default_float: self.default_float.unwrap_or(1.0f32),
|
4799 + | default_double: self.default_double.unwrap_or(1.0f64),
|
4800 + | default_map: self.default_map.unwrap_or_default(),
|
4801 + | default_enum: self
|
4802 + | .default_enum
|
4803 + | .map(|v| match v {
|
4804 + | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
4805 + | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
4806 + | })
|
4807 + | .map(|res| res.map_err(ConstraintViolation::DefaultEnum))
|
4808 + | .transpose()?
|
4809 + | .unwrap_or(
|
4810 + | "FOO"
|
4811 + | .parse::<crate::model::TestEnum>()
|
4812 + | .expect("static value validated to member"),
|
4813 + | ),
|
4814 + | default_int_enum: self.default_int_enum.unwrap_or(1i32),
|
4815 + | empty_string: self.empty_string.unwrap_or_else(|| String::from("")),
|
4816 + | false_boolean: self.false_boolean.unwrap_or(false),
|
4817 + | empty_blob: self
|
4818 + | .empty_blob
|
4819 + | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("").into()),
|
4820 + | zero_byte: self.zero_byte.unwrap_or(0i8),
|
4821 + | zero_short: self.zero_short.unwrap_or(0i16),
|
4822 + | zero_integer: self.zero_integer.unwrap_or(0i32),
|
4823 + | zero_long: self.zero_long.unwrap_or(0i64),
|
4824 + | zero_float: self.zero_float.unwrap_or(0.0f32),
|
4825 + | zero_double: self.zero_double.unwrap_or(0.0f64),
|
2827 4826 | })
|
2828 4827 | }
|
2829 4828 | }
|
2830 4829 | }
|
2831 - | /// See [`Dialog`](crate::model::Dialog).
|
2832 - | pub(crate) mod dialog_internal {
|
4830 + | /// See [`Defaults`](crate::model::Defaults).
|
4831 + | pub mod defaults {
|
2833 4832 |
|
2834 - | impl ::std::convert::From<Builder> for crate::model::Dialog {
|
4833 + | impl ::std::convert::From<Builder> for crate::model::Defaults {
|
2835 4834 | fn from(builder: Builder) -> Self {
|
2836 4835 | builder.build()
|
2837 4836 | }
|
2838 4837 | }
|
2839 - | /// A builder for [`Dialog`](crate::model::Dialog).
|
4838 + | /// A builder for [`Defaults`](crate::model::Defaults).
|
2840 4839 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2841 - | pub(crate) struct Builder {
|
2842 - | pub(crate) language: ::std::option::Option<::std::string::String>,
|
2843 - | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
2844 - | pub(crate) farewell: ::std::option::Option<crate::model::Farewell>,
|
4840 + | pub struct Builder {
|
4841 + | pub(crate) default_string: ::std::option::Option<::std::string::String>,
|
4842 + | pub(crate) default_boolean: ::std::option::Option<bool>,
|
4843 + | pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
4844 + | pub(crate) default_document_map:
|
4845 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4846 + | pub(crate) default_document_string:
|
4847 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4848 + | pub(crate) default_document_boolean:
|
4849 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4850 + | pub(crate) default_document_list:
|
4851 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4852 + | pub(crate) default_null_document:
|
4853 + | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4854 + | pub(crate) default_timestamp:
|
4855 + | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
4856 + | pub(crate) default_blob:
|
4857 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4858 + | pub(crate) default_byte: ::std::option::Option<i8>,
|
4859 + | pub(crate) default_short: ::std::option::Option<i16>,
|
4860 + | pub(crate) default_integer: ::std::option::Option<i32>,
|
4861 + | pub(crate) default_long: ::std::option::Option<i64>,
|
4862 + | pub(crate) default_float: ::std::option::Option<f32>,
|
4863 + | pub(crate) default_double: ::std::option::Option<f64>,
|
4864 + | pub(crate) default_map: ::std::option::Option<
|
4865 + | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
4866 + | >,
|
4867 + | pub(crate) default_enum: ::std::option::Option<crate::model::TestEnum>,
|
4868 + | pub(crate) default_int_enum: ::std::option::Option<i32>,
|
4869 + | pub(crate) empty_string: ::std::option::Option<::std::string::String>,
|
4870 + | pub(crate) false_boolean: ::std::option::Option<bool>,
|
4871 + | pub(crate) empty_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4872 + | pub(crate) zero_byte: ::std::option::Option<i8>,
|
4873 + | pub(crate) zero_short: ::std::option::Option<i16>,
|
4874 + | pub(crate) zero_integer: ::std::option::Option<i32>,
|
4875 + | pub(crate) zero_long: ::std::option::Option<i64>,
|
4876 + | pub(crate) zero_float: ::std::option::Option<f32>,
|
4877 + | pub(crate) zero_double: ::std::option::Option<f64>,
|
2845 4878 | }
|
2846 4879 | impl Builder {
|
2847 4880 | #[allow(missing_docs)] // documentation missing in model
|
2848 - | pub(crate) fn set_language(
|
2849 - | mut self,
|
2850 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
2851 - | ) -> Self {
|
2852 - | self.language = input.map(|v| v.into());
|
4881 + | pub fn default_string(mut self, input: ::std::string::String) -> Self {
|
4882 + | self.default_string = Some(input);
|
2853 4883 | self
|
2854 4884 | }
|
2855 4885 | #[allow(missing_docs)] // documentation missing in model
|
2856 - | pub(crate) fn set_greeting(
|
4886 + | pub fn default_boolean(mut self, input: bool) -> Self {
|
4887 + | self.default_boolean = Some(input);
|
4888 + | self
|
4889 + | }
|
4890 + | #[allow(missing_docs)] // documentation missing in model
|
4891 + | pub fn default_list(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
|
4892 + | self.default_list = Some(input);
|
4893 + | self
|
4894 + | }
|
4895 + | #[allow(missing_docs)] // documentation missing in model
|
4896 + | pub fn default_document_map(
|
2857 4897 | mut self,
|
2858 - | input: impl ::std::convert::Into<::std::string::String>,
|
4898 + | input: ::aws_smithy_http_server_python::types::Document,
|
2859 4899 | ) -> Self {
|
2860 - | self.greeting = Some(input.into());
|
4900 + | self.default_document_map = Some(input);
|
2861 4901 | self
|
2862 4902 | }
|
2863 4903 | #[allow(missing_docs)] // documentation missing in model
|
2864 - | pub(crate) fn set_farewell(
|
4904 + | pub fn default_document_string(
|
2865 4905 | mut self,
|
2866 - | input: Option<impl ::std::convert::Into<crate::model::Farewell>>,
|
4906 + | input: ::aws_smithy_http_server_python::types::Document,
|
2867 4907 | ) -> Self {
|
2868 - | self.farewell = input.map(|v| v.into());
|
4908 + | self.default_document_string = Some(input);
|
2869 4909 | self
|
2870 4910 | }
|
2871 - | /// Consumes the builder and constructs a [`Dialog`](crate::model::Dialog).
|
2872 - | pub fn build(self) -> crate::model::Dialog {
|
2873 - | self.build_enforcing_all_constraints()
|
2874 - | }
|
2875 - | fn build_enforcing_all_constraints(self) -> crate::model::Dialog {
|
2876 - | crate::model::Dialog {
|
2877 - | language: self.language,
|
2878 - | greeting: self.greeting.unwrap_or_else(|| String::from("hi")),
|
2879 - | farewell: self.farewell,
|
2880 - | }
|
2881 - | }
|
2882 - | }
|
2883 - | }
|
2884 - | /// See [`Dialog`](crate::model::Dialog).
|
2885 - | pub mod dialog {
|
2886 - |
|
2887 - | impl ::std::convert::From<Builder> for crate::model::Dialog {
|
2888 - | fn from(builder: Builder) -> Self {
|
2889 - | builder.build()
|
2890 - | }
|
2891 - | }
|
2892 - | /// A builder for [`Dialog`](crate::model::Dialog).
|
2893 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2894 - | pub struct Builder {
|
2895 - | pub(crate) language: ::std::option::Option<::std::string::String>,
|
2896 - | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
2897 - | pub(crate) farewell: ::std::option::Option<crate::model::Farewell>,
|
2898 - | }
|
2899 - | impl Builder {
|
2900 4911 | #[allow(missing_docs)] // documentation missing in model
|
2901 - | pub fn language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
2902 - | self.language = input;
|
4912 + | pub fn default_document_boolean(
|
4913 + | mut self,
|
4914 + | input: ::aws_smithy_http_server_python::types::Document,
|
4915 + | ) -> Self {
|
4916 + | self.default_document_boolean = Some(input);
|
2903 4917 | self
|
2904 4918 | }
|
2905 4919 | #[allow(missing_docs)] // documentation missing in model
|
2906 - | pub fn greeting(mut self, input: ::std::string::String) -> Self {
|
2907 - | self.greeting = Some(input);
|
4920 + | pub fn default_document_list(
|
4921 + | mut self,
|
4922 + | input: ::aws_smithy_http_server_python::types::Document,
|
4923 + | ) -> Self {
|
4924 + | self.default_document_list = Some(input);
|
2908 4925 | self
|
2909 4926 | }
|
2910 4927 | #[allow(missing_docs)] // documentation missing in model
|
2911 - | pub fn farewell(mut self, input: ::std::option::Option<crate::model::Farewell>) -> Self {
|
2912 - | self.farewell = input;
|
4928 + | pub fn default_null_document(
|
4929 + | mut self,
|
4930 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
4931 + | ) -> Self {
|
4932 + | self.default_null_document = input;
|
2913 4933 | self
|
2914 4934 | }
|
2915 - | /// Consumes the builder and constructs a [`Dialog`](crate::model::Dialog).
|
2916 - | pub fn build(self) -> crate::model::Dialog {
|
2917 - | self.build_enforcing_required_and_enum_traits()
|
2918 - | }
|
2919 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Dialog {
|
2920 - | crate::model::Dialog {
|
2921 - | language: self.language,
|
2922 - | greeting: self.greeting.unwrap_or_else(|| String::from("hi")),
|
2923 - | farewell: self.farewell,
|
2924 - | }
|
2925 - | }
|
2926 - | }
|
2927 - | }
|
2928 - | /// See [`Farewell`](crate::model::Farewell).
|
2929 - | pub(crate) mod farewell_internal {
|
2930 - |
|
2931 - | impl ::std::convert::From<Builder> for crate::model::Farewell {
|
2932 - | fn from(builder: Builder) -> Self {
|
2933 - | builder.build()
|
2934 - | }
|
2935 - | }
|
2936 - | /// A builder for [`Farewell`](crate::model::Farewell).
|
2937 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2938 - | pub(crate) struct Builder {
|
2939 - | pub(crate) phrase: ::std::option::Option<::std::string::String>,
|
2940 - | }
|
2941 - | impl Builder {
|
2942 4935 | #[allow(missing_docs)] // documentation missing in model
|
2943 - | pub(crate) fn set_phrase(
|
4936 + | pub fn default_timestamp(
|
2944 4937 | mut self,
|
2945 - | input: impl ::std::convert::Into<::std::string::String>,
|
4938 + | input: ::aws_smithy_http_server_python::types::DateTime,
|
2946 4939 | ) -> Self {
|
2947 - | self.phrase = Some(input.into());
|
4940 + | self.default_timestamp = Some(input);
|
2948 4941 | self
|
2949 4942 | }
|
2950 - | /// Consumes the builder and constructs a [`Farewell`](crate::model::Farewell).
|
2951 - | pub fn build(self) -> crate::model::Farewell {
|
2952 - | self.build_enforcing_all_constraints()
|
2953 - | }
|
2954 - | fn build_enforcing_all_constraints(self) -> crate::model::Farewell {
|
2955 - | crate::model::Farewell {
|
2956 - | phrase: self.phrase.unwrap_or_else(|| String::from("bye")),
|
2957 - | }
|
2958 - | }
|
2959 - | }
|
2960 - | }
|
2961 - | /// See [`Farewell`](crate::model::Farewell).
|
2962 - | pub mod farewell {
|
2963 - |
|
2964 - | impl ::std::convert::From<Builder> for crate::model::Farewell {
|
2965 - | fn from(builder: Builder) -> Self {
|
2966 - | builder.build()
|
2967 - | }
|
2968 - | }
|
2969 - | /// A builder for [`Farewell`](crate::model::Farewell).
|
2970 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
2971 - | pub struct Builder {
|
2972 - | pub(crate) phrase: ::std::option::Option<::std::string::String>,
|
2973 - | }
|
2974 - | impl Builder {
|
2975 4943 | #[allow(missing_docs)] // documentation missing in model
|
2976 - | pub fn phrase(mut self, input: ::std::string::String) -> Self {
|
2977 - | self.phrase = Some(input);
|
4944 + | pub fn default_blob(mut self, input: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
4945 + | self.default_blob = Some(input);
|
2978 4946 | self
|
2979 4947 | }
|
2980 - | /// Consumes the builder and constructs a [`Farewell`](crate::model::Farewell).
|
2981 - | pub fn build(self) -> crate::model::Farewell {
|
2982 - | self.build_enforcing_required_and_enum_traits()
|
2983 - | }
|
2984 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Farewell {
|
2985 - | crate::model::Farewell {
|
2986 - | phrase: self.phrase.unwrap_or_else(|| String::from("bye")),
|
2987 - | }
|
2988 - | }
|
2989 - | }
|
2990 - | }
|
2991 - | /// See [`TopLevel`](crate::model::TopLevel).
|
2992 - | pub(crate) mod top_level_internal {
|
2993 - |
|
2994 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
2995 - | /// Holds one variant for each of the ways the builder can fail.
|
2996 - | #[non_exhaustive]
|
2997 - | #[allow(clippy::enum_variant_names)]
|
2998 - | pub(crate) enum ConstraintViolation {
|
2999 - | /// `dialog` was not provided but it is required when building `TopLevel`.
|
3000 - | MissingDialog,
|
3001 - | }
|
3002 - | impl ::std::fmt::Display for ConstraintViolation {
|
3003 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3004 - | match self {
|
3005 - | ConstraintViolation::MissingDialog => write!(
|
3006 - | f,
|
3007 - | "`dialog` was not provided but it is required when building `TopLevel`"
|
3008 - | ),
|
3009 - | }
|
3010 - | }
|
3011 - | }
|
3012 - | impl ::std::error::Error for ConstraintViolation {}
|
3013 - | impl ConstraintViolation {
|
3014 - | pub(crate) fn as_validation_exception_field(
|
3015 - | self,
|
3016 - | path: ::std::string::String,
|
3017 - | ) -> crate::model::ValidationExceptionField {
|
3018 - | match self {
|
3019 - | ConstraintViolation::MissingDialog => crate::model::ValidationExceptionField {
|
3020 - | message: format!("Value at '{}/dialog' failed to satisfy constraint: Member must not be null", path),
|
3021 - | path: path + "/dialog",
|
3022 - | },
|
3023 - | }
|
3024 - | }
|
3025 - | }
|
3026 - | impl ::std::convert::From<Builder>
|
3027 - | for crate::constrained::MaybeConstrained<crate::model::TopLevel>
|
3028 - | {
|
3029 - | fn from(builder: Builder) -> Self {
|
3030 - | Self::Unconstrained(builder)
|
3031 - | }
|
4948 + | #[allow(missing_docs)] // documentation missing in model
|
4949 + | pub fn default_byte(mut self, input: i8) -> Self {
|
4950 + | self.default_byte = Some(input);
|
4951 + | self
|
3032 4952 | }
|
3033 - | impl ::std::convert::TryFrom<Builder> for crate::model::TopLevel {
|
3034 - | type Error = ConstraintViolation;
|
3035 - |
|
3036 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3037 - | builder.build()
|
4953 + | #[allow(missing_docs)] // documentation missing in model
|
4954 + | pub fn default_short(mut self, input: i16) -> Self {
|
4955 + | self.default_short = Some(input);
|
4956 + | self
|
3038 4957 | }
|
4958 + | #[allow(missing_docs)] // documentation missing in model
|
4959 + | pub fn default_integer(mut self, input: i32) -> Self {
|
4960 + | self.default_integer = Some(input);
|
4961 + | self
|
3039 4962 | }
|
3040 - | /// A builder for [`TopLevel`](crate::model::TopLevel).
|
3041 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3042 - | pub(crate) struct Builder {
|
3043 - | pub(crate) dialog: ::std::option::Option<crate::model::Dialog>,
|
3044 - | pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::model::Dialog>>,
|
3045 - | pub(crate) dialog_map: ::std::option::Option<
|
3046 - | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3047 - | >,
|
4963 + | #[allow(missing_docs)] // documentation missing in model
|
4964 + | pub fn default_long(mut self, input: i64) -> Self {
|
4965 + | self.default_long = Some(input);
|
4966 + | self
|
3048 4967 | }
|
3049 - | impl Builder {
|
3050 4968 | #[allow(missing_docs)] // documentation missing in model
|
3051 - | pub(crate) fn set_dialog(
|
3052 - | mut self,
|
3053 - | input: impl ::std::convert::Into<crate::model::Dialog>,
|
3054 - | ) -> Self {
|
3055 - | self.dialog = Some(input.into());
|
4969 + | pub fn default_float(mut self, input: f32) -> Self {
|
4970 + | self.default_float = Some(input);
|
3056 4971 | self
|
3057 4972 | }
|
3058 4973 | #[allow(missing_docs)] // documentation missing in model
|
3059 - | pub(crate) fn set_dialog_list(
|
3060 - | mut self,
|
3061 - | input: impl ::std::convert::Into<::std::vec::Vec<crate::model::Dialog>>,
|
3062 - | ) -> Self {
|
3063 - | self.dialog_list = Some(input.into());
|
4974 + | pub fn default_double(mut self, input: f64) -> Self {
|
4975 + | self.default_double = Some(input);
|
3064 4976 | self
|
3065 4977 | }
|
3066 4978 | #[allow(missing_docs)] // documentation missing in model
|
3067 - | pub(crate) fn set_dialog_map(
|
4979 + | pub fn default_map(
|
3068 4980 | mut self,
|
3069 - | input: impl ::std::convert::Into<
|
3070 - | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3071 - | >,
|
4981 + | input: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3072 4982 | ) -> Self {
|
3073 - | self.dialog_map = Some(input.into());
|
4983 + | self.default_map = Some(input);
|
3074 4984 | self
|
3075 4985 | }
|
3076 - | /// Consumes the builder and constructs a [`TopLevel`](crate::model::TopLevel).
|
3077 - | ///
|
3078 - | /// The builder fails to construct a [`TopLevel`](crate::model::TopLevel) if a [`ConstraintViolation`] occurs.
|
3079 - | ///
|
3080 - | pub fn build(self) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
3081 - | self.build_enforcing_all_constraints()
|
3082 - | }
|
3083 - | fn build_enforcing_all_constraints(
|
3084 - | self,
|
3085 - | ) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
3086 - | Ok(crate::model::TopLevel {
|
3087 - | dialog: self.dialog.ok_or(ConstraintViolation::MissingDialog)?,
|
3088 - | dialog_list: self.dialog_list.unwrap_or_default(),
|
3089 - | dialog_map: self.dialog_map.unwrap_or_default(),
|
3090 - | })
|
3091 - | }
|
4986 + | #[allow(missing_docs)] // documentation missing in model
|
4987 + | pub fn default_enum(mut self, input: crate::model::TestEnum) -> Self {
|
4988 + | self.default_enum = Some(input);
|
4989 + | self
|
3092 4990 | }
|
3093 - | }
|
3094 - | /// See [`TopLevel`](crate::model::TopLevel).
|
3095 - | pub mod top_level {
|
3096 - |
|
3097 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3098 - | /// Holds one variant for each of the ways the builder can fail.
|
3099 - | #[allow(clippy::enum_variant_names)]
|
3100 - | pub enum ConstraintViolation {
|
3101 - | /// `dialog` was not provided but it is required when building `TopLevel`.
|
3102 - | MissingDialog,
|
4991 + | #[allow(missing_docs)] // documentation missing in model
|
4992 + | pub fn default_int_enum(mut self, input: i32) -> Self {
|
4993 + | self.default_int_enum = Some(input);
|
4994 + | self
|
3103 4995 | }
|
3104 - | impl ::std::fmt::Display for ConstraintViolation {
|
3105 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3106 - | match self {
|
3107 - | ConstraintViolation::MissingDialog => write!(
|
3108 - | f,
|
3109 - | "`dialog` was not provided but it is required when building `TopLevel`"
|
3110 - | ),
|
4996 + | #[allow(missing_docs)] // documentation missing in model
|
4997 + | pub fn empty_string(mut self, input: ::std::string::String) -> Self {
|
4998 + | self.empty_string = Some(input);
|
4999 + | self
|
3111 5000 | }
|
5001 + | #[allow(missing_docs)] // documentation missing in model
|
5002 + | pub fn false_boolean(mut self, input: bool) -> Self {
|
5003 + | self.false_boolean = Some(input);
|
5004 + | self
|
3112 5005 | }
|
5006 + | #[allow(missing_docs)] // documentation missing in model
|
5007 + | pub fn empty_blob(mut self, input: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
5008 + | self.empty_blob = Some(input);
|
5009 + | self
|
3113 5010 | }
|
3114 - | impl ::std::error::Error for ConstraintViolation {}
|
3115 - | impl ::std::convert::TryFrom<Builder> for crate::model::TopLevel {
|
3116 - | type Error = ConstraintViolation;
|
3117 - |
|
3118 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3119 - | builder.build()
|
5011 + | #[allow(missing_docs)] // documentation missing in model
|
5012 + | pub fn zero_byte(mut self, input: i8) -> Self {
|
5013 + | self.zero_byte = Some(input);
|
5014 + | self
|
3120 5015 | }
|
5016 + | #[allow(missing_docs)] // documentation missing in model
|
5017 + | pub fn zero_short(mut self, input: i16) -> Self {
|
5018 + | self.zero_short = Some(input);
|
5019 + | self
|
3121 5020 | }
|
3122 - | /// A builder for [`TopLevel`](crate::model::TopLevel).
|
3123 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3124 - | pub struct Builder {
|
3125 - | pub(crate) dialog: ::std::option::Option<crate::model::Dialog>,
|
3126 - | pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::model::Dialog>>,
|
3127 - | pub(crate) dialog_map: ::std::option::Option<
|
3128 - | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3129 - | >,
|
5021 + | #[allow(missing_docs)] // documentation missing in model
|
5022 + | pub fn zero_integer(mut self, input: i32) -> Self {
|
5023 + | self.zero_integer = Some(input);
|
5024 + | self
|
3130 5025 | }
|
3131 - | impl Builder {
|
3132 5026 | #[allow(missing_docs)] // documentation missing in model
|
3133 - | pub fn dialog(mut self, input: crate::model::Dialog) -> Self {
|
3134 - | self.dialog = Some(input);
|
5027 + | pub fn zero_long(mut self, input: i64) -> Self {
|
5028 + | self.zero_long = Some(input);
|
3135 5029 | self
|
3136 5030 | }
|
3137 5031 | #[allow(missing_docs)] // documentation missing in model
|
3138 - | pub fn dialog_list(mut self, input: ::std::vec::Vec<crate::model::Dialog>) -> Self {
|
3139 - | self.dialog_list = Some(input);
|
5032 + | pub fn zero_float(mut self, input: f32) -> Self {
|
5033 + | self.zero_float = Some(input);
|
3140 5034 | self
|
3141 5035 | }
|
3142 5036 | #[allow(missing_docs)] // documentation missing in model
|
3143 - | pub fn dialog_map(
|
3144 - | mut self,
|
3145 - | input: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3146 - | ) -> Self {
|
3147 - | self.dialog_map = Some(input);
|
5037 + | pub fn zero_double(mut self, input: f64) -> Self {
|
5038 + | self.zero_double = Some(input);
|
3148 5039 | self
|
3149 5040 | }
|
3150 - | /// Consumes the builder and constructs a [`TopLevel`](crate::model::TopLevel).
|
3151 - | ///
|
3152 - | /// The builder fails to construct a [`TopLevel`](crate::model::TopLevel) if you do not provide a value for all non-`Option`al members.
|
3153 - | ///
|
3154 - | pub fn build(self) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
5041 + | /// Consumes the builder and constructs a [`Defaults`](crate::model::Defaults).
|
5042 + | pub fn build(self) -> crate::model::Defaults {
|
3155 5043 | self.build_enforcing_required_and_enum_traits()
|
3156 5044 | }
|
3157 - | fn build_enforcing_required_and_enum_traits(
|
3158 - | self,
|
3159 - | ) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
3160 - | Ok(crate::model::TopLevel {
|
3161 - | dialog: self.dialog.ok_or(ConstraintViolation::MissingDialog)?,
|
3162 - | dialog_list: self.dialog_list.unwrap_or_default(),
|
3163 - | dialog_map: self.dialog_map.unwrap_or_default(),
|
3164 - | })
|
5045 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Defaults {
|
5046 + | crate::model::Defaults {
|
5047 + | default_string: self.default_string.unwrap_or_else(|| String::from("hi")),
|
5048 + | default_boolean: self.default_boolean.unwrap_or(true),
|
5049 + | default_list: self.default_list.unwrap_or_default(),
|
5050 + | default_document_map: self.default_document_map.unwrap_or_else(|| {
|
5051 + | ::aws_smithy_types::Document::Object(::std::collections::HashMap::new()).into()
|
5052 + | }),
|
5053 + | default_document_string: self.default_document_string.unwrap_or_else(|| {
|
5054 + | ::aws_smithy_types::Document::String(::std::string::String::from("hi")).into()
|
5055 + | }),
|
5056 + | default_document_boolean: self
|
5057 + | .default_document_boolean
|
5058 + | .unwrap_or(::aws_smithy_types::Document::Bool(true).into()),
|
5059 + | default_document_list: self.default_document_list.unwrap_or_else(|| {
|
5060 + | ::aws_smithy_types::Document::Array(::std::vec::Vec::new()).into()
|
5061 + | }),
|
5062 + | default_null_document: self.default_null_document,
|
5063 + | default_timestamp: self.default_timestamp.unwrap_or_else(|| {
|
5064 + | ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64).into()
|
5065 + | }),
|
5066 + | default_blob: self
|
5067 + | .default_blob
|
5068 + | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("YWJj").into()),
|
5069 + | default_byte: self.default_byte.unwrap_or(1i8),
|
5070 + | default_short: self.default_short.unwrap_or(1i16),
|
5071 + | default_integer: self.default_integer.unwrap_or(10i32),
|
5072 + | default_long: self.default_long.unwrap_or(100i64),
|
5073 + | default_float: self.default_float.unwrap_or(1.0f32),
|
5074 + | default_double: self.default_double.unwrap_or(1.0f64),
|
5075 + | default_map: self.default_map.unwrap_or_default(),
|
5076 + | default_enum: self.default_enum.unwrap_or(
|
5077 + | "FOO"
|
5078 + | .parse::<crate::model::TestEnum>()
|
5079 + | .expect("static value validated to member"),
|
5080 + | ),
|
5081 + | default_int_enum: self.default_int_enum.unwrap_or(1i32),
|
5082 + | empty_string: self.empty_string.unwrap_or_else(|| String::from("")),
|
5083 + | false_boolean: self.false_boolean.unwrap_or(false),
|
5084 + | empty_blob: self
|
5085 + | .empty_blob
|
5086 + | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("").into()),
|
5087 + | zero_byte: self.zero_byte.unwrap_or(0i8),
|
5088 + | zero_short: self.zero_short.unwrap_or(0i16),
|
5089 + | zero_integer: self.zero_integer.unwrap_or(0i32),
|
5090 + | zero_long: self.zero_long.unwrap_or(0i64),
|
5091 + | zero_float: self.zero_float.unwrap_or(0.0f32),
|
5092 + | zero_double: self.zero_double.unwrap_or(0.0f64),
|
5093 + | }
|
3165 5094 | }
|
3166 5095 | }
|
3167 5096 | }
|
3168 5097 | /// See [`ClientOptionalDefaults`](crate::model::ClientOptionalDefaults).
|
3169 5098 | pub(crate) mod client_optional_defaults_internal {
|
3170 5099 |
|
3171 5100 | impl ::std::convert::From<Builder> for crate::model::ClientOptionalDefaults {
|
3172 5101 | fn from(builder: Builder) -> Self {
|
3173 5102 | builder.build()
|
3174 5103 | }
|
3218 5147 | pub fn build(self) -> crate::model::ClientOptionalDefaults {
|
3219 5148 | self.build_enforcing_required_and_enum_traits()
|
3220 5149 | }
|
3221 5150 | fn build_enforcing_required_and_enum_traits(self) -> crate::model::ClientOptionalDefaults {
|
3222 5151 | crate::model::ClientOptionalDefaults {
|
3223 5152 | member: self.member.unwrap_or(0i32),
|
3224 5153 | }
|
3225 5154 | }
|
3226 5155 | }
|
3227 5156 | }
|
3228 - | /// See [`Defaults`](crate::model::Defaults).
|
3229 - | pub(crate) mod defaults_internal {
|
5157 + | /// See [`TopLevel`](crate::model::TopLevel).
|
5158 + | pub(crate) mod top_level_internal {
|
3230 5159 |
|
3231 5160 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
3232 5161 | /// Holds one variant for each of the ways the builder can fail.
|
3233 5162 | #[non_exhaustive]
|
3234 5163 | #[allow(clippy::enum_variant_names)]
|
3235 5164 | pub(crate) enum ConstraintViolation {
|
3236 - | /// Constraint violation occurred building member `default_enum` when building `Defaults`.
|
3237 - | #[doc(hidden)]
|
3238 - | DefaultEnum(crate::model::test_enum_internal::ConstraintViolation),
|
5165 + | /// `dialog` was not provided but it is required when building `TopLevel`.
|
5166 + | MissingDialog,
|
3239 5167 | }
|
3240 5168 | impl ::std::fmt::Display for ConstraintViolation {
|
3241 5169 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
3242 5170 | match self {
|
3243 - | ConstraintViolation::DefaultEnum(_) => write!(f, "constraint violation occurred building member `default_enum` when building `Defaults`"),
|
5171 + | ConstraintViolation::MissingDialog => write!(
|
5172 + | f,
|
5173 + | "`dialog` was not provided but it is required when building `TopLevel`"
|
5174 + | ),
|
3244 5175 | }
|
3245 5176 | }
|
3246 5177 | }
|
3247 5178 | impl ::std::error::Error for ConstraintViolation {}
|
3248 5179 | impl ConstraintViolation {
|
3249 5180 | pub(crate) fn as_validation_exception_field(
|
3250 5181 | self,
|
3251 5182 | path: ::std::string::String,
|
3252 5183 | ) -> crate::model::ValidationExceptionField {
|
3253 5184 | match self {
|
3254 - | ConstraintViolation::DefaultEnum(inner) => {
|
3255 - | inner.as_validation_exception_field(path + "/defaultEnum")
|
3256 - | }
|
5185 + | ConstraintViolation::MissingDialog => crate::model::ValidationExceptionField {
|
5186 + | message: format!("Value at '{}/dialog' failed to satisfy constraint: Member must not be null", path),
|
5187 + | path: path + "/dialog",
|
5188 + | },
|
3257 5189 | }
|
3258 5190 | }
|
3259 5191 | }
|
3260 5192 | impl ::std::convert::From<Builder>
|
3261 - | for crate::constrained::MaybeConstrained<crate::model::Defaults>
|
5193 + | for crate::constrained::MaybeConstrained<crate::model::TopLevel>
|
3262 5194 | {
|
3263 5195 | fn from(builder: Builder) -> Self {
|
3264 5196 | Self::Unconstrained(builder)
|
3265 5197 | }
|
3266 5198 | }
|
3267 - | impl ::std::convert::TryFrom<Builder> for crate::model::Defaults {
|
5199 + | impl ::std::convert::TryFrom<Builder> for crate::model::TopLevel {
|
3268 5200 | type Error = ConstraintViolation;
|
3269 5201 |
|
3270 - | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
3271 - | builder.build()
|
3272 - | }
|
3273 - | }
|
3274 - | /// A builder for [`Defaults`](crate::model::Defaults).
|
3275 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3276 - | pub(crate) struct Builder {
|
3277 - | pub(crate) default_string: ::std::option::Option<::std::string::String>,
|
3278 - | pub(crate) default_boolean: ::std::option::Option<bool>,
|
3279 - | pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
3280 - | pub(crate) default_document_map:
|
3281 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3282 - | pub(crate) default_document_string:
|
3283 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3284 - | pub(crate) default_document_boolean:
|
3285 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3286 - | pub(crate) default_document_list:
|
3287 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3288 - | pub(crate) default_null_document:
|
3289 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3290 - | pub(crate) default_timestamp:
|
3291 - | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
3292 - | pub(crate) default_blob:
|
3293 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3294 - | pub(crate) default_byte: ::std::option::Option<i8>,
|
3295 - | pub(crate) default_short: ::std::option::Option<i16>,
|
3296 - | pub(crate) default_integer: ::std::option::Option<i32>,
|
3297 - | pub(crate) default_long: ::std::option::Option<i64>,
|
3298 - | pub(crate) default_float: ::std::option::Option<f32>,
|
3299 - | pub(crate) default_double: ::std::option::Option<f64>,
|
3300 - | pub(crate) default_map: ::std::option::Option<
|
3301 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
5202 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5203 + | builder.build()
|
5204 + | }
|
5205 + | }
|
5206 + | /// A builder for [`TopLevel`](crate::model::TopLevel).
|
5207 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5208 + | pub(crate) struct Builder {
|
5209 + | pub(crate) dialog: ::std::option::Option<crate::model::Dialog>,
|
5210 + | pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::model::Dialog>>,
|
5211 + | pub(crate) dialog_map: ::std::option::Option<
|
5212 + | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3302 5213 | >,
|
3303 - | pub(crate) default_enum:
|
3304 - | ::std::option::Option<crate::constrained::MaybeConstrained<crate::model::TestEnum>>,
|
3305 - | pub(crate) default_int_enum: ::std::option::Option<i32>,
|
3306 - | pub(crate) empty_string: ::std::option::Option<::std::string::String>,
|
3307 - | pub(crate) false_boolean: ::std::option::Option<bool>,
|
3308 - | pub(crate) empty_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3309 - | pub(crate) zero_byte: ::std::option::Option<i8>,
|
3310 - | pub(crate) zero_short: ::std::option::Option<i16>,
|
3311 - | pub(crate) zero_integer: ::std::option::Option<i32>,
|
3312 - | pub(crate) zero_long: ::std::option::Option<i64>,
|
3313 - | pub(crate) zero_float: ::std::option::Option<f32>,
|
3314 - | pub(crate) zero_double: ::std::option::Option<f64>,
|
3315 5214 | }
|
3316 5215 | impl Builder {
|
3317 5216 | #[allow(missing_docs)] // documentation missing in model
|
3318 - | pub(crate) fn set_default_string(
|
5217 + | pub(crate) fn set_dialog(
|
3319 5218 | mut self,
|
3320 - | input: impl ::std::convert::Into<::std::string::String>,
|
5219 + | input: impl ::std::convert::Into<crate::model::Dialog>,
|
3321 5220 | ) -> Self {
|
3322 - | self.default_string = Some(input.into());
|
5221 + | self.dialog = Some(input.into());
|
3323 5222 | self
|
3324 5223 | }
|
3325 5224 | #[allow(missing_docs)] // documentation missing in model
|
3326 - | pub(crate) fn set_default_boolean(
|
5225 + | pub(crate) fn set_dialog_list(
|
3327 5226 | mut self,
|
3328 - | input: impl ::std::convert::Into<bool>,
|
5227 + | input: impl ::std::convert::Into<::std::vec::Vec<crate::model::Dialog>>,
|
3329 5228 | ) -> Self {
|
3330 - | self.default_boolean = Some(input.into());
|
5229 + | self.dialog_list = Some(input.into());
|
3331 5230 | self
|
3332 5231 | }
|
3333 5232 | #[allow(missing_docs)] // documentation missing in model
|
3334 - | pub(crate) fn set_default_list(
|
5233 + | pub(crate) fn set_dialog_map(
|
3335 5234 | mut self,
|
3336 - | input: impl ::std::convert::Into<::std::vec::Vec<::std::string::String>>,
|
5235 + | input: impl ::std::convert::Into<
|
5236 + | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
5237 + | >,
|
3337 5238 | ) -> Self {
|
3338 - | self.default_list = Some(input.into());
|
5239 + | self.dialog_map = Some(input.into());
|
3339 5240 | self
|
3340 5241 | }
|
3341 - | #[allow(missing_docs)] // documentation missing in model
|
3342 - | pub(crate) fn set_default_document_map(
|
3343 - | mut self,
|
3344 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
3345 - | ) -> Self {
|
3346 - | self.default_document_map = Some(input.into());
|
3347 - | self
|
5242 + | /// Consumes the builder and constructs a [`TopLevel`](crate::model::TopLevel).
|
5243 + | ///
|
5244 + | /// The builder fails to construct a [`TopLevel`](crate::model::TopLevel) if a [`ConstraintViolation`] occurs.
|
5245 + | ///
|
5246 + | pub fn build(self) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
5247 + | self.build_enforcing_all_constraints()
|
3348 5248 | }
|
3349 - | #[allow(missing_docs)] // documentation missing in model
|
3350 - | pub(crate) fn set_default_document_string(
|
3351 - | mut self,
|
3352 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
3353 - | ) -> Self {
|
3354 - | self.default_document_string = Some(input.into());
|
3355 - | self
|
5249 + | fn build_enforcing_all_constraints(
|
5250 + | self,
|
5251 + | ) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
5252 + | Ok(crate::model::TopLevel {
|
5253 + | dialog: self.dialog.ok_or(ConstraintViolation::MissingDialog)?,
|
5254 + | dialog_list: self.dialog_list.unwrap_or_default(),
|
5255 + | dialog_map: self.dialog_map.unwrap_or_default(),
|
5256 + | })
|
3356 5257 | }
|
3357 - | #[allow(missing_docs)] // documentation missing in model
|
3358 - | pub(crate) fn set_default_document_boolean(
|
3359 - | mut self,
|
3360 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
3361 - | ) -> Self {
|
3362 - | self.default_document_boolean = Some(input.into());
|
3363 - | self
|
3364 5258 | }
|
3365 - | #[allow(missing_docs)] // documentation missing in model
|
3366 - | pub(crate) fn set_default_document_list(
|
3367 - | mut self,
|
3368 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
3369 - | ) -> Self {
|
3370 - | self.default_document_list = Some(input.into());
|
3371 - | self
|
5259 + | }
|
5260 + | /// See [`TopLevel`](crate::model::TopLevel).
|
5261 + | pub mod top_level {
|
5262 + |
|
5263 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5264 + | /// Holds one variant for each of the ways the builder can fail.
|
5265 + | #[allow(clippy::enum_variant_names)]
|
5266 + | pub enum ConstraintViolation {
|
5267 + | /// `dialog` was not provided but it is required when building `TopLevel`.
|
5268 + | MissingDialog,
|
3372 5269 | }
|
3373 - | #[allow(missing_docs)] // documentation missing in model
|
3374 - | pub(crate) fn set_default_null_document(
|
3375 - | mut self,
|
3376 - | input: Option<
|
3377 - | impl ::std::convert::Into<::aws_smithy_http_server_python::types::Document>,
|
5270 + | impl ::std::fmt::Display for ConstraintViolation {
|
5271 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5272 + | match self {
|
5273 + | ConstraintViolation::MissingDialog => write!(
|
5274 + | f,
|
5275 + | "`dialog` was not provided but it is required when building `TopLevel`"
|
5276 + | ),
|
5277 + | }
|
5278 + | }
|
5279 + | }
|
5280 + | impl ::std::error::Error for ConstraintViolation {}
|
5281 + | impl ::std::convert::TryFrom<Builder> for crate::model::TopLevel {
|
5282 + | type Error = ConstraintViolation;
|
5283 + |
|
5284 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5285 + | builder.build()
|
5286 + | }
|
5287 + | }
|
5288 + | /// A builder for [`TopLevel`](crate::model::TopLevel).
|
5289 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5290 + | pub struct Builder {
|
5291 + | pub(crate) dialog: ::std::option::Option<crate::model::Dialog>,
|
5292 + | pub(crate) dialog_list: ::std::option::Option<::std::vec::Vec<crate::model::Dialog>>,
|
5293 + | pub(crate) dialog_map: ::std::option::Option<
|
5294 + | ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3378 5295 | >,
|
3379 - | ) -> Self {
|
3380 - | self.default_null_document = input.map(|v| v.into());
|
5296 + | }
|
5297 + | impl Builder {
|
5298 + | #[allow(missing_docs)] // documentation missing in model
|
5299 + | pub fn dialog(mut self, input: crate::model::Dialog) -> Self {
|
5300 + | self.dialog = Some(input);
|
3381 5301 | self
|
3382 5302 | }
|
3383 5303 | #[allow(missing_docs)] // documentation missing in model
|
3384 - | pub(crate) fn set_default_timestamp(
|
3385 - | mut self,
|
3386 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::DateTime>,
|
3387 - | ) -> Self {
|
3388 - | self.default_timestamp = Some(input.into());
|
5304 + | pub fn dialog_list(mut self, input: ::std::vec::Vec<crate::model::Dialog>) -> Self {
|
5305 + | self.dialog_list = Some(input);
|
3389 5306 | self
|
3390 5307 | }
|
3391 5308 | #[allow(missing_docs)] // documentation missing in model
|
3392 - | pub(crate) fn set_default_blob(
|
5309 + | pub fn dialog_map(
|
3393 5310 | mut self,
|
3394 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>,
|
5311 + | input: ::std::collections::HashMap<::std::string::String, crate::model::Dialog>,
|
3395 5312 | ) -> Self {
|
3396 - | self.default_blob = Some(input.into());
|
5313 + | self.dialog_map = Some(input);
|
3397 5314 | self
|
3398 5315 | }
|
3399 - | #[allow(missing_docs)] // documentation missing in model
|
3400 - | pub(crate) fn set_default_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
3401 - | self.default_byte = Some(input.into());
|
3402 - | self
|
5316 + | /// Consumes the builder and constructs a [`TopLevel`](crate::model::TopLevel).
|
5317 + | ///
|
5318 + | /// The builder fails to construct a [`TopLevel`](crate::model::TopLevel) if you do not provide a value for all non-`Option`al members.
|
5319 + | ///
|
5320 + | pub fn build(self) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
5321 + | self.build_enforcing_required_and_enum_traits()
|
3403 5322 | }
|
3404 - | #[allow(missing_docs)] // documentation missing in model
|
3405 - | pub(crate) fn set_default_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
3406 - | self.default_short = Some(input.into());
|
3407 - | self
|
5323 + | fn build_enforcing_required_and_enum_traits(
|
5324 + | self,
|
5325 + | ) -> Result<crate::model::TopLevel, ConstraintViolation> {
|
5326 + | Ok(crate::model::TopLevel {
|
5327 + | dialog: self.dialog.ok_or(ConstraintViolation::MissingDialog)?,
|
5328 + | dialog_list: self.dialog_list.unwrap_or_default(),
|
5329 + | dialog_map: self.dialog_map.unwrap_or_default(),
|
5330 + | })
|
3408 5331 | }
|
3409 - | #[allow(missing_docs)] // documentation missing in model
|
3410 - | pub(crate) fn set_default_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
3411 - | self.default_integer = Some(input.into());
|
3412 - | self
|
3413 5332 | }
|
3414 - | #[allow(missing_docs)] // documentation missing in model
|
3415 - | pub(crate) fn set_default_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
3416 - | self.default_long = Some(input.into());
|
3417 - | self
|
5333 + | }
|
5334 + | /// See [`Dialog`](crate::model::Dialog).
|
5335 + | pub(crate) mod dialog_internal {
|
5336 + |
|
5337 + | impl ::std::convert::From<Builder> for crate::model::Dialog {
|
5338 + | fn from(builder: Builder) -> Self {
|
5339 + | builder.build()
|
3418 5340 | }
|
3419 - | #[allow(missing_docs)] // documentation missing in model
|
3420 - | pub(crate) fn set_default_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
3421 - | self.default_float = Some(input.into());
|
3422 - | self
|
3423 5341 | }
|
3424 - | #[allow(missing_docs)] // documentation missing in model
|
3425 - | pub(crate) fn set_default_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
3426 - | self.default_double = Some(input.into());
|
3427 - | self
|
5342 + | /// A builder for [`Dialog`](crate::model::Dialog).
|
5343 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5344 + | pub(crate) struct Builder {
|
5345 + | pub(crate) language: ::std::option::Option<::std::string::String>,
|
5346 + | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
5347 + | pub(crate) farewell: ::std::option::Option<crate::model::Farewell>,
|
3428 5348 | }
|
5349 + | impl Builder {
|
3429 5350 | #[allow(missing_docs)] // documentation missing in model
|
3430 - | pub(crate) fn set_default_map(
|
5351 + | pub(crate) fn set_language(
|
3431 5352 | mut self,
|
3432 - | input: impl ::std::convert::Into<
|
3433 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3434 - | >,
|
5353 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3435 5354 | ) -> Self {
|
3436 - | self.default_map = Some(input.into());
|
5355 + | self.language = input.map(|v| v.into());
|
3437 5356 | self
|
3438 5357 | }
|
3439 5358 | #[allow(missing_docs)] // documentation missing in model
|
3440 - | pub(crate) fn set_default_enum(
|
5359 + | pub(crate) fn set_greeting(
|
3441 5360 | mut self,
|
3442 - | input: impl ::std::convert::Into<
|
3443 - | crate::constrained::MaybeConstrained<crate::model::TestEnum>,
|
3444 - | >,
|
5361 + | input: impl ::std::convert::Into<::std::string::String>,
|
3445 5362 | ) -> Self {
|
3446 - | self.default_enum = Some(input.into());
|
5363 + | self.greeting = Some(input.into());
|
3447 5364 | self
|
3448 5365 | }
|
3449 5366 | #[allow(missing_docs)] // documentation missing in model
|
3450 - | pub(crate) fn set_default_int_enum(
|
5367 + | pub(crate) fn set_farewell(
|
3451 5368 | mut self,
|
3452 - | input: impl ::std::convert::Into<i32>,
|
5369 + | input: Option<impl ::std::convert::Into<crate::model::Farewell>>,
|
3453 5370 | ) -> Self {
|
3454 - | self.default_int_enum = Some(input.into());
|
5371 + | self.farewell = input.map(|v| v.into());
|
3455 5372 | self
|
3456 5373 | }
|
3457 - | #[allow(missing_docs)] // documentation missing in model
|
3458 - | pub(crate) fn set_empty_string(
|
3459 - | mut self,
|
3460 - | input: impl ::std::convert::Into<::std::string::String>,
|
3461 - | ) -> Self {
|
3462 - | self.empty_string = Some(input.into());
|
3463 - | self
|
5374 + | /// Consumes the builder and constructs a [`Dialog`](crate::model::Dialog).
|
5375 + | pub fn build(self) -> crate::model::Dialog {
|
5376 + | self.build_enforcing_all_constraints()
|
3464 5377 | }
|
3465 - | #[allow(missing_docs)] // documentation missing in model
|
3466 - | pub(crate) fn set_false_boolean(mut self, input: impl ::std::convert::Into<bool>) -> Self {
|
3467 - | self.false_boolean = Some(input.into());
|
3468 - | self
|
5378 + | fn build_enforcing_all_constraints(self) -> crate::model::Dialog {
|
5379 + | crate::model::Dialog {
|
5380 + | language: self.language,
|
5381 + | greeting: self.greeting.unwrap_or_else(|| String::from("hi")),
|
5382 + | farewell: self.farewell,
|
5383 + | }
|
5384 + | }
|
5385 + | }
|
5386 + | }
|
5387 + | /// See [`Dialog`](crate::model::Dialog).
|
5388 + | pub mod dialog {
|
5389 + |
|
5390 + | impl ::std::convert::From<Builder> for crate::model::Dialog {
|
5391 + | fn from(builder: Builder) -> Self {
|
5392 + | builder.build()
|
5393 + | }
|
5394 + | }
|
5395 + | /// A builder for [`Dialog`](crate::model::Dialog).
|
5396 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5397 + | pub struct Builder {
|
5398 + | pub(crate) language: ::std::option::Option<::std::string::String>,
|
5399 + | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
5400 + | pub(crate) farewell: ::std::option::Option<crate::model::Farewell>,
|
3469 5401 | }
|
5402 + | impl Builder {
|
3470 5403 | #[allow(missing_docs)] // documentation missing in model
|
3471 - | pub(crate) fn set_empty_blob(
|
3472 - | mut self,
|
3473 - | input: impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>,
|
3474 - | ) -> Self {
|
3475 - | self.empty_blob = Some(input.into());
|
5404 + | pub fn language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5405 + | self.language = input;
|
3476 5406 | self
|
3477 5407 | }
|
3478 5408 | #[allow(missing_docs)] // documentation missing in model
|
3479 - | pub(crate) fn set_zero_byte(mut self, input: impl ::std::convert::Into<i8>) -> Self {
|
3480 - | self.zero_byte = Some(input.into());
|
5409 + | pub fn greeting(mut self, input: ::std::string::String) -> Self {
|
5410 + | self.greeting = Some(input);
|
3481 5411 | self
|
3482 5412 | }
|
3483 5413 | #[allow(missing_docs)] // documentation missing in model
|
3484 - | pub(crate) fn set_zero_short(mut self, input: impl ::std::convert::Into<i16>) -> Self {
|
3485 - | self.zero_short = Some(input.into());
|
5414 + | pub fn farewell(mut self, input: ::std::option::Option<crate::model::Farewell>) -> Self {
|
5415 + | self.farewell = input;
|
3486 5416 | self
|
3487 5417 | }
|
3488 - | #[allow(missing_docs)] // documentation missing in model
|
3489 - | pub(crate) fn set_zero_integer(mut self, input: impl ::std::convert::Into<i32>) -> Self {
|
3490 - | self.zero_integer = Some(input.into());
|
3491 - | self
|
5418 + | /// Consumes the builder and constructs a [`Dialog`](crate::model::Dialog).
|
5419 + | pub fn build(self) -> crate::model::Dialog {
|
5420 + | self.build_enforcing_required_and_enum_traits()
|
3492 5421 | }
|
3493 - | #[allow(missing_docs)] // documentation missing in model
|
3494 - | pub(crate) fn set_zero_long(mut self, input: impl ::std::convert::Into<i64>) -> Self {
|
3495 - | self.zero_long = Some(input.into());
|
3496 - | self
|
5422 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Dialog {
|
5423 + | crate::model::Dialog {
|
5424 + | language: self.language,
|
5425 + | greeting: self.greeting.unwrap_or_else(|| String::from("hi")),
|
5426 + | farewell: self.farewell,
|
3497 5427 | }
|
3498 - | #[allow(missing_docs)] // documentation missing in model
|
3499 - | pub(crate) fn set_zero_float(mut self, input: impl ::std::convert::Into<f32>) -> Self {
|
3500 - | self.zero_float = Some(input.into());
|
5428 + | }
|
5429 + | }
|
5430 + | }
|
5431 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
5432 + | pub mod validation_exception_field {
|
5433 + |
|
5434 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5435 + | /// Holds one variant for each of the ways the builder can fail.
|
5436 + | #[allow(clippy::enum_variant_names)]
|
5437 + | pub enum ConstraintViolation {
|
5438 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
5439 + | MissingPath,
|
5440 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
5441 + | MissingMessage,
|
5442 + | }
|
5443 + | impl ::std::fmt::Display for ConstraintViolation {
|
5444 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
5445 + | match self {
|
5446 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
5447 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
5448 + | }
|
5449 + | }
|
5450 + | }
|
5451 + | impl ::std::error::Error for ConstraintViolation {}
|
5452 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
5453 + | type Error = ConstraintViolation;
|
5454 + |
|
5455 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
5456 + | builder.build()
|
5457 + | }
|
5458 + | }
|
5459 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
5460 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5461 + | pub struct Builder {
|
5462 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
5463 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
5464 + | }
|
5465 + | impl Builder {
|
5466 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
5467 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
5468 + | self.path = Some(input);
|
3501 5469 | self
|
3502 5470 | }
|
3503 - | #[allow(missing_docs)] // documentation missing in model
|
3504 - | pub(crate) fn set_zero_double(mut self, input: impl ::std::convert::Into<f64>) -> Self {
|
3505 - | self.zero_double = Some(input.into());
|
5471 + | /// A detailed description of the validation failure.
|
5472 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
5473 + | self.message = Some(input);
|
3506 5474 | self
|
3507 5475 | }
|
3508 - | /// Consumes the builder and constructs a [`Defaults`](crate::model::Defaults).
|
5476 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
3509 5477 | ///
|
3510 - | /// The builder fails to construct a [`Defaults`](crate::model::Defaults) if a [`ConstraintViolation`] occurs.
|
5478 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if you do not provide a value for all non-`Option`al members.
|
3511 5479 | ///
|
3512 - | pub fn build(self) -> Result<crate::model::Defaults, ConstraintViolation> {
|
3513 - | self.build_enforcing_all_constraints()
|
5480 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
5481 + | self.build_enforcing_required_and_enum_traits()
|
3514 5482 | }
|
3515 - | fn build_enforcing_all_constraints(
|
5483 + | fn build_enforcing_required_and_enum_traits(
|
3516 5484 | self,
|
3517 - | ) -> Result<crate::model::Defaults, ConstraintViolation> {
|
3518 - | Ok(crate::model::Defaults {
|
3519 - | default_string: self.default_string.unwrap_or_else(|| String::from("hi")),
|
3520 - | default_boolean: self.default_boolean.unwrap_or(true),
|
3521 - | default_list: self.default_list.unwrap_or_default(),
|
3522 - | default_document_map: self.default_document_map.unwrap_or_else(|| {
|
3523 - | ::aws_smithy_types::Document::Object(::std::collections::HashMap::new()).into()
|
3524 - | }),
|
3525 - | default_document_string: self.default_document_string.unwrap_or_else(|| {
|
3526 - | ::aws_smithy_types::Document::String(::std::string::String::from("hi")).into()
|
3527 - | }),
|
3528 - | default_document_boolean: self
|
3529 - | .default_document_boolean
|
3530 - | .unwrap_or(::aws_smithy_types::Document::Bool(true).into()),
|
3531 - | default_document_list: self.default_document_list.unwrap_or_else(|| {
|
3532 - | ::aws_smithy_types::Document::Array(::std::vec::Vec::new()).into()
|
3533 - | }),
|
3534 - | default_null_document: self.default_null_document,
|
3535 - | default_timestamp: self.default_timestamp.unwrap_or_else(|| {
|
3536 - | ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64).into()
|
3537 - | }),
|
3538 - | default_blob: self
|
3539 - | .default_blob
|
3540 - | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("YWJj").into()),
|
3541 - | default_byte: self.default_byte.unwrap_or(1i8),
|
3542 - | default_short: self.default_short.unwrap_or(1i16),
|
3543 - | default_integer: self.default_integer.unwrap_or(10i32),
|
3544 - | default_long: self.default_long.unwrap_or(100i64),
|
3545 - | default_float: self.default_float.unwrap_or(1.0f32),
|
3546 - | default_double: self.default_double.unwrap_or(1.0f64),
|
3547 - | default_map: self.default_map.unwrap_or_default(),
|
3548 - | default_enum: self
|
3549 - | .default_enum
|
3550 - | .map(|v| match v {
|
3551 - | crate::constrained::MaybeConstrained::Constrained(x) => Ok(x),
|
3552 - | crate::constrained::MaybeConstrained::Unconstrained(x) => x.try_into(),
|
3553 - | })
|
3554 - | .map(|res| res.map_err(ConstraintViolation::DefaultEnum))
|
3555 - | .transpose()?
|
3556 - | .unwrap_or(
|
3557 - | "FOO"
|
3558 - | .parse::<crate::model::TestEnum>()
|
3559 - | .expect("static value validated to member"),
|
3560 - | ),
|
3561 - | default_int_enum: self.default_int_enum.unwrap_or(1i32),
|
3562 - | empty_string: self.empty_string.unwrap_or_else(|| String::from("")),
|
3563 - | false_boolean: self.false_boolean.unwrap_or(false),
|
3564 - | empty_blob: self
|
3565 - | .empty_blob
|
3566 - | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("").into()),
|
3567 - | zero_byte: self.zero_byte.unwrap_or(0i8),
|
3568 - | zero_short: self.zero_short.unwrap_or(0i16),
|
3569 - | zero_integer: self.zero_integer.unwrap_or(0i32),
|
3570 - | zero_long: self.zero_long.unwrap_or(0i64),
|
3571 - | zero_float: self.zero_float.unwrap_or(0.0f32),
|
3572 - | zero_double: self.zero_double.unwrap_or(0.0f64),
|
5485 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
5486 + | Ok(crate::model::ValidationExceptionField {
|
5487 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
5488 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
3573 5489 | })
|
3574 5490 | }
|
3575 5491 | }
|
3576 5492 | }
|
3577 - | /// See [`Defaults`](crate::model::Defaults).
|
3578 - | pub mod defaults {
|
5493 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5494 + | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
3579 5495 |
|
3580 - | impl ::std::convert::From<Builder> for crate::model::Defaults {
|
5496 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
3581 5497 | fn from(builder: Builder) -> Self {
|
3582 5498 | builder.build()
|
3583 5499 | }
|
3584 5500 | }
|
3585 - | /// A builder for [`Defaults`](crate::model::Defaults).
|
5501 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
3586 5502 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3587 - | pub struct Builder {
|
3588 - | pub(crate) default_string: ::std::option::Option<::std::string::String>,
|
3589 - | pub(crate) default_boolean: ::std::option::Option<bool>,
|
3590 - | pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
|
3591 - | pub(crate) default_document_map:
|
3592 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3593 - | pub(crate) default_document_string:
|
3594 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3595 - | pub(crate) default_document_boolean:
|
3596 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3597 - | pub(crate) default_document_list:
|
3598 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3599 - | pub(crate) default_null_document:
|
3600 - | ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3601 - | pub(crate) default_timestamp:
|
3602 - | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
3603 - | pub(crate) default_blob:
|
3604 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3605 - | pub(crate) default_byte: ::std::option::Option<i8>,
|
3606 - | pub(crate) default_short: ::std::option::Option<i16>,
|
3607 - | pub(crate) default_integer: ::std::option::Option<i32>,
|
3608 - | pub(crate) default_long: ::std::option::Option<i64>,
|
3609 - | pub(crate) default_float: ::std::option::Option<f32>,
|
3610 - | pub(crate) default_double: ::std::option::Option<f64>,
|
3611 - | pub(crate) default_map: ::std::option::Option<
|
3612 - | ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
3613 - | >,
|
3614 - | pub(crate) default_enum: ::std::option::Option<crate::model::TestEnum>,
|
3615 - | pub(crate) default_int_enum: ::std::option::Option<i32>,
|
3616 - | pub(crate) empty_string: ::std::option::Option<::std::string::String>,
|
3617 - | pub(crate) false_boolean: ::std::option::Option<bool>,
|
3618 - | pub(crate) empty_blob: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
3619 - | pub(crate) zero_byte: ::std::option::Option<i8>,
|
3620 - | pub(crate) zero_short: ::std::option::Option<i16>,
|
3621 - | pub(crate) zero_integer: ::std::option::Option<i32>,
|
3622 - | pub(crate) zero_long: ::std::option::Option<i64>,
|
3623 - | pub(crate) zero_float: ::std::option::Option<f32>,
|
3624 - | pub(crate) zero_double: ::std::option::Option<f64>,
|
5503 + | pub(crate) struct Builder {
|
5504 + | pub(crate) bar: ::std::option::Option<::std::string::String>,
|
5505 + | pub(crate) recursive_member:
|
5506 + | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
3625 5507 | }
|
3626 5508 | impl Builder {
|
3627 5509 | #[allow(missing_docs)] // documentation missing in model
|
3628 - | pub fn default_string(mut self, input: ::std::string::String) -> Self {
|
3629 - | self.default_string = Some(input);
|
3630 - | self
|
3631 - | }
|
3632 - | #[allow(missing_docs)] // documentation missing in model
|
3633 - | pub fn default_boolean(mut self, input: bool) -> Self {
|
3634 - | self.default_boolean = Some(input);
|
3635 - | self
|
3636 - | }
|
3637 - | #[allow(missing_docs)] // documentation missing in model
|
3638 - | pub fn default_list(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
|
3639 - | self.default_list = Some(input);
|
3640 - | self
|
3641 - | }
|
3642 - | #[allow(missing_docs)] // documentation missing in model
|
3643 - | pub fn default_document_map(
|
5510 + | pub(crate) fn set_bar(
|
3644 5511 | mut self,
|
3645 - | input: ::aws_smithy_http_server_python::types::Document,
|
5512 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3646 5513 | ) -> Self {
|
3647 - | self.default_document_map = Some(input);
|
5514 + | self.bar = input.map(|v| v.into());
|
3648 5515 | self
|
3649 5516 | }
|
3650 5517 | #[allow(missing_docs)] // documentation missing in model
|
3651 - | pub fn default_document_string(
|
5518 + | pub(crate) fn set_recursive_member(
|
3652 5519 | mut self,
|
3653 - | input: ::aws_smithy_http_server_python::types::Document,
|
5520 + | input: Option<
|
5521 + | impl ::std::convert::Into<crate::model::RecursiveShapesInputOutputNested1>,
|
5522 + | >,
|
3654 5523 | ) -> Self {
|
3655 - | self.default_document_string = Some(input);
|
5524 + | self.recursive_member = input.map(|v| v.into());
|
3656 5525 | self
|
3657 5526 | }
|
3658 - | #[allow(missing_docs)] // documentation missing in model
|
3659 - | pub fn default_document_boolean(
|
3660 - | mut self,
|
3661 - | input: ::aws_smithy_http_server_python::types::Document,
|
3662 - | ) -> Self {
|
3663 - | self.default_document_boolean = Some(input);
|
3664 - | self
|
5527 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5528 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5529 + | self.build_enforcing_all_constraints()
|
5530 + | }
|
5531 + | fn build_enforcing_all_constraints(
|
5532 + | self,
|
5533 + | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5534 + | crate::model::RecursiveShapesInputOutputNested2 {
|
5535 + | bar: self.bar,
|
5536 + | recursive_member: self.recursive_member,
|
5537 + | }
|
5538 + | }
|
5539 + | }
|
5540 + | }
|
5541 + | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5542 + | pub mod recursive_shapes_input_output_nested2 {
|
5543 + |
|
5544 + | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
5545 + | fn from(builder: Builder) -> Self {
|
5546 + | builder.build()
|
3665 5547 | }
|
3666 - | #[allow(missing_docs)] // documentation missing in model
|
3667 - | pub fn default_document_list(
|
3668 - | mut self,
|
3669 - | input: ::aws_smithy_http_server_python::types::Document,
|
3670 - | ) -> Self {
|
3671 - | self.default_document_list = Some(input);
|
3672 - | self
|
3673 5548 | }
|
5549 + | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5550 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5551 + | pub struct Builder {
|
5552 + | pub(crate) bar: ::std::option::Option<::std::string::String>,
|
5553 + | pub(crate) recursive_member:
|
5554 + | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
5555 + | }
|
5556 + | impl Builder {
|
3674 5557 | #[allow(missing_docs)] // documentation missing in model
|
3675 - | pub fn default_null_document(
|
3676 - | mut self,
|
3677 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Document>,
|
3678 - | ) -> Self {
|
3679 - | self.default_null_document = input;
|
5558 + | pub fn bar(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5559 + | self.bar = input;
|
3680 5560 | self
|
3681 5561 | }
|
3682 5562 | #[allow(missing_docs)] // documentation missing in model
|
3683 - | pub fn default_timestamp(
|
5563 + | pub fn recursive_member(
|
3684 5564 | mut self,
|
3685 - | input: ::aws_smithy_http_server_python::types::DateTime,
|
5565 + | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
3686 5566 | ) -> Self {
|
3687 - | self.default_timestamp = Some(input);
|
5567 + | self.recursive_member = input;
|
3688 5568 | self
|
3689 5569 | }
|
3690 - | #[allow(missing_docs)] // documentation missing in model
|
3691 - | pub fn default_blob(mut self, input: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
3692 - | self.default_blob = Some(input);
|
3693 - | self
|
5570 + | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
5571 + | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5572 + | self.build_enforcing_required_and_enum_traits()
|
3694 5573 | }
|
3695 - | #[allow(missing_docs)] // documentation missing in model
|
3696 - | pub fn default_byte(mut self, input: i8) -> Self {
|
3697 - | self.default_byte = Some(input);
|
3698 - | self
|
5574 + | fn build_enforcing_required_and_enum_traits(
|
5575 + | self,
|
5576 + | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
5577 + | crate::model::RecursiveShapesInputOutputNested2 {
|
5578 + | bar: self.bar,
|
5579 + | recursive_member: self.recursive_member,
|
3699 5580 | }
|
3700 - | #[allow(missing_docs)] // documentation missing in model
|
3701 - | pub fn default_short(mut self, input: i16) -> Self {
|
3702 - | self.default_short = Some(input);
|
3703 - | self
|
3704 5581 | }
|
3705 - | #[allow(missing_docs)] // documentation missing in model
|
3706 - | pub fn default_integer(mut self, input: i32) -> Self {
|
3707 - | self.default_integer = Some(input);
|
3708 - | self
|
3709 5582 | }
|
3710 - | #[allow(missing_docs)] // documentation missing in model
|
3711 - | pub fn default_long(mut self, input: i64) -> Self {
|
3712 - | self.default_long = Some(input);
|
3713 - | self
|
5583 + | }
|
5584 + | /// See [`StructureListMember`](crate::model::StructureListMember).
|
5585 + | pub(crate) mod structure_list_member_internal {
|
5586 + |
|
5587 + | impl ::std::convert::From<Builder> for crate::model::StructureListMember {
|
5588 + | fn from(builder: Builder) -> Self {
|
5589 + | builder.build()
|
3714 5590 | }
|
3715 - | #[allow(missing_docs)] // documentation missing in model
|
3716 - | pub fn default_float(mut self, input: f32) -> Self {
|
3717 - | self.default_float = Some(input);
|
3718 - | self
|
3719 5591 | }
|
3720 - | #[allow(missing_docs)] // documentation missing in model
|
3721 - | pub fn default_double(mut self, input: f64) -> Self {
|
3722 - | self.default_double = Some(input);
|
3723 - | self
|
5592 + | /// A builder for [`StructureListMember`](crate::model::StructureListMember).
|
5593 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5594 + | pub(crate) struct Builder {
|
5595 + | pub(crate) a: ::std::option::Option<::std::string::String>,
|
5596 + | pub(crate) b: ::std::option::Option<::std::string::String>,
|
3724 5597 | }
|
5598 + | impl Builder {
|
3725 5599 | #[allow(missing_docs)] // documentation missing in model
|
3726 - | pub fn default_map(
|
5600 + | pub(crate) fn set_a(
|
3727 5601 | mut self,
|
3728 - | input: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
|
5602 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
3729 5603 | ) -> Self {
|
3730 - | self.default_map = Some(input);
|
3731 - | self
|
3732 - | }
|
3733 - | #[allow(missing_docs)] // documentation missing in model
|
3734 - | pub fn default_enum(mut self, input: crate::model::TestEnum) -> Self {
|
3735 - | self.default_enum = Some(input);
|
5604 + | self.a = input.map(|v| v.into());
|
3736 5605 | self
|
3737 5606 | }
|
3738 5607 | #[allow(missing_docs)] // documentation missing in model
|
3739 - | pub fn default_int_enum(mut self, input: i32) -> Self {
|
3740 - | self.default_int_enum = Some(input);
|
5608 + | pub(crate) fn set_b(
|
5609 + | mut self,
|
5610 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5611 + | ) -> Self {
|
5612 + | self.b = input.map(|v| v.into());
|
3741 5613 | self
|
3742 5614 | }
|
3743 - | #[allow(missing_docs)] // documentation missing in model
|
3744 - | pub fn empty_string(mut self, input: ::std::string::String) -> Self {
|
3745 - | self.empty_string = Some(input);
|
3746 - | self
|
5615 + | /// Consumes the builder and constructs a [`StructureListMember`](crate::model::StructureListMember).
|
5616 + | pub fn build(self) -> crate::model::StructureListMember {
|
5617 + | self.build_enforcing_all_constraints()
|
3747 5618 | }
|
3748 - | #[allow(missing_docs)] // documentation missing in model
|
3749 - | pub fn false_boolean(mut self, input: bool) -> Self {
|
3750 - | self.false_boolean = Some(input);
|
3751 - | self
|
5619 + | fn build_enforcing_all_constraints(self) -> crate::model::StructureListMember {
|
5620 + | crate::model::StructureListMember {
|
5621 + | a: self.a,
|
5622 + | b: self.b,
|
3752 5623 | }
|
3753 - | #[allow(missing_docs)] // documentation missing in model
|
3754 - | pub fn empty_blob(mut self, input: ::aws_smithy_http_server_python::types::Blob) -> Self {
|
3755 - | self.empty_blob = Some(input);
|
3756 - | self
|
3757 5624 | }
|
3758 - | #[allow(missing_docs)] // documentation missing in model
|
3759 - | pub fn zero_byte(mut self, input: i8) -> Self {
|
3760 - | self.zero_byte = Some(input);
|
3761 - | self
|
3762 5625 | }
|
3763 - | #[allow(missing_docs)] // documentation missing in model
|
3764 - | pub fn zero_short(mut self, input: i16) -> Self {
|
3765 - | self.zero_short = Some(input);
|
3766 - | self
|
5626 + | }
|
5627 + | /// See [`StructureListMember`](crate::model::StructureListMember).
|
5628 + | pub mod structure_list_member {
|
5629 + |
|
5630 + | impl ::std::convert::From<Builder> for crate::model::StructureListMember {
|
5631 + | fn from(builder: Builder) -> Self {
|
5632 + | builder.build()
|
3767 5633 | }
|
3768 - | #[allow(missing_docs)] // documentation missing in model
|
3769 - | pub fn zero_integer(mut self, input: i32) -> Self {
|
3770 - | self.zero_integer = Some(input);
|
3771 - | self
|
3772 5634 | }
|
3773 - | #[allow(missing_docs)] // documentation missing in model
|
3774 - | pub fn zero_long(mut self, input: i64) -> Self {
|
3775 - | self.zero_long = Some(input);
|
3776 - | self
|
5635 + | /// A builder for [`StructureListMember`](crate::model::StructureListMember).
|
5636 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
5637 + | pub struct Builder {
|
5638 + | pub(crate) a: ::std::option::Option<::std::string::String>,
|
5639 + | pub(crate) b: ::std::option::Option<::std::string::String>,
|
3777 5640 | }
|
5641 + | impl Builder {
|
3778 5642 | #[allow(missing_docs)] // documentation missing in model
|
3779 - | pub fn zero_float(mut self, input: f32) -> Self {
|
3780 - | self.zero_float = Some(input);
|
5643 + | pub fn a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5644 + | self.a = input;
|
3781 5645 | self
|
3782 5646 | }
|
3783 5647 | #[allow(missing_docs)] // documentation missing in model
|
3784 - | pub fn zero_double(mut self, input: f64) -> Self {
|
3785 - | self.zero_double = Some(input);
|
5648 + | pub fn b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5649 + | self.b = input;
|
3786 5650 | self
|
3787 5651 | }
|
3788 - | /// Consumes the builder and constructs a [`Defaults`](crate::model::Defaults).
|
3789 - | pub fn build(self) -> crate::model::Defaults {
|
5652 + | /// Consumes the builder and constructs a [`StructureListMember`](crate::model::StructureListMember).
|
5653 + | pub fn build(self) -> crate::model::StructureListMember {
|
3790 5654 | self.build_enforcing_required_and_enum_traits()
|
3791 5655 | }
|
3792 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Defaults {
|
3793 - | crate::model::Defaults {
|
3794 - | default_string: self.default_string.unwrap_or_else(|| String::from("hi")),
|
3795 - | default_boolean: self.default_boolean.unwrap_or(true),
|
3796 - | default_list: self.default_list.unwrap_or_default(),
|
3797 - | default_document_map: self.default_document_map.unwrap_or_else(|| {
|
3798 - | ::aws_smithy_types::Document::Object(::std::collections::HashMap::new()).into()
|
3799 - | }),
|
3800 - | default_document_string: self.default_document_string.unwrap_or_else(|| {
|
3801 - | ::aws_smithy_types::Document::String(::std::string::String::from("hi")).into()
|
3802 - | }),
|
3803 - | default_document_boolean: self
|
3804 - | .default_document_boolean
|
3805 - | .unwrap_or(::aws_smithy_types::Document::Bool(true).into()),
|
3806 - | default_document_list: self.default_document_list.unwrap_or_else(|| {
|
3807 - | ::aws_smithy_types::Document::Array(::std::vec::Vec::new()).into()
|
3808 - | }),
|
3809 - | default_null_document: self.default_null_document,
|
3810 - | default_timestamp: self.default_timestamp.unwrap_or_else(|| {
|
3811 - | ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64).into()
|
3812 - | }),
|
3813 - | default_blob: self
|
3814 - | .default_blob
|
3815 - | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("YWJj").into()),
|
3816 - | default_byte: self.default_byte.unwrap_or(1i8),
|
3817 - | default_short: self.default_short.unwrap_or(1i16),
|
3818 - | default_integer: self.default_integer.unwrap_or(10i32),
|
3819 - | default_long: self.default_long.unwrap_or(100i64),
|
3820 - | default_float: self.default_float.unwrap_or(1.0f32),
|
3821 - | default_double: self.default_double.unwrap_or(1.0f64),
|
3822 - | default_map: self.default_map.unwrap_or_default(),
|
3823 - | default_enum: self.default_enum.unwrap_or(
|
3824 - | "FOO"
|
3825 - | .parse::<crate::model::TestEnum>()
|
3826 - | .expect("static value validated to member"),
|
3827 - | ),
|
3828 - | default_int_enum: self.default_int_enum.unwrap_or(1i32),
|
3829 - | empty_string: self.empty_string.unwrap_or_else(|| String::from("")),
|
3830 - | false_boolean: self.false_boolean.unwrap_or(false),
|
3831 - | empty_blob: self
|
3832 - | .empty_blob
|
3833 - | .unwrap_or_else(|| ::aws_smithy_types::Blob::new("").into()),
|
3834 - | zero_byte: self.zero_byte.unwrap_or(0i8),
|
3835 - | zero_short: self.zero_short.unwrap_or(0i16),
|
3836 - | zero_integer: self.zero_integer.unwrap_or(0i32),
|
3837 - | zero_long: self.zero_long.unwrap_or(0i64),
|
3838 - | zero_float: self.zero_float.unwrap_or(0.0f32),
|
3839 - | zero_double: self.zero_double.unwrap_or(0.0f64),
|
5656 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::StructureListMember {
|
5657 + | crate::model::StructureListMember {
|
5658 + | a: self.a,
|
5659 + | b: self.b,
|
3840 5660 | }
|
3841 5661 | }
|
3842 5662 | }
|
3843 5663 | }
|
3844 - | /// See [`PayloadConfig`](crate::model::PayloadConfig).
|
3845 - | pub(crate) mod payload_config_internal {
|
5664 + | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
5665 + | pub(crate) mod greeting_struct_internal {
|
3846 5666 |
|
3847 - | impl ::std::convert::From<Builder> for crate::model::PayloadConfig {
|
5667 + | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
3848 5668 | fn from(builder: Builder) -> Self {
|
3849 5669 | builder.build()
|
3850 5670 | }
|
3851 5671 | }
|
3852 - | /// A builder for [`PayloadConfig`](crate::model::PayloadConfig).
|
5672 + | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
3853 5673 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3854 5674 | pub(crate) struct Builder {
|
3855 - | pub(crate) data: ::std::option::Option<i32>,
|
5675 + | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
3856 5676 | }
|
3857 5677 | impl Builder {
|
3858 5678 | #[allow(missing_docs)] // documentation missing in model
|
3859 - | pub(crate) fn set_data(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
3860 - | self.data = input.map(|v| v.into());
|
5679 + | pub(crate) fn set_hi(
|
5680 + | mut self,
|
5681 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5682 + | ) -> Self {
|
5683 + | self.hi = input.map(|v| v.into());
|
3861 5684 | self
|
3862 5685 | }
|
3863 - | /// Consumes the builder and constructs a [`PayloadConfig`](crate::model::PayloadConfig).
|
3864 - | pub fn build(self) -> crate::model::PayloadConfig {
|
5686 + | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
5687 + | pub fn build(self) -> crate::model::GreetingStruct {
|
3865 5688 | self.build_enforcing_all_constraints()
|
3866 5689 | }
|
3867 - | fn build_enforcing_all_constraints(self) -> crate::model::PayloadConfig {
|
3868 - | crate::model::PayloadConfig { data: self.data }
|
5690 + | fn build_enforcing_all_constraints(self) -> crate::model::GreetingStruct {
|
5691 + | crate::model::GreetingStruct { hi: self.hi }
|
3869 5692 | }
|
3870 5693 | }
|
3871 5694 | }
|
3872 - | /// See [`PayloadConfig`](crate::model::PayloadConfig).
|
3873 - | pub mod payload_config {
|
5695 + | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
5696 + | pub mod greeting_struct {
|
3874 5697 |
|
3875 - | impl ::std::convert::From<Builder> for crate::model::PayloadConfig {
|
5698 + | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
3876 5699 | fn from(builder: Builder) -> Self {
|
3877 5700 | builder.build()
|
3878 5701 | }
|
3879 5702 | }
|
3880 - | /// A builder for [`PayloadConfig`](crate::model::PayloadConfig).
|
5703 + | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
3881 5704 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3882 5705 | pub struct Builder {
|
3883 - | pub(crate) data: ::std::option::Option<i32>,
|
5706 + | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
3884 5707 | }
|
3885 5708 | impl Builder {
|
3886 5709 | #[allow(missing_docs)] // documentation missing in model
|
3887 - | pub fn data(mut self, input: ::std::option::Option<i32>) -> Self {
|
3888 - | self.data = input;
|
5710 + | pub fn hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5711 + | self.hi = input;
|
3889 5712 | self
|
3890 5713 | }
|
3891 - | /// Consumes the builder and constructs a [`PayloadConfig`](crate::model::PayloadConfig).
|
3892 - | pub fn build(self) -> crate::model::PayloadConfig {
|
5714 + | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
5715 + | pub fn build(self) -> crate::model::GreetingStruct {
|
3893 5716 | self.build_enforcing_required_and_enum_traits()
|
3894 5717 | }
|
3895 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::PayloadConfig {
|
3896 - | crate::model::PayloadConfig { data: self.data }
|
3897 - | }
|
5718 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::GreetingStruct {
|
5719 + | crate::model::GreetingStruct { hi: self.hi }
|
5720 + | }
|
3898 5721 | }
|
3899 5722 | }
|
3900 - | /// See [`TestConfig`](crate::model::TestConfig).
|
3901 - | pub(crate) mod test_config_internal {
|
5723 + | /// See [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5724 + | pub(crate) mod renamed_greeting_internal {
|
3902 5725 |
|
3903 - | impl ::std::convert::From<Builder> for crate::model::TestConfig {
|
5726 + | impl ::std::convert::From<Builder> for crate::model::RenamedGreeting {
|
3904 5727 | fn from(builder: Builder) -> Self {
|
3905 5728 | builder.build()
|
3906 5729 | }
|
3907 5730 | }
|
3908 - | /// A builder for [`TestConfig`](crate::model::TestConfig).
|
5731 + | /// A builder for [`RenamedGreeting`](crate::model::RenamedGreeting).
|
3909 5732 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3910 5733 | pub(crate) struct Builder {
|
3911 - | pub(crate) timeout: ::std::option::Option<i32>,
|
5734 + | pub(crate) salutation: ::std::option::Option<::std::string::String>,
|
3912 5735 | }
|
3913 5736 | impl Builder {
|
3914 5737 | #[allow(missing_docs)] // documentation missing in model
|
3915 - | pub(crate) fn set_timeout(mut self, input: Option<impl ::std::convert::Into<i32>>) -> Self {
|
3916 - | self.timeout = input.map(|v| v.into());
|
5738 + | pub(crate) fn set_salutation(
|
5739 + | mut self,
|
5740 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5741 + | ) -> Self {
|
5742 + | self.salutation = input.map(|v| v.into());
|
3917 5743 | self
|
3918 5744 | }
|
3919 - | /// Consumes the builder and constructs a [`TestConfig`](crate::model::TestConfig).
|
3920 - | pub fn build(self) -> crate::model::TestConfig {
|
5745 + | /// Consumes the builder and constructs a [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5746 + | pub fn build(self) -> crate::model::RenamedGreeting {
|
3921 5747 | self.build_enforcing_all_constraints()
|
3922 5748 | }
|
3923 - | fn build_enforcing_all_constraints(self) -> crate::model::TestConfig {
|
3924 - | crate::model::TestConfig {
|
3925 - | timeout: self.timeout,
|
5749 + | fn build_enforcing_all_constraints(self) -> crate::model::RenamedGreeting {
|
5750 + | crate::model::RenamedGreeting {
|
5751 + | salutation: self.salutation,
|
3926 5752 | }
|
3927 5753 | }
|
3928 5754 | }
|
3929 5755 | }
|
3930 - | /// See [`TestConfig`](crate::model::TestConfig).
|
3931 - | pub mod test_config {
|
5756 + | /// See [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5757 + | pub mod renamed_greeting {
|
3932 5758 |
|
3933 - | impl ::std::convert::From<Builder> for crate::model::TestConfig {
|
5759 + | impl ::std::convert::From<Builder> for crate::model::RenamedGreeting {
|
3934 5760 | fn from(builder: Builder) -> Self {
|
3935 5761 | builder.build()
|
3936 5762 | }
|
3937 5763 | }
|
3938 - | /// A builder for [`TestConfig`](crate::model::TestConfig).
|
5764 + | /// A builder for [`RenamedGreeting`](crate::model::RenamedGreeting).
|
3939 5765 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3940 5766 | pub struct Builder {
|
3941 - | pub(crate) timeout: ::std::option::Option<i32>,
|
5767 + | pub(crate) salutation: ::std::option::Option<::std::string::String>,
|
3942 5768 | }
|
3943 5769 | impl Builder {
|
3944 5770 | #[allow(missing_docs)] // documentation missing in model
|
3945 - | pub fn timeout(mut self, input: ::std::option::Option<i32>) -> Self {
|
3946 - | self.timeout = input;
|
5771 + | pub fn salutation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
5772 + | self.salutation = input;
|
3947 5773 | self
|
3948 5774 | }
|
3949 - | /// Consumes the builder and constructs a [`TestConfig`](crate::model::TestConfig).
|
3950 - | pub fn build(self) -> crate::model::TestConfig {
|
5775 + | /// Consumes the builder and constructs a [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5776 + | pub fn build(self) -> crate::model::RenamedGreeting {
|
3951 5777 | self.build_enforcing_required_and_enum_traits()
|
3952 5778 | }
|
3953 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::TestConfig {
|
3954 - | crate::model::TestConfig {
|
3955 - | timeout: self.timeout,
|
5779 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::RenamedGreeting {
|
5780 + | crate::model::RenamedGreeting {
|
5781 + | salutation: self.salutation,
|
3956 5782 | }
|
3957 5783 | }
|
3958 5784 | }
|
3959 5785 | }
|
3960 5786 | /// See [`Unit`](crate::model::Unit).
|
3961 5787 | pub(crate) mod unit_internal {
|
3962 5788 |
|
3963 5789 | impl ::std::convert::From<Builder> for crate::model::Unit {
|
3964 5790 | fn from(builder: Builder) -> Self {
|
3965 5791 | builder.build()
|
3966 5792 | }
|
3967 5793 | }
|
3968 5794 | /// A builder for [`Unit`](crate::model::Unit).
|
3969 5795 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3970 5796 | pub(crate) struct Builder {}
|
3971 5797 | impl Builder {
|
3972 5798 | /// Consumes the builder and constructs a [`Unit`](crate::model::Unit).
|
3973 5799 | pub fn build(self) -> crate::model::Unit {
|
3974 5800 | self.build_enforcing_all_constraints()
|
3975 5801 | }
|
3976 5802 | fn build_enforcing_all_constraints(self) -> crate::model::Unit {
|
3977 5803 | crate::model::Unit {}
|
3978 5804 | }
|
3979 5805 | }
|
3980 5806 | }
|
3981 5807 | /// See [`Unit`](crate::model::Unit).
|
3982 5808 | pub mod unit {
|
3983 5809 |
|
3984 5810 | impl ::std::convert::From<Builder> for crate::model::Unit {
|
3985 5811 | fn from(builder: Builder) -> Self {
|
3986 5812 | builder.build()
|
3987 5813 | }
|
3988 5814 | }
|
3989 5815 | /// A builder for [`Unit`](crate::model::Unit).
|
3990 5816 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
3991 5817 | pub struct Builder {}
|
3992 5818 | impl Builder {
|
3993 5819 | /// Consumes the builder and constructs a [`Unit`](crate::model::Unit).
|
3994 5820 | pub fn build(self) -> crate::model::Unit {
|
3995 5821 | self.build_enforcing_required_and_enum_traits()
|
3996 5822 | }
|
3997 5823 | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Unit {
|
3998 5824 | crate::model::Unit {}
|
3999 5825 | }
|
4000 5826 | }
|
4001 5827 | }
|
4002 - | pub(crate) mod my_union_internal {
|
4003 - |
|
4004 - | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4005 - | #[allow(clippy::enum_variant_names)]
|
4006 - | pub(crate) enum ConstraintViolation {
|
4007 - | EnumValue(crate::model::foo_enum_internal::ConstraintViolation),
|
4008 - | }
|
4009 - | impl ::std::fmt::Display for ConstraintViolation {
|
4010 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4011 - | match self {
|
4012 - | Self::EnumValue(inner) => write!(f, "{inner}"),
|
4013 - | }
|
4014 - | }
|
4015 - | }
|
4016 - |
|
4017 - | impl ::std::error::Error for ConstraintViolation {}
|
4018 - | impl ConstraintViolation {
|
4019 - | pub(crate) fn as_validation_exception_field(
|
4020 - | self,
|
4021 - | path: ::std::string::String,
|
4022 - | ) -> crate::model::ValidationExceptionField {
|
4023 - | match self {
|
4024 - | Self::EnumValue(inner) => inner.as_validation_exception_field(path + "/enumValue"),
|
4025 - | }
|
4026 - | }
|
4027 - | }
|
4028 - | }
|
4029 - | /// See [`RenamedGreeting`](crate::model::RenamedGreeting).
|
4030 - | pub(crate) mod renamed_greeting_internal {
|
5828 + | /// See [`Farewell`](crate::model::Farewell).
|
5829 + | pub(crate) mod farewell_internal {
|
4031 5830 |
|
4032 - | impl ::std::convert::From<Builder> for crate::model::RenamedGreeting {
|
5831 + | impl ::std::convert::From<Builder> for crate::model::Farewell {
|
4033 5832 | fn from(builder: Builder) -> Self {
|
4034 5833 | builder.build()
|
4035 5834 | }
|
4036 5835 | }
|
4037 - | /// A builder for [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5836 + | /// A builder for [`Farewell`](crate::model::Farewell).
|
4038 5837 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4039 5838 | pub(crate) struct Builder {
|
4040 - | pub(crate) salutation: ::std::option::Option<::std::string::String>,
|
5839 + | pub(crate) phrase: ::std::option::Option<::std::string::String>,
|
4041 5840 | }
|
4042 5841 | impl Builder {
|
4043 5842 | #[allow(missing_docs)] // documentation missing in model
|
4044 - | pub(crate) fn set_salutation(
|
5843 + | pub(crate) fn set_phrase(
|
4045 5844 | mut self,
|
4046 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5845 + | input: impl ::std::convert::Into<::std::string::String>,
|
4047 5846 | ) -> Self {
|
4048 - | self.salutation = input.map(|v| v.into());
|
5847 + | self.phrase = Some(input.into());
|
4049 5848 | self
|
4050 5849 | }
|
4051 - | /// Consumes the builder and constructs a [`RenamedGreeting`](crate::model::RenamedGreeting).
|
4052 - | pub fn build(self) -> crate::model::RenamedGreeting {
|
5850 + | /// Consumes the builder and constructs a [`Farewell`](crate::model::Farewell).
|
5851 + | pub fn build(self) -> crate::model::Farewell {
|
4053 5852 | self.build_enforcing_all_constraints()
|
4054 5853 | }
|
4055 - | fn build_enforcing_all_constraints(self) -> crate::model::RenamedGreeting {
|
4056 - | crate::model::RenamedGreeting {
|
4057 - | salutation: self.salutation,
|
5854 + | fn build_enforcing_all_constraints(self) -> crate::model::Farewell {
|
5855 + | crate::model::Farewell {
|
5856 + | phrase: self.phrase.unwrap_or_else(|| String::from("bye")),
|
4058 5857 | }
|
4059 5858 | }
|
4060 5859 | }
|
4061 5860 | }
|
4062 - | /// See [`RenamedGreeting`](crate::model::RenamedGreeting).
|
4063 - | pub mod renamed_greeting {
|
5861 + | /// See [`Farewell`](crate::model::Farewell).
|
5862 + | pub mod farewell {
|
4064 5863 |
|
4065 - | impl ::std::convert::From<Builder> for crate::model::RenamedGreeting {
|
5864 + | impl ::std::convert::From<Builder> for crate::model::Farewell {
|
4066 5865 | fn from(builder: Builder) -> Self {
|
4067 5866 | builder.build()
|
4068 5867 | }
|
4069 5868 | }
|
4070 - | /// A builder for [`RenamedGreeting`](crate::model::RenamedGreeting).
|
5869 + | /// A builder for [`Farewell`](crate::model::Farewell).
|
4071 5870 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4072 5871 | pub struct Builder {
|
4073 - | pub(crate) salutation: ::std::option::Option<::std::string::String>,
|
5872 + | pub(crate) phrase: ::std::option::Option<::std::string::String>,
|
4074 5873 | }
|
4075 5874 | impl Builder {
|
4076 5875 | #[allow(missing_docs)] // documentation missing in model
|
4077 - | pub fn salutation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4078 - | self.salutation = input;
|
5876 + | pub fn phrase(mut self, input: ::std::string::String) -> Self {
|
5877 + | self.phrase = Some(input);
|
4079 5878 | self
|
4080 5879 | }
|
4081 - | /// Consumes the builder and constructs a [`RenamedGreeting`](crate::model::RenamedGreeting).
|
4082 - | pub fn build(self) -> crate::model::RenamedGreeting {
|
5880 + | /// Consumes the builder and constructs a [`Farewell`](crate::model::Farewell).
|
5881 + | pub fn build(self) -> crate::model::Farewell {
|
4083 5882 | self.build_enforcing_required_and_enum_traits()
|
4084 5883 | }
|
4085 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::RenamedGreeting {
|
4086 - | crate::model::RenamedGreeting {
|
4087 - | salutation: self.salutation,
|
5884 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::Farewell {
|
5885 + | crate::model::Farewell {
|
5886 + | phrase: self.phrase.unwrap_or_else(|| String::from("bye")),
|
4088 5887 | }
|
4089 5888 | }
|
4090 5889 | }
|
4091 5890 | }
|
4092 - | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
4093 - | pub(crate) mod greeting_struct_internal {
|
5891 + | /// See [`HeadersEvent`](crate::model::HeadersEvent).
|
5892 + | pub(crate) mod headers_event_internal {
|
4094 5893 |
|
4095 - | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
5894 + | impl ::std::convert::From<Builder> for crate::model::HeadersEvent {
|
4096 5895 | fn from(builder: Builder) -> Self {
|
4097 5896 | builder.build()
|
4098 5897 | }
|
4099 5898 | }
|
4100 - | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
5899 + | /// A builder for [`HeadersEvent`](crate::model::HeadersEvent).
|
4101 5900 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4102 5901 | pub(crate) struct Builder {
|
4103 - | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
5902 + | pub(crate) boolean_header: ::std::option::Option<bool>,
|
5903 + | pub(crate) byte_header: ::std::option::Option<i8>,
|
5904 + | pub(crate) short_header: ::std::option::Option<i16>,
|
5905 + | pub(crate) int_header: ::std::option::Option<i32>,
|
5906 + | pub(crate) long_header: ::std::option::Option<i64>,
|
5907 + | pub(crate) blob_header: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
5908 + | pub(crate) string_header: ::std::option::Option<::std::string::String>,
|
5909 + | pub(crate) timestamp_header:
|
5910 + | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
4104 5911 | }
|
4105 5912 | impl Builder {
|
4106 5913 | #[allow(missing_docs)] // documentation missing in model
|
4107 - | pub(crate) fn set_hi(
|
5914 + | pub(crate) fn set_boolean_header(
|
4108 5915 | mut self,
|
4109 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5916 + | input: Option<impl ::std::convert::Into<bool>>,
|
4110 5917 | ) -> Self {
|
4111 - | self.hi = input.map(|v| v.into());
|
5918 + | self.boolean_header = input.map(|v| v.into());
|
4112 5919 | self
|
4113 5920 | }
|
4114 - | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
4115 - | pub fn build(self) -> crate::model::GreetingStruct {
|
4116 - | self.build_enforcing_all_constraints()
|
5921 + | #[allow(missing_docs)] // documentation missing in model
|
5922 + | pub(crate) fn set_byte_header(
|
5923 + | mut self,
|
5924 + | input: Option<impl ::std::convert::Into<i8>>,
|
5925 + | ) -> Self {
|
5926 + | self.byte_header = input.map(|v| v.into());
|
5927 + | self
|
4117 5928 | }
|
4118 - | fn build_enforcing_all_constraints(self) -> crate::model::GreetingStruct {
|
4119 - | crate::model::GreetingStruct { hi: self.hi }
|
5929 + | #[allow(missing_docs)] // documentation missing in model
|
5930 + | pub(crate) fn set_short_header(
|
5931 + | mut self,
|
5932 + | input: Option<impl ::std::convert::Into<i16>>,
|
5933 + | ) -> Self {
|
5934 + | self.short_header = input.map(|v| v.into());
|
5935 + | self
|
4120 5936 | }
|
5937 + | #[allow(missing_docs)] // documentation missing in model
|
5938 + | pub(crate) fn set_int_header(
|
5939 + | mut self,
|
5940 + | input: Option<impl ::std::convert::Into<i32>>,
|
5941 + | ) -> Self {
|
5942 + | self.int_header = input.map(|v| v.into());
|
5943 + | self
|
4121 5944 | }
|
4122 - | }
|
4123 - | /// See [`GreetingStruct`](crate::model::GreetingStruct).
|
4124 - | pub mod greeting_struct {
|
4125 - |
|
4126 - | impl ::std::convert::From<Builder> for crate::model::GreetingStruct {
|
4127 - | fn from(builder: Builder) -> Self {
|
4128 - | builder.build()
|
5945 + | #[allow(missing_docs)] // documentation missing in model
|
5946 + | pub(crate) fn set_long_header(
|
5947 + | mut self,
|
5948 + | input: Option<impl ::std::convert::Into<i64>>,
|
5949 + | ) -> Self {
|
5950 + | self.long_header = input.map(|v| v.into());
|
5951 + | self
|
4129 5952 | }
|
5953 + | #[allow(missing_docs)] // documentation missing in model
|
5954 + | pub(crate) fn set_blob_header(
|
5955 + | mut self,
|
5956 + | input: Option<impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>>,
|
5957 + | ) -> Self {
|
5958 + | self.blob_header = input.map(|v| v.into());
|
5959 + | self
|
4130 5960 | }
|
4131 - | /// A builder for [`GreetingStruct`](crate::model::GreetingStruct).
|
4132 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4133 - | pub struct Builder {
|
4134 - | pub(crate) hi: ::std::option::Option<::std::string::String>,
|
5961 + | #[allow(missing_docs)] // documentation missing in model
|
5962 + | pub(crate) fn set_string_header(
|
5963 + | mut self,
|
5964 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
5965 + | ) -> Self {
|
5966 + | self.string_header = input.map(|v| v.into());
|
5967 + | self
|
4135 5968 | }
|
4136 - | impl Builder {
|
4137 5969 | #[allow(missing_docs)] // documentation missing in model
|
4138 - | pub fn hi(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4139 - | self.hi = input;
|
5970 + | pub(crate) fn set_timestamp_header(
|
5971 + | mut self,
|
5972 + | input: Option<
|
5973 + | impl ::std::convert::Into<::aws_smithy_http_server_python::types::DateTime>,
|
5974 + | >,
|
5975 + | ) -> Self {
|
5976 + | self.timestamp_header = input.map(|v| v.into());
|
4140 5977 | self
|
4141 5978 | }
|
4142 - | /// Consumes the builder and constructs a [`GreetingStruct`](crate::model::GreetingStruct).
|
4143 - | pub fn build(self) -> crate::model::GreetingStruct {
|
4144 - | self.build_enforcing_required_and_enum_traits()
|
5979 + | /// Consumes the builder and constructs a [`HeadersEvent`](crate::model::HeadersEvent).
|
5980 + | pub fn build(self) -> crate::model::HeadersEvent {
|
5981 + | self.build_enforcing_all_constraints()
|
5982 + | }
|
5983 + | fn build_enforcing_all_constraints(self) -> crate::model::HeadersEvent {
|
5984 + | crate::model::HeadersEvent {
|
5985 + | boolean_header: self.boolean_header,
|
5986 + | byte_header: self.byte_header,
|
5987 + | short_header: self.short_header,
|
5988 + | int_header: self.int_header,
|
5989 + | long_header: self.long_header,
|
5990 + | blob_header: self.blob_header,
|
5991 + | string_header: self.string_header,
|
5992 + | timestamp_header: self.timestamp_header,
|
4145 5993 | }
|
4146 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::GreetingStruct {
|
4147 - | crate::model::GreetingStruct { hi: self.hi }
|
4148 5994 | }
|
4149 5995 | }
|
4150 5996 | }
|
4151 - | pub(crate) mod sparse_set_map_internal {
|
5997 + | /// See [`HeadersEvent`](crate::model::HeadersEvent).
|
5998 + | pub mod headers_event {
|
4152 5999 |
|
4153 - | #[allow(clippy::enum_variant_names)]
|
4154 - | #[derive(Debug, PartialEq)]
|
4155 - | pub(crate) enum ConstraintViolation {
|
4156 - | #[doc(hidden)]
|
4157 - | Value(
|
4158 - | ::std::string::String,
|
4159 - | crate::model::string_set_internal::ConstraintViolation,
|
4160 - | ),
|
6000 + | impl ::std::convert::From<Builder> for crate::model::HeadersEvent {
|
6001 + | fn from(builder: Builder) -> Self {
|
6002 + | builder.build()
|
4161 6003 | }
|
4162 - |
|
4163 - | impl ::std::fmt::Display for ConstraintViolation {
|
4164 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4165 - | match self {
|
4166 - | Self::Value(_, value_constraint_violation) => {
|
4167 - | write!(f, "{}", value_constraint_violation)
|
4168 6004 | }
|
6005 + | /// A builder for [`HeadersEvent`](crate::model::HeadersEvent).
|
6006 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6007 + | pub struct Builder {
|
6008 + | pub(crate) boolean_header: ::std::option::Option<bool>,
|
6009 + | pub(crate) byte_header: ::std::option::Option<i8>,
|
6010 + | pub(crate) short_header: ::std::option::Option<i16>,
|
6011 + | pub(crate) int_header: ::std::option::Option<i32>,
|
6012 + | pub(crate) long_header: ::std::option::Option<i64>,
|
6013 + | pub(crate) blob_header: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
6014 + | pub(crate) string_header: ::std::option::Option<::std::string::String>,
|
6015 + | pub(crate) timestamp_header:
|
6016 + | ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
4169 6017 | }
|
6018 + | impl Builder {
|
6019 + | #[allow(missing_docs)] // documentation missing in model
|
6020 + | pub fn boolean_header(mut self, input: ::std::option::Option<bool>) -> Self {
|
6021 + | self.boolean_header = input;
|
6022 + | self
|
4170 6023 | }
|
6024 + | #[allow(missing_docs)] // documentation missing in model
|
6025 + | pub fn byte_header(mut self, input: ::std::option::Option<i8>) -> Self {
|
6026 + | self.byte_header = input;
|
6027 + | self
|
4171 6028 | }
|
4172 - |
|
4173 - | impl ::std::error::Error for ConstraintViolation {}
|
4174 - | impl ConstraintViolation {
|
4175 - | pub(crate) fn as_validation_exception_field(
|
4176 - | self,
|
4177 - | path: ::std::string::String,
|
4178 - | ) -> crate::model::ValidationExceptionField {
|
4179 - | match self {
|
4180 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4181 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
6029 + | #[allow(missing_docs)] // documentation missing in model
|
6030 + | pub fn short_header(mut self, input: ::std::option::Option<i16>) -> Self {
|
6031 + | self.short_header = input;
|
6032 + | self
|
4182 6033 | }
|
6034 + | #[allow(missing_docs)] // documentation missing in model
|
6035 + | pub fn int_header(mut self, input: ::std::option::Option<i32>) -> Self {
|
6036 + | self.int_header = input;
|
6037 + | self
|
4183 6038 | }
|
6039 + | #[allow(missing_docs)] // documentation missing in model
|
6040 + | pub fn long_header(mut self, input: ::std::option::Option<i64>) -> Self {
|
6041 + | self.long_header = input;
|
6042 + | self
|
4184 6043 | }
|
4185 - | }
|
4186 - | pub(crate) mod string_set_internal {
|
4187 - |
|
4188 - | #[allow(clippy::enum_variant_names)]
|
4189 - | #[derive(Debug, PartialEq)]
|
4190 - | pub(crate) enum ConstraintViolation {
|
4191 - | /// Constraint violation error when the list does not contain unique items
|
4192 - | UniqueItems {
|
4193 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4194 - | /// at least two elements.
|
4195 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4196 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4197 - | /// Nothing is guaranteed about the order of the indices.
|
4198 - | duplicate_indices: ::std::vec::Vec<usize>,
|
4199 - | /// The original vector, that contains duplicate items.
|
4200 - | original: ::std::vec::Vec<::std::string::String>,
|
4201 - | },
|
6044 + | #[allow(missing_docs)] // documentation missing in model
|
6045 + | pub fn blob_header(
|
6046 + | mut self,
|
6047 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
6048 + | ) -> Self {
|
6049 + | self.blob_header = input;
|
6050 + | self
|
4202 6051 | }
|
4203 - |
|
4204 - | impl ::std::fmt::Display for ConstraintViolation {
|
4205 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4206 - | let message = match self {
|
4207 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4208 - | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#StringSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4209 - | };
|
4210 - | write!(f, "{message}")
|
6052 + | #[allow(missing_docs)] // documentation missing in model
|
6053 + | pub fn string_header(
|
6054 + | mut self,
|
6055 + | input: ::std::option::Option<::std::string::String>,
|
6056 + | ) -> Self {
|
6057 + | self.string_header = input;
|
6058 + | self
|
6059 + | }
|
6060 + | #[allow(missing_docs)] // documentation missing in model
|
6061 + | pub fn timestamp_header(
|
6062 + | mut self,
|
6063 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::DateTime>,
|
6064 + | ) -> Self {
|
6065 + | self.timestamp_header = input;
|
6066 + | self
|
4211 6067 | }
|
6068 + | /// Consumes the builder and constructs a [`HeadersEvent`](crate::model::HeadersEvent).
|
6069 + | pub fn build(self) -> crate::model::HeadersEvent {
|
6070 + | self.build_enforcing_required_and_enum_traits()
|
4212 6071 | }
|
4213 - |
|
4214 - | impl ::std::error::Error for ConstraintViolation {}
|
4215 - | impl ConstraintViolation {
|
4216 - | pub(crate) fn as_validation_exception_field(
|
4217 - | self,
|
4218 - | path: ::std::string::String,
|
4219 - | ) -> crate::model::ValidationExceptionField {
|
4220 - | match self {
|
4221 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4222 - | crate::model::ValidationExceptionField {
|
4223 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4224 - | path,
|
4225 - | },
|
6072 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::HeadersEvent {
|
6073 + | crate::model::HeadersEvent {
|
6074 + | boolean_header: self.boolean_header,
|
6075 + | byte_header: self.byte_header,
|
6076 + | short_header: self.short_header,
|
6077 + | int_header: self.int_header,
|
6078 + | long_header: self.long_header,
|
6079 + | blob_header: self.blob_header,
|
6080 + | string_header: self.string_header,
|
6081 + | timestamp_header: self.timestamp_header,
|
4226 6082 | }
|
4227 6083 | }
|
4228 6084 | }
|
4229 6085 | }
|
4230 - | pub(crate) mod dense_set_map_internal {
|
6086 + | /// See [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
6087 + | pub(crate) mod blob_payload_event_internal {
|
4231 6088 |
|
4232 - | #[allow(clippy::enum_variant_names)]
|
4233 - | #[derive(Debug, PartialEq)]
|
4234 - | pub(crate) enum ConstraintViolation {
|
4235 - | #[doc(hidden)]
|
4236 - | Value(
|
4237 - | ::std::string::String,
|
4238 - | crate::model::string_set_internal::ConstraintViolation,
|
4239 - | ),
|
6089 + | impl ::std::convert::From<Builder> for crate::model::BlobPayloadEvent {
|
6090 + | fn from(builder: Builder) -> Self {
|
6091 + | builder.build()
|
4240 6092 | }
|
4241 - |
|
4242 - | impl ::std::fmt::Display for ConstraintViolation {
|
4243 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4244 - | match self {
|
4245 - | Self::Value(_, value_constraint_violation) => {
|
4246 - | write!(f, "{}", value_constraint_violation)
|
4247 6093 | }
|
6094 + | /// A builder for [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
6095 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6096 + | pub(crate) struct Builder {
|
6097 + | pub(crate) payload: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4248 6098 | }
|
6099 + | impl Builder {
|
6100 + | #[allow(missing_docs)] // documentation missing in model
|
6101 + | pub(crate) fn set_payload(
|
6102 + | mut self,
|
6103 + | input: Option<impl ::std::convert::Into<::aws_smithy_http_server_python::types::Blob>>,
|
6104 + | ) -> Self {
|
6105 + | self.payload = input.map(|v| v.into());
|
6106 + | self
|
4249 6107 | }
|
6108 + | /// Consumes the builder and constructs a [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
6109 + | pub fn build(self) -> crate::model::BlobPayloadEvent {
|
6110 + | self.build_enforcing_all_constraints()
|
4250 6111 | }
|
4251 - |
|
4252 - | impl ::std::error::Error for ConstraintViolation {}
|
4253 - | impl ConstraintViolation {
|
4254 - | pub(crate) fn as_validation_exception_field(
|
4255 - | self,
|
4256 - | path: ::std::string::String,
|
4257 - | ) -> crate::model::ValidationExceptionField {
|
4258 - | match self {
|
4259 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4260 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
6112 + | fn build_enforcing_all_constraints(self) -> crate::model::BlobPayloadEvent {
|
6113 + | crate::model::BlobPayloadEvent {
|
6114 + | payload: self.payload,
|
4261 6115 | }
|
4262 6116 | }
|
4263 6117 | }
|
4264 6118 | }
|
4265 - | /// See [`StructureListMember`](crate::model::StructureListMember).
|
4266 - | pub(crate) mod structure_list_member_internal {
|
6119 + | /// See [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
6120 + | pub mod blob_payload_event {
|
4267 6121 |
|
4268 - | impl ::std::convert::From<Builder> for crate::model::StructureListMember {
|
6122 + | impl ::std::convert::From<Builder> for crate::model::BlobPayloadEvent {
|
4269 6123 | fn from(builder: Builder) -> Self {
|
4270 6124 | builder.build()
|
4271 6125 | }
|
4272 6126 | }
|
4273 - | /// A builder for [`StructureListMember`](crate::model::StructureListMember).
|
6127 + | /// A builder for [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
4274 6128 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4275 - | pub(crate) struct Builder {
|
4276 - | pub(crate) a: ::std::option::Option<::std::string::String>,
|
4277 - | pub(crate) b: ::std::option::Option<::std::string::String>,
|
6129 + | pub struct Builder {
|
6130 + | pub(crate) payload: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4278 6131 | }
|
4279 6132 | impl Builder {
|
4280 6133 | #[allow(missing_docs)] // documentation missing in model
|
4281 - | pub(crate) fn set_a(
|
6134 + | pub fn payload(
|
4282 6135 | mut self,
|
4283 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
6136 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
4284 6137 | ) -> Self {
|
4285 - | self.a = input.map(|v| v.into());
|
6138 + | self.payload = input;
|
4286 6139 | self
|
4287 6140 | }
|
6141 + | /// Consumes the builder and constructs a [`BlobPayloadEvent`](crate::model::BlobPayloadEvent).
|
6142 + | pub fn build(self) -> crate::model::BlobPayloadEvent {
|
6143 + | self.build_enforcing_required_and_enum_traits()
|
6144 + | }
|
6145 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::BlobPayloadEvent {
|
6146 + | crate::model::BlobPayloadEvent {
|
6147 + | payload: self.payload,
|
6148 + | }
|
6149 + | }
|
6150 + | }
|
6151 + | }
|
6152 + | /// See [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
6153 + | pub(crate) mod string_payload_event_internal {
|
6154 + |
|
6155 + | impl ::std::convert::From<Builder> for crate::model::StringPayloadEvent {
|
6156 + | fn from(builder: Builder) -> Self {
|
6157 + | builder.build()
|
6158 + | }
|
6159 + | }
|
6160 + | /// A builder for [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
6161 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6162 + | pub(crate) struct Builder {
|
6163 + | pub(crate) payload: ::std::option::Option<::std::string::String>,
|
6164 + | }
|
6165 + | impl Builder {
|
4288 6166 | #[allow(missing_docs)] // documentation missing in model
|
4289 - | pub(crate) fn set_b(
|
6167 + | pub(crate) fn set_payload(
|
4290 6168 | mut self,
|
4291 6169 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4292 6170 | ) -> Self {
|
4293 - | self.b = input.map(|v| v.into());
|
6171 + | self.payload = input.map(|v| v.into());
|
4294 6172 | self
|
4295 6173 | }
|
4296 - | /// Consumes the builder and constructs a [`StructureListMember`](crate::model::StructureListMember).
|
4297 - | pub fn build(self) -> crate::model::StructureListMember {
|
6174 + | /// Consumes the builder and constructs a [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
6175 + | pub fn build(self) -> crate::model::StringPayloadEvent {
|
4298 6176 | self.build_enforcing_all_constraints()
|
4299 6177 | }
|
4300 - | fn build_enforcing_all_constraints(self) -> crate::model::StructureListMember {
|
4301 - | crate::model::StructureListMember {
|
4302 - | a: self.a,
|
4303 - | b: self.b,
|
6178 + | fn build_enforcing_all_constraints(self) -> crate::model::StringPayloadEvent {
|
6179 + | crate::model::StringPayloadEvent {
|
6180 + | payload: self.payload,
|
4304 6181 | }
|
4305 6182 | }
|
4306 6183 | }
|
4307 6184 | }
|
4308 - | /// See [`StructureListMember`](crate::model::StructureListMember).
|
4309 - | pub mod structure_list_member {
|
6185 + | /// See [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
6186 + | pub mod string_payload_event {
|
4310 6187 |
|
4311 - | impl ::std::convert::From<Builder> for crate::model::StructureListMember {
|
6188 + | impl ::std::convert::From<Builder> for crate::model::StringPayloadEvent {
|
4312 6189 | fn from(builder: Builder) -> Self {
|
4313 6190 | builder.build()
|
4314 6191 | }
|
4315 6192 | }
|
4316 - | /// A builder for [`StructureListMember`](crate::model::StructureListMember).
|
6193 + | /// A builder for [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
4317 6194 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4318 6195 | pub struct Builder {
|
4319 - | pub(crate) a: ::std::option::Option<::std::string::String>,
|
4320 - | pub(crate) b: ::std::option::Option<::std::string::String>,
|
6196 + | pub(crate) payload: ::std::option::Option<::std::string::String>,
|
4321 6197 | }
|
4322 6198 | impl Builder {
|
4323 6199 | #[allow(missing_docs)] // documentation missing in model
|
4324 - | pub fn a(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4325 - | self.a = input;
|
4326 - | self
|
4327 - | }
|
4328 - | #[allow(missing_docs)] // documentation missing in model
|
4329 - | pub fn b(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4330 - | self.b = input;
|
6200 + | pub fn payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
6201 + | self.payload = input;
|
4331 6202 | self
|
4332 6203 | }
|
4333 - | /// Consumes the builder and constructs a [`StructureListMember`](crate::model::StructureListMember).
|
4334 - | pub fn build(self) -> crate::model::StructureListMember {
|
6204 + | /// Consumes the builder and constructs a [`StringPayloadEvent`](crate::model::StringPayloadEvent).
|
6205 + | pub fn build(self) -> crate::model::StringPayloadEvent {
|
4335 6206 | self.build_enforcing_required_and_enum_traits()
|
4336 6207 | }
|
4337 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::StructureListMember {
|
4338 - | crate::model::StructureListMember {
|
4339 - | a: self.a,
|
4340 - | b: self.b,
|
6208 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::StringPayloadEvent {
|
6209 + | crate::model::StringPayloadEvent {
|
6210 + | payload: self.payload,
|
4341 6211 | }
|
4342 6212 | }
|
4343 6213 | }
|
4344 6214 | }
|
4345 - | pub(crate) mod foo_enum_list_internal {
|
6215 + | /// See [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
6216 + | pub(crate) mod structure_payload_event_internal {
|
4346 6217 |
|
4347 - | #[allow(clippy::enum_variant_names)]
|
4348 - | #[derive(Debug, PartialEq)]
|
4349 - | pub(crate) enum ConstraintViolation {
|
4350 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4351 - | /// The first component of the tuple is the index in the collection where the
|
4352 - | /// first constraint violation was found.
|
4353 - | #[doc(hidden)]
|
4354 - | Member(usize, crate::model::foo_enum_internal::ConstraintViolation),
|
6218 + | impl ::std::convert::From<Builder> for crate::model::StructurePayloadEvent {
|
6219 + | fn from(builder: Builder) -> Self {
|
6220 + | builder.build()
|
4355 6221 | }
|
4356 - |
|
4357 - | impl ::std::fmt::Display for ConstraintViolation {
|
4358 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4359 - | let message = match self {
|
4360 - | Self::Member(index, failing_member) => format!(
|
4361 - | "Value at index {index} failed to satisfy constraint. {}",
|
4362 - | failing_member
|
4363 - | ),
|
4364 - | };
|
4365 - | write!(f, "{message}")
|
4366 6222 | }
|
6223 + | /// A builder for [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
6224 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6225 + | pub(crate) struct Builder {
|
6226 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadStructure>,
|
4367 6227 | }
|
4368 - |
|
4369 - | impl ::std::error::Error for ConstraintViolation {}
|
4370 - | impl ConstraintViolation {
|
4371 - | pub(crate) fn as_validation_exception_field(
|
4372 - | self,
|
4373 - | path: ::std::string::String,
|
4374 - | ) -> crate::model::ValidationExceptionField {
|
4375 - | match self {
|
4376 - | Self::Member(index, member_constraint_violation) => member_constraint_violation
|
4377 - | .as_validation_exception_field(path + "/" + &index.to_string()),
|
6228 + | impl Builder {
|
6229 + | #[allow(missing_docs)] // documentation missing in model
|
6230 + | pub(crate) fn set_payload(
|
6231 + | mut self,
|
6232 + | input: Option<impl ::std::convert::Into<crate::model::PayloadStructure>>,
|
6233 + | ) -> Self {
|
6234 + | self.payload = input.map(|v| v.into());
|
6235 + | self
|
6236 + | }
|
6237 + | /// Consumes the builder and constructs a [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
6238 + | pub fn build(self) -> crate::model::StructurePayloadEvent {
|
6239 + | self.build_enforcing_all_constraints()
|
6240 + | }
|
6241 + | fn build_enforcing_all_constraints(self) -> crate::model::StructurePayloadEvent {
|
6242 + | crate::model::StructurePayloadEvent {
|
6243 + | payload: self.payload,
|
4378 6244 | }
|
4379 6245 | }
|
4380 6246 | }
|
4381 6247 | }
|
4382 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4383 - | pub(crate) mod recursive_shapes_input_output_nested1_internal {
|
6248 + | /// See [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
6249 + | pub mod structure_payload_event {
|
4384 6250 |
|
4385 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
6251 + | impl ::std::convert::From<Builder> for crate::model::StructurePayloadEvent {
|
4386 6252 | fn from(builder: Builder) -> Self {
|
4387 6253 | builder.build()
|
4388 6254 | }
|
4389 6255 | }
|
4390 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6256 + | /// A builder for [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
4391 6257 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4392 - | pub(crate) struct Builder {
|
4393 - | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
4394 - | pub(crate) nested: ::std::option::Option<
|
4395 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4396 - | >,
|
6258 + | pub struct Builder {
|
6259 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadStructure>,
|
4397 6260 | }
|
4398 6261 | impl Builder {
|
4399 6262 | #[allow(missing_docs)] // documentation missing in model
|
4400 - | pub(crate) fn set_foo(
|
6263 + | pub fn payload(
|
4401 6264 | mut self,
|
4402 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
6265 + | input: ::std::option::Option<crate::model::PayloadStructure>,
|
4403 6266 | ) -> Self {
|
4404 - | self.foo = input.map(|v| v.into());
|
6267 + | self.payload = input;
|
4405 6268 | self
|
4406 6269 | }
|
6270 + | /// Consumes the builder and constructs a [`StructurePayloadEvent`](crate::model::StructurePayloadEvent).
|
6271 + | pub fn build(self) -> crate::model::StructurePayloadEvent {
|
6272 + | self.build_enforcing_required_and_enum_traits()
|
6273 + | }
|
6274 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::StructurePayloadEvent {
|
6275 + | crate::model::StructurePayloadEvent {
|
6276 + | payload: self.payload,
|
6277 + | }
|
6278 + | }
|
6279 + | }
|
6280 + | }
|
6281 + | /// See [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
6282 + | pub(crate) mod union_payload_event_internal {
|
6283 + |
|
6284 + | impl ::std::convert::From<Builder> for crate::model::UnionPayloadEvent {
|
6285 + | fn from(builder: Builder) -> Self {
|
6286 + | builder.build()
|
6287 + | }
|
6288 + | }
|
6289 + | /// A builder for [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
6290 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6291 + | pub(crate) struct Builder {
|
6292 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadUnion>,
|
6293 + | }
|
6294 + | impl Builder {
|
4407 6295 | #[allow(missing_docs)] // documentation missing in model
|
4408 - | pub(crate) fn set_nested(
|
6296 + | pub(crate) fn set_payload(
|
4409 6297 | mut self,
|
4410 - | input: Option<
|
4411 - | impl ::std::convert::Into<
|
4412 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4413 - | >,
|
4414 - | >,
|
6298 + | input: Option<impl ::std::convert::Into<crate::model::PayloadUnion>>,
|
4415 6299 | ) -> Self {
|
4416 - | self.nested = input.map(|v| v.into());
|
6300 + | self.payload = input.map(|v| v.into());
|
4417 6301 | self
|
4418 6302 | }
|
4419 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4420 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested1 {
|
6303 + | /// Consumes the builder and constructs a [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
6304 + | pub fn build(self) -> crate::model::UnionPayloadEvent {
|
4421 6305 | self.build_enforcing_all_constraints()
|
4422 6306 | }
|
4423 - | fn build_enforcing_all_constraints(
|
4424 - | self,
|
4425 - | ) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4426 - | crate::model::RecursiveShapesInputOutputNested1 {
|
4427 - | foo: self.foo,
|
4428 - | nested: self.nested,
|
6307 + | fn build_enforcing_all_constraints(self) -> crate::model::UnionPayloadEvent {
|
6308 + | crate::model::UnionPayloadEvent {
|
6309 + | payload: self.payload,
|
4429 6310 | }
|
4430 6311 | }
|
4431 6312 | }
|
4432 6313 | }
|
4433 - | /// See [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4434 - | pub mod recursive_shapes_input_output_nested1 {
|
6314 + | /// See [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
6315 + | pub mod union_payload_event {
|
4435 6316 |
|
4436 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested1 {
|
6317 + | impl ::std::convert::From<Builder> for crate::model::UnionPayloadEvent {
|
4437 6318 | fn from(builder: Builder) -> Self {
|
4438 6319 | builder.build()
|
4439 6320 | }
|
4440 6321 | }
|
4441 - | /// A builder for [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
6322 + | /// A builder for [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
4442 6323 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4443 6324 | pub struct Builder {
|
4444 - | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
4445 - | pub(crate) nested: ::std::option::Option<
|
4446 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4447 - | >,
|
6325 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadUnion>,
|
4448 6326 | }
|
4449 6327 | impl Builder {
|
4450 6328 | #[allow(missing_docs)] // documentation missing in model
|
4451 - | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4452 - | self.foo = input;
|
4453 - | self
|
4454 - | }
|
4455 - | #[allow(missing_docs)] // documentation missing in model
|
4456 - | pub fn nested(
|
4457 - | mut self,
|
4458 - | input: ::std::option::Option<
|
4459 - | ::std::boxed::Box<crate::model::RecursiveShapesInputOutputNested2>,
|
4460 - | >,
|
4461 - | ) -> Self {
|
4462 - | self.nested = input;
|
6329 + | pub fn payload(mut self, input: ::std::option::Option<crate::model::PayloadUnion>) -> Self {
|
6330 + | self.payload = input;
|
4463 6331 | self
|
4464 6332 | }
|
4465 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested1`](crate::model::RecursiveShapesInputOutputNested1).
|
4466 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested1 {
|
6333 + | /// Consumes the builder and constructs a [`UnionPayloadEvent`](crate::model::UnionPayloadEvent).
|
6334 + | pub fn build(self) -> crate::model::UnionPayloadEvent {
|
4467 6335 | self.build_enforcing_required_and_enum_traits()
|
4468 6336 | }
|
4469 - | fn build_enforcing_required_and_enum_traits(
|
4470 - | self,
|
4471 - | ) -> crate::model::RecursiveShapesInputOutputNested1 {
|
4472 - | crate::model::RecursiveShapesInputOutputNested1 {
|
4473 - | foo: self.foo,
|
4474 - | nested: self.nested,
|
6337 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::UnionPayloadEvent {
|
6338 + | crate::model::UnionPayloadEvent {
|
6339 + | payload: self.payload,
|
4475 6340 | }
|
4476 6341 | }
|
4477 6342 | }
|
4478 6343 | }
|
4479 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4480 - | pub(crate) mod recursive_shapes_input_output_nested2_internal {
|
6344 + | /// See [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
6345 + | pub(crate) mod headers_and_explicit_payload_event_internal {
|
4481 6346 |
|
4482 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
6347 + | impl ::std::convert::From<Builder> for crate::model::HeadersAndExplicitPayloadEvent {
|
4483 6348 | fn from(builder: Builder) -> Self {
|
4484 6349 | builder.build()
|
4485 6350 | }
|
4486 6351 | }
|
4487 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6352 + | /// A builder for [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
4488 6353 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4489 6354 | pub(crate) struct Builder {
|
4490 - | pub(crate) bar: ::std::option::Option<::std::string::String>,
|
4491 - | pub(crate) recursive_member:
|
4492 - | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
6355 + | pub(crate) header: ::std::option::Option<::std::string::String>,
|
6356 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadStructure>,
|
4493 6357 | }
|
4494 6358 | impl Builder {
|
4495 6359 | #[allow(missing_docs)] // documentation missing in model
|
4496 - | pub(crate) fn set_bar(
|
6360 + | pub(crate) fn set_header(
|
4497 6361 | mut self,
|
4498 6362 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4499 6363 | ) -> Self {
|
4500 - | self.bar = input.map(|v| v.into());
|
6364 + | self.header = input.map(|v| v.into());
|
4501 6365 | self
|
4502 6366 | }
|
4503 6367 | #[allow(missing_docs)] // documentation missing in model
|
4504 - | pub(crate) fn set_recursive_member(
|
6368 + | pub(crate) fn set_payload(
|
4505 6369 | mut self,
|
4506 - | input: Option<
|
4507 - | impl ::std::convert::Into<crate::model::RecursiveShapesInputOutputNested1>,
|
4508 - | >,
|
6370 + | input: Option<impl ::std::convert::Into<crate::model::PayloadStructure>>,
|
4509 6371 | ) -> Self {
|
4510 - | self.recursive_member = input.map(|v| v.into());
|
6372 + | self.payload = input.map(|v| v.into());
|
4511 6373 | self
|
4512 6374 | }
|
4513 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4514 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
4515 - | self.build_enforcing_all_constraints()
|
4516 - | }
|
4517 - | fn build_enforcing_all_constraints(
|
4518 - | self,
|
4519 - | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
4520 - | crate::model::RecursiveShapesInputOutputNested2 {
|
4521 - | bar: self.bar,
|
4522 - | recursive_member: self.recursive_member,
|
6375 + | /// Consumes the builder and constructs a [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
6376 + | pub fn build(self) -> crate::model::HeadersAndExplicitPayloadEvent {
|
6377 + | self.build_enforcing_all_constraints()
|
6378 + | }
|
6379 + | fn build_enforcing_all_constraints(self) -> crate::model::HeadersAndExplicitPayloadEvent {
|
6380 + | crate::model::HeadersAndExplicitPayloadEvent {
|
6381 + | header: self.header,
|
6382 + | payload: self.payload,
|
4523 6383 | }
|
4524 6384 | }
|
4525 6385 | }
|
4526 6386 | }
|
4527 - | /// See [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4528 - | pub mod recursive_shapes_input_output_nested2 {
|
6387 + | /// See [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
6388 + | pub mod headers_and_explicit_payload_event {
|
4529 6389 |
|
4530 - | impl ::std::convert::From<Builder> for crate::model::RecursiveShapesInputOutputNested2 {
|
6390 + | impl ::std::convert::From<Builder> for crate::model::HeadersAndExplicitPayloadEvent {
|
4531 6391 | fn from(builder: Builder) -> Self {
|
4532 6392 | builder.build()
|
4533 6393 | }
|
4534 6394 | }
|
4535 - | /// A builder for [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
6395 + | /// A builder for [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
4536 6396 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4537 6397 | pub struct Builder {
|
4538 - | pub(crate) bar: ::std::option::Option<::std::string::String>,
|
4539 - | pub(crate) recursive_member:
|
4540 - | ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
6398 + | pub(crate) header: ::std::option::Option<::std::string::String>,
|
6399 + | pub(crate) payload: ::std::option::Option<crate::model::PayloadStructure>,
|
4541 6400 | }
|
4542 6401 | impl Builder {
|
4543 6402 | #[allow(missing_docs)] // documentation missing in model
|
4544 - | pub fn bar(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4545 - | self.bar = input;
|
6403 + | pub fn header(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
6404 + | self.header = input;
|
4546 6405 | self
|
4547 6406 | }
|
4548 6407 | #[allow(missing_docs)] // documentation missing in model
|
4549 - | pub fn recursive_member(
|
6408 + | pub fn payload(
|
4550 6409 | mut self,
|
4551 - | input: ::std::option::Option<crate::model::RecursiveShapesInputOutputNested1>,
|
6410 + | input: ::std::option::Option<crate::model::PayloadStructure>,
|
4552 6411 | ) -> Self {
|
4553 - | self.recursive_member = input;
|
6412 + | self.payload = input;
|
4554 6413 | self
|
4555 6414 | }
|
4556 - | /// Consumes the builder and constructs a [`RecursiveShapesInputOutputNested2`](crate::model::RecursiveShapesInputOutputNested2).
|
4557 - | pub fn build(self) -> crate::model::RecursiveShapesInputOutputNested2 {
|
6415 + | /// Consumes the builder and constructs a [`HeadersAndExplicitPayloadEvent`](crate::model::HeadersAndExplicitPayloadEvent).
|
6416 + | pub fn build(self) -> crate::model::HeadersAndExplicitPayloadEvent {
|
4558 6417 | self.build_enforcing_required_and_enum_traits()
|
4559 6418 | }
|
4560 6419 | fn build_enforcing_required_and_enum_traits(
|
4561 6420 | self,
|
4562 - | ) -> crate::model::RecursiveShapesInputOutputNested2 {
|
4563 - | crate::model::RecursiveShapesInputOutputNested2 {
|
4564 - | bar: self.bar,
|
4565 - | recursive_member: self.recursive_member,
|
6421 + | ) -> crate::model::HeadersAndExplicitPayloadEvent {
|
6422 + | crate::model::HeadersAndExplicitPayloadEvent {
|
6423 + | header: self.header,
|
6424 + | payload: self.payload,
|
4566 6425 | }
|
4567 6426 | }
|
4568 6427 | }
|
4569 6428 | }
|
4570 - | pub(crate) mod integer_enum_set_internal {
|
4571 - |
|
4572 - | #[allow(clippy::enum_variant_names)]
|
4573 - | #[derive(Debug, PartialEq)]
|
4574 - | pub(crate) enum ConstraintViolation {
|
4575 - | /// Constraint violation error when the list does not contain unique items
|
4576 - | UniqueItems {
|
4577 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4578 - | /// at least two elements.
|
4579 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4580 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4581 - | /// Nothing is guaranteed about the order of the indices.
|
4582 - | duplicate_indices: ::std::vec::Vec<usize>,
|
4583 - | /// The original vector, that contains duplicate items.
|
4584 - | original: ::std::vec::Vec<i32>,
|
4585 - | },
|
4586 - | }
|
6429 + | /// See [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6430 + | pub(crate) mod headers_and_implicit_payload_event_internal {
|
4587 6431 |
|
4588 - | impl ::std::fmt::Display for ConstraintViolation {
|
4589 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4590 - | let message = match self {
|
4591 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4592 - | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4593 - | };
|
4594 - | write!(f, "{message}")
|
4595 - | }
|
6432 + | impl ::std::convert::From<Builder> for crate::model::HeadersAndImplicitPayloadEvent {
|
6433 + | fn from(builder: Builder) -> Self {
|
6434 + | builder.build()
|
4596 6435 | }
|
4597 - |
|
4598 - | impl ::std::error::Error for ConstraintViolation {}
|
4599 - | impl ConstraintViolation {
|
4600 - | pub(crate) fn as_validation_exception_field(
|
4601 - | self,
|
4602 - | path: ::std::string::String,
|
4603 - | ) -> crate::model::ValidationExceptionField {
|
4604 - | match self {
|
4605 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4606 - | crate::model::ValidationExceptionField {
|
4607 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4608 - | path,
|
4609 - | },
|
4610 6436 | }
|
6437 + | /// A builder for [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6438 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6439 + | pub(crate) struct Builder {
|
6440 + | pub(crate) header: ::std::option::Option<::std::string::String>,
|
6441 + | pub(crate) payload: ::std::option::Option<::std::string::String>,
|
4611 6442 | }
|
6443 + | impl Builder {
|
6444 + | #[allow(missing_docs)] // documentation missing in model
|
6445 + | pub(crate) fn set_header(
|
6446 + | mut self,
|
6447 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
6448 + | ) -> Self {
|
6449 + | self.header = input.map(|v| v.into());
|
6450 + | self
|
4612 6451 | }
|
4613 - | }
|
4614 - | pub(crate) mod foo_enum_map_internal {
|
4615 - |
|
4616 - | #[allow(clippy::enum_variant_names)]
|
4617 - | #[derive(Debug, PartialEq)]
|
4618 - | pub(crate) enum ConstraintViolation {
|
4619 - | #[doc(hidden)]
|
4620 - | Value(
|
4621 - | ::std::string::String,
|
4622 - | crate::model::foo_enum_internal::ConstraintViolation,
|
4623 - | ),
|
6452 + | #[allow(missing_docs)] // documentation missing in model
|
6453 + | pub(crate) fn set_payload(
|
6454 + | mut self,
|
6455 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
6456 + | ) -> Self {
|
6457 + | self.payload = input.map(|v| v.into());
|
6458 + | self
|
4624 6459 | }
|
4625 - |
|
4626 - | impl ::std::fmt::Display for ConstraintViolation {
|
4627 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4628 - | match self {
|
4629 - | Self::Value(_, value_constraint_violation) => {
|
4630 - | write!(f, "{}", value_constraint_violation)
|
6460 + | /// Consumes the builder and constructs a [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6461 + | pub fn build(self) -> crate::model::HeadersAndImplicitPayloadEvent {
|
6462 + | self.build_enforcing_all_constraints()
|
4631 6463 | }
|
6464 + | fn build_enforcing_all_constraints(self) -> crate::model::HeadersAndImplicitPayloadEvent {
|
6465 + | crate::model::HeadersAndImplicitPayloadEvent {
|
6466 + | header: self.header,
|
6467 + | payload: self.payload,
|
4632 6468 | }
|
4633 6469 | }
|
4634 6470 | }
|
6471 + | }
|
6472 + | /// See [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6473 + | pub mod headers_and_implicit_payload_event {
|
4635 6474 |
|
4636 - | impl ::std::error::Error for ConstraintViolation {}
|
4637 - | impl ConstraintViolation {
|
4638 - | pub(crate) fn as_validation_exception_field(
|
4639 - | self,
|
4640 - | path: ::std::string::String,
|
4641 - | ) -> crate::model::ValidationExceptionField {
|
4642 - | match self {
|
4643 - | Self::Value(key, value_constraint_violation) => value_constraint_violation
|
4644 - | .as_validation_exception_field(path + "/" + key.as_str()),
|
6475 + | impl ::std::convert::From<Builder> for crate::model::HeadersAndImplicitPayloadEvent {
|
6476 + | fn from(builder: Builder) -> Self {
|
6477 + | builder.build()
|
4645 6478 | }
|
4646 6479 | }
|
6480 + | /// A builder for [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6481 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
6482 + | pub struct Builder {
|
6483 + | pub(crate) header: ::std::option::Option<::std::string::String>,
|
6484 + | pub(crate) payload: ::std::option::Option<::std::string::String>,
|
4647 6485 | }
|
4648 - | }
|
4649 - | pub(crate) mod foo_enum_set_internal {
|
4650 - |
|
4651 - | #[allow(clippy::enum_variant_names)]
|
4652 - | #[derive(Debug, PartialEq)]
|
4653 - | pub(crate) enum ConstraintViolation {
|
4654 - | /// Constraint violation error when the list does not contain unique items
|
4655 - | UniqueItems {
|
4656 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4657 - | /// at least two elements.
|
4658 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4659 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4660 - | /// Nothing is guaranteed about the order of the indices.
|
4661 - | duplicate_indices: ::std::vec::Vec<usize>,
|
4662 - | /// The original vector, that contains duplicate items.
|
4663 - | original: ::std::vec::Vec<crate::model::FooEnum>,
|
4664 - | },
|
4665 - | /// Constraint violation error when an element doesn't satisfy its own constraints.
|
4666 - | /// The first component of the tuple is the index in the collection where the
|
4667 - | /// first constraint violation was found.
|
4668 - | #[doc(hidden)]
|
4669 - | Member(usize, crate::model::foo_enum_internal::ConstraintViolation),
|
6486 + | impl Builder {
|
6487 + | #[allow(missing_docs)] // documentation missing in model
|
6488 + | pub fn header(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
6489 + | self.header = input;
|
6490 + | self
|
4670 6491 | }
|
4671 - |
|
4672 - | impl ::std::fmt::Display for ConstraintViolation {
|
4673 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4674 - | let message = match self {
|
4675 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4676 - | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#FooEnumSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4677 - | Self::Member(index, failing_member) => format!("Value at index {index} failed to satisfy constraint. {}",
|
4678 - | failing_member)
|
4679 - | };
|
4680 - | write!(f, "{message}")
|
6492 + | #[allow(missing_docs)] // documentation missing in model
|
6493 + | pub fn payload(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
6494 + | self.payload = input;
|
6495 + | self
|
4681 6496 | }
|
6497 + | /// Consumes the builder and constructs a [`HeadersAndImplicitPayloadEvent`](crate::model::HeadersAndImplicitPayloadEvent).
|
6498 + | pub fn build(self) -> crate::model::HeadersAndImplicitPayloadEvent {
|
6499 + | self.build_enforcing_required_and_enum_traits()
|
4682 6500 | }
|
4683 - |
|
4684 - | impl ::std::error::Error for ConstraintViolation {}
|
4685 - | impl ConstraintViolation {
|
4686 - | pub(crate) fn as_validation_exception_field(
|
6501 + | fn build_enforcing_required_and_enum_traits(
|
4687 6502 | self,
|
4688 - | path: ::std::string::String,
|
4689 - | ) -> crate::model::ValidationExceptionField {
|
4690 - | match self {
|
4691 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4692 - | crate::model::ValidationExceptionField {
|
4693 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4694 - | path,
|
4695 - | },
|
4696 - | Self::Member(index, member_constraint_violation) =>
|
4697 - | member_constraint_violation.as_validation_exception_field(path + "/" + &index.to_string())
|
6503 + | ) -> crate::model::HeadersAndImplicitPayloadEvent {
|
6504 + | crate::model::HeadersAndImplicitPayloadEvent {
|
6505 + | header: self.header,
|
6506 + | payload: self.payload,
|
4698 6507 | }
|
4699 6508 | }
|
4700 6509 | }
|
4701 6510 | }
|
4702 - | /// See [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
4703 - | pub mod complex_nested_error_data {
|
6511 + | /// See [`SingletonEvent`](crate::model::SingletonEvent).
|
6512 + | pub mod singleton_event {
|
4704 6513 |
|
4705 - | impl ::std::convert::From<Builder> for crate::model::ComplexNestedErrorData {
|
6514 + | impl ::std::convert::From<Builder> for crate::model::SingletonEvent {
|
4706 6515 | fn from(builder: Builder) -> Self {
|
4707 6516 | builder.build()
|
4708 6517 | }
|
4709 6518 | }
|
4710 - | /// A builder for [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
6519 + | /// A builder for [`SingletonEvent`](crate::model::SingletonEvent).
|
4711 6520 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4712 6521 | pub struct Builder {
|
4713 - | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
6522 + | pub(crate) value: ::std::option::Option<::std::string::String>,
|
4714 6523 | }
|
4715 6524 | impl Builder {
|
4716 6525 | #[allow(missing_docs)] // documentation missing in model
|
4717 - | pub fn foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4718 - | self.foo = input;
|
6526 + | pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
6527 + | self.value = input;
|
4719 6528 | self
|
4720 6529 | }
|
4721 - | /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::model::ComplexNestedErrorData).
|
4722 - | pub fn build(self) -> crate::model::ComplexNestedErrorData {
|
6530 + | /// Consumes the builder and constructs a [`SingletonEvent`](crate::model::SingletonEvent).
|
6531 + | pub fn build(self) -> crate::model::SingletonEvent {
|
4723 6532 | self.build_enforcing_required_and_enum_traits()
|
4724 6533 | }
|
4725 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::ComplexNestedErrorData {
|
4726 - | crate::model::ComplexNestedErrorData { foo: self.foo }
|
6534 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::SingletonEvent {
|
6535 + | crate::model::SingletonEvent { value: self.value }
|
4727 6536 | }
|
4728 6537 | }
|
4729 6538 | }
|
4730 - | /// See [`NestedPayload`](crate::model::NestedPayload).
|
4731 - | pub(crate) mod nested_payload_internal {
|
6539 + | /// See [`PayloadStructure`](crate::model::PayloadStructure).
|
6540 + | pub(crate) mod payload_structure_internal {
|
4732 6541 |
|
4733 - | impl ::std::convert::From<Builder> for crate::model::NestedPayload {
|
6542 + | impl ::std::convert::From<Builder> for crate::model::PayloadStructure {
|
4734 6543 | fn from(builder: Builder) -> Self {
|
4735 6544 | builder.build()
|
4736 6545 | }
|
4737 6546 | }
|
4738 - | /// A builder for [`NestedPayload`](crate::model::NestedPayload).
|
6547 + | /// A builder for [`PayloadStructure`](crate::model::PayloadStructure).
|
4739 6548 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4740 6549 | pub(crate) struct Builder {
|
4741 - | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
4742 - | pub(crate) name: ::std::option::Option<::std::string::String>,
|
6550 + | pub(crate) structure_member: ::std::option::Option<::std::string::String>,
|
4743 6551 | }
|
4744 6552 | impl Builder {
|
4745 6553 | #[allow(missing_docs)] // documentation missing in model
|
4746 - | pub(crate) fn set_greeting(
|
4747 - | mut self,
|
4748 - | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4749 - | ) -> Self {
|
4750 - | self.greeting = input.map(|v| v.into());
|
4751 - | self
|
4752 - | }
|
4753 - | #[allow(missing_docs)] // documentation missing in model
|
4754 - | pub(crate) fn set_name(
|
6554 + | pub(crate) fn set_structure_member(
|
4755 6555 | mut self,
|
4756 6556 | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
4757 6557 | ) -> Self {
|
4758 - | self.name = input.map(|v| v.into());
|
6558 + | self.structure_member = input.map(|v| v.into());
|
4759 6559 | self
|
4760 6560 | }
|
4761 - | /// Consumes the builder and constructs a [`NestedPayload`](crate::model::NestedPayload).
|
4762 - | pub fn build(self) -> crate::model::NestedPayload {
|
6561 + | /// Consumes the builder and constructs a [`PayloadStructure`](crate::model::PayloadStructure).
|
6562 + | pub fn build(self) -> crate::model::PayloadStructure {
|
4763 6563 | self.build_enforcing_all_constraints()
|
4764 6564 | }
|
4765 - | fn build_enforcing_all_constraints(self) -> crate::model::NestedPayload {
|
4766 - | crate::model::NestedPayload {
|
4767 - | greeting: self.greeting,
|
4768 - | name: self.name,
|
6565 + | fn build_enforcing_all_constraints(self) -> crate::model::PayloadStructure {
|
6566 + | crate::model::PayloadStructure {
|
6567 + | structure_member: self.structure_member,
|
4769 6568 | }
|
4770 6569 | }
|
4771 6570 | }
|
4772 6571 | }
|
4773 - | /// See [`NestedPayload`](crate::model::NestedPayload).
|
4774 - | pub mod nested_payload {
|
6572 + | /// See [`PayloadStructure`](crate::model::PayloadStructure).
|
6573 + | pub mod payload_structure {
|
4775 6574 |
|
4776 - | impl ::std::convert::From<Builder> for crate::model::NestedPayload {
|
6575 + | impl ::std::convert::From<Builder> for crate::model::PayloadStructure {
|
4777 6576 | fn from(builder: Builder) -> Self {
|
4778 6577 | builder.build()
|
4779 6578 | }
|
4780 6579 | }
|
4781 - | /// A builder for [`NestedPayload`](crate::model::NestedPayload).
|
6580 + | /// A builder for [`PayloadStructure`](crate::model::PayloadStructure).
|
4782 6581 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
4783 6582 | pub struct Builder {
|
4784 - | pub(crate) greeting: ::std::option::Option<::std::string::String>,
|
4785 - | pub(crate) name: ::std::option::Option<::std::string::String>,
|
6583 + | pub(crate) structure_member: ::std::option::Option<::std::string::String>,
|
4786 6584 | }
|
4787 6585 | impl Builder {
|
4788 6586 | #[allow(missing_docs)] // documentation missing in model
|
4789 - | pub fn greeting(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4790 - | self.greeting = input;
|
4791 - | self
|
4792 - | }
|
4793 - | #[allow(missing_docs)] // documentation missing in model
|
4794 - | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
4795 - | self.name = input;
|
6587 + | pub fn structure_member(
|
6588 + | mut self,
|
6589 + | input: ::std::option::Option<::std::string::String>,
|
6590 + | ) -> Self {
|
6591 + | self.structure_member = input;
|
4796 6592 | self
|
4797 6593 | }
|
4798 - | /// Consumes the builder and constructs a [`NestedPayload`](crate::model::NestedPayload).
|
4799 - | pub fn build(self) -> crate::model::NestedPayload {
|
6594 + | /// Consumes the builder and constructs a [`PayloadStructure`](crate::model::PayloadStructure).
|
6595 + | pub fn build(self) -> crate::model::PayloadStructure {
|
4800 6596 | self.build_enforcing_required_and_enum_traits()
|
4801 6597 | }
|
4802 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::NestedPayload {
|
4803 - | crate::model::NestedPayload {
|
4804 - | greeting: self.greeting,
|
4805 - | name: self.name,
|
4806 - | }
|
4807 - | }
|
4808 - | }
|
4809 - | }
|
4810 - | pub(crate) mod integer_set_internal {
|
4811 - |
|
4812 - | #[allow(clippy::enum_variant_names)]
|
4813 - | #[derive(Debug, PartialEq)]
|
4814 - | pub(crate) enum ConstraintViolation {
|
4815 - | /// Constraint violation error when the list does not contain unique items
|
4816 - | UniqueItems {
|
4817 - | /// A vector of indices into `original` pointing to all duplicate items. This vector has
|
4818 - | /// at least two elements.
|
4819 - | /// More specifically, for every element `idx_1` in `duplicate_indices`, there exists another
|
4820 - | /// distinct element `idx_2` such that `original[idx_1] == original[idx_2]` is `true`.
|
4821 - | /// Nothing is guaranteed about the order of the indices.
|
4822 - | duplicate_indices: ::std::vec::Vec<usize>,
|
4823 - | /// The original vector, that contains duplicate items.
|
4824 - | original: ::std::vec::Vec<i32>,
|
4825 - | },
|
4826 - | }
|
4827 - |
|
4828 - | impl ::std::fmt::Display for ConstraintViolation {
|
4829 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
4830 - | let message = match self {
|
4831 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4832 - | format!("Value with repeated values at indices {:?} provided for 'aws.protocoltests.shared#IntegerSet' failed to satisfy constraint: Member must have unique values", &duplicate_indices),
|
4833 - | };
|
4834 - | write!(f, "{message}")
|
4835 - | }
|
4836 - | }
|
4837 - |
|
4838 - | impl ::std::error::Error for ConstraintViolation {}
|
4839 - | impl ConstraintViolation {
|
4840 - | pub(crate) fn as_validation_exception_field(
|
4841 - | self,
|
4842 - | path: ::std::string::String,
|
4843 - | ) -> crate::model::ValidationExceptionField {
|
4844 - | match self {
|
4845 - | Self::UniqueItems { duplicate_indices, .. } =>
|
4846 - | crate::model::ValidationExceptionField {
|
4847 - | message: format!("Value with repeated values at indices {:?} at '{}' failed to satisfy constraint: Member must have unique values", &duplicate_indices, &path),
|
4848 - | path,
|
4849 - | },
|
6598 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::PayloadStructure {
|
6599 + | crate::model::PayloadStructure {
|
6600 + | structure_member: self.structure_member,
|
4850 6601 | }
|
4851 6602 | }
|
4852 6603 | }
|
4853 6604 | }
|