1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
4 + | pub enum AttemptCapturingPokemonEvent {
|
5 + | #[allow(missing_docs)] // documentation missing in model
|
6 + | Event(crate::model::CapturingEvent),
|
7 + | }
|
8 + | impl AttemptCapturingPokemonEvent {
|
9 + | #[allow(irrefutable_let_patterns)]
|
10 + | /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
|
11 + | /// Returns `Err(&Self)` if it can't be converted.
|
12 + | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
|
13 + | if let AttemptCapturingPokemonEvent::Event(val) = &self {
|
14 + | ::std::result::Result::Ok(val)
|
15 + | } else {
|
16 + | ::std::result::Result::Err(self)
|
17 + | }
|
18 + | }
|
19 + | /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
|
20 + | pub fn is_event(&self) -> bool {
|
21 + | self.as_event().is_ok()
|
22 + | }
|
23 + | }
|
24 + | #[pyo3::pyclass(name = "AttemptCapturingPokemonEvent")]
|
25 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
26 + | pub struct PyUnionMarkerAttemptCapturingPokemonEvent(pub AttemptCapturingPokemonEvent);
|
27 + | #[::pyo3::pymethods]
|
28 + | impl PyUnionMarkerAttemptCapturingPokemonEvent {
|
29 + | #[allow(irrefutable_let_patterns)]
|
30 + | #[staticmethod]
|
31 + | /// Creates a new union instance of [`Event`](crate::model::AttemptCapturingPokemonEvent::Event)
|
32 + | /// :param data pokemon_service_server_sdk.model.CapturingEvent:
|
33 + | /// :rtype AttemptCapturingPokemonEvent:
|
34 + | pub fn event(data: crate::model::CapturingEvent) -> Self {
|
35 + | Self(AttemptCapturingPokemonEvent::Event(data))
|
36 + | }
|
37 + | /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
|
38 + | /// :rtype pokemon_service_server_sdk.model.CapturingEvent:
|
39 + | pub fn as_event(&self) -> ::pyo3::PyResult<crate::model::CapturingEvent> {
|
40 + | match self.0.as_event() {
|
41 + | Ok(variant) => Ok(variant.clone()),
|
42 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
43 + | r"AttemptCapturingPokemonEvent variant is not of type pokemon_service_server_sdk.model.CapturingEvent",
|
44 + | )),
|
45 + | }
|
46 + | }
|
47 + | /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
|
48 + | /// :rtype bool:
|
49 + | pub fn is_event(&self) -> bool {
|
50 + | self.0.is_event()
|
51 + | }
|
52 + | }
|
53 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for AttemptCapturingPokemonEvent {
|
54 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
55 + | PyUnionMarkerAttemptCapturingPokemonEvent(self).into_py(py)
|
56 + | }
|
57 + | }
|
58 + | impl<'source> ::pyo3::FromPyObject<'source> for AttemptCapturingPokemonEvent {
|
59 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
60 + | let data: PyUnionMarkerAttemptCapturingPokemonEvent = obj.extract()?;
|
61 + | Ok(data.0)
|
62 + | }
|
63 + | }
|
64 + |
|
65 + | #[allow(missing_docs)] // documentation missing in model
|
66 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
67 + | pub enum CapturePokemonEvents {
|
68 + | #[allow(missing_docs)] // documentation missing in model
|
69 + | Event(crate::model::CaptureEvent),
|
70 + | }
|
71 + | impl CapturePokemonEvents {
|
72 + | #[allow(irrefutable_let_patterns)]
|
73 + | /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
|
74 + | /// Returns `Err(&Self)` if it can't be converted.
|
75 + | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
|
76 + | if let CapturePokemonEvents::Event(val) = &self {
|
77 + | ::std::result::Result::Ok(val)
|
78 + | } else {
|
79 + | ::std::result::Result::Err(self)
|
80 + | }
|
81 + | }
|
82 + | /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
|
83 + | pub fn is_event(&self) -> bool {
|
84 + | self.as_event().is_ok()
|
85 + | }
|
86 + | }
|
87 + | #[pyo3::pyclass(name = "CapturePokemonEvents")]
|
88 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
89 + | pub struct PyUnionMarkerCapturePokemonEvents(pub CapturePokemonEvents);
|
90 + | #[::pyo3::pymethods]
|
91 + | impl PyUnionMarkerCapturePokemonEvents {
|
92 + | #[allow(irrefutable_let_patterns)]
|
93 + | #[staticmethod]
|
94 + | /// Creates a new union instance of [`Event`](crate::model::CapturePokemonEvents::Event)
|
95 + | /// :param data pokemon_service_server_sdk.model.CaptureEvent:
|
96 + | /// :rtype CapturePokemonEvents:
|
97 + | pub fn event(data: crate::model::CaptureEvent) -> Self {
|
98 + | Self(CapturePokemonEvents::Event(data))
|
99 + | }
|
100 + | /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
|
101 + | /// :rtype pokemon_service_server_sdk.model.CaptureEvent:
|
102 + | pub fn as_event(&self) -> ::pyo3::PyResult<crate::model::CaptureEvent> {
|
103 + | match self.0.as_event() {
|
104 + | Ok(variant) => Ok(variant.clone()),
|
105 + | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
106 + | r"CapturePokemonEvents variant is not of type pokemon_service_server_sdk.model.CaptureEvent",
|
107 + | )),
|
108 + | }
|
109 + | }
|
110 + | /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
|
111 + | /// :rtype bool:
|
112 + | pub fn is_event(&self) -> bool {
|
113 + | self.0.is_event()
|
114 + | }
|
115 + | }
|
116 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for CapturePokemonEvents {
|
117 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
118 + | PyUnionMarkerCapturePokemonEvents(self).into_py(py)
|
119 + | }
|
120 + | }
|
121 + | impl<'source> ::pyo3::FromPyObject<'source> for CapturePokemonEvents {
|
122 + | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
123 + | let data: PyUnionMarkerCapturePokemonEvents = obj.extract()?;
|
124 + | Ok(data.0)
|
125 + | }
|
126 + | }
|
127 + |
|
128 + | #[::pyo3::pyclass]
|
129 + | /// :param payload typing.Optional\[pokemon_service_server_sdk.model.CapturingPayload\]:
|
130 + | /// :rtype None:
|
131 + | #[allow(missing_docs)] // documentation missing in model
|
132 + | #[derive(
|
133 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
134 + | )]
|
135 + | pub struct CapturingEvent {
|
136 + | #[pyo3(get, set)]
|
137 + | /// :type typing.Optional\[pokemon_service_server_sdk.model.CapturingPayload\]:
|
138 + | #[allow(missing_docs)] // documentation missing in model
|
139 + | pub payload: ::std::option::Option<crate::model::CapturingPayload>,
|
140 + | }
|
141 + | impl CapturingEvent {
|
142 + | #[allow(missing_docs)] // documentation missing in model
|
143 + | pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
|
144 + | self.payload.as_ref()
|
145 + | }
|
146 + | }
|
147 + | #[allow(clippy::new_without_default)]
|
148 + | #[allow(clippy::too_many_arguments)]
|
149 + | #[::pyo3::pymethods]
|
150 + | impl CapturingEvent {
|
151 + | #[new]
|
152 + | pub fn new(payload: ::std::option::Option<crate::model::CapturingPayload>) -> Self {
|
153 + | Self { payload }
|
154 + | }
|
155 + | fn __repr__(&self) -> String {
|
156 + | format!("{self:?}")
|
157 + | }
|
158 + | fn __str__(&self) -> String {
|
159 + | format!("{self:?}")
|
160 + | }
|
161 + | }
|
162 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CapturingEvent> {
|
163 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
164 + | ob.extract::<CapturingEvent>().map(Box::new)
|
165 + | }
|
166 + | }
|
167 + |
|
168 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CapturingEvent> {
|
169 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
170 + | (*self).into_py(py)
|
171 + | }
|
172 + | }
|
173 + | impl crate::constrained::Constrained for crate::model::CapturingEvent {
|
174 + | type Unconstrained = crate::model::capturing_event_internal::Builder;
|
175 + | }
|
176 + | impl CapturingEvent {
|
177 + | /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
|
178 + | pub fn builder() -> crate::model::capturing_event::Builder {
|
179 + | crate::model::capturing_event::Builder::default()
|
180 + | }
|
181 + | }
|
182 + |
|
183 + | #[::pyo3::pyclass]
|
184 + | /// :param name typing.Optional\[str\]:
|
185 + | /// :param captured typing.Optional\[bool\]:
|
186 + | /// :param shiny typing.Optional\[bool\]:
|
187 + | /// :param pokedex_update typing.Optional\[pokemon_service_server_sdk.types.Blob\]:
|
188 + | /// :rtype None:
|
189 + | #[allow(missing_docs)] // documentation missing in model
|
190 + | #[derive(
|
191 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
192 + | )]
|
193 + | pub struct CaptureEvent {
|
194 + | #[pyo3(get, set)]
|
195 + | /// :type typing.Optional\[str\]:
|
196 + | #[allow(missing_docs)] // documentation missing in model
|
197 + | pub name: ::std::option::Option<::std::string::String>,
|
198 + | #[pyo3(get, set)]
|
199 + | /// :type typing.Optional\[bool\]:
|
200 + | #[allow(missing_docs)] // documentation missing in model
|
201 + | pub captured: ::std::option::Option<bool>,
|
202 + | #[pyo3(get, set)]
|
203 + | /// :type typing.Optional\[bool\]:
|
204 + | #[allow(missing_docs)] // documentation missing in model
|
205 + | pub shiny: ::std::option::Option<bool>,
|
206 + | #[pyo3(get, set)]
|
207 + | /// :type typing.Optional\[pokemon_service_server_sdk.types.Blob\]:
|
208 + | #[allow(missing_docs)] // documentation missing in model
|
209 + | pub pokedex_update: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
210 + | }
|
211 + | impl CaptureEvent {
|
212 + | #[allow(missing_docs)] // documentation missing in model
|
213 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
214 + | self.name.as_deref()
|
215 + | }
|
216 + | #[allow(missing_docs)] // documentation missing in model
|
217 + | pub fn captured(&self) -> ::std::option::Option<bool> {
|
218 + | self.captured
|
219 + | }
|
220 + | #[allow(missing_docs)] // documentation missing in model
|
221 + | pub fn shiny(&self) -> ::std::option::Option<bool> {
|
222 + | self.shiny
|
223 + | }
|
224 + | #[allow(missing_docs)] // documentation missing in model
|
225 + | pub fn pokedex_update(
|
226 + | &self,
|
227 + | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
228 + | self.pokedex_update.as_ref()
|
229 + | }
|
230 + | }
|
231 + | #[allow(clippy::new_without_default)]
|
232 + | #[allow(clippy::too_many_arguments)]
|
233 + | #[::pyo3::pymethods]
|
234 + | impl CaptureEvent {
|
235 + | #[new]
|
236 + | pub fn new(
|
237 + | name: ::std::option::Option<::std::string::String>,
|
238 + | captured: ::std::option::Option<bool>,
|
239 + | shiny: ::std::option::Option<bool>,
|
240 + | pokedex_update: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
241 + | ) -> Self {
|
242 + | Self {
|
243 + | name,
|
244 + | captured,
|
245 + | shiny,
|
246 + | pokedex_update,
|
247 + | }
|
248 + | }
|
249 + | fn __repr__(&self) -> String {
|
250 + | format!("{self:?}")
|
251 + | }
|
252 + | fn __str__(&self) -> String {
|
253 + | format!("{self:?}")
|
254 + | }
|
255 + | }
|
256 + | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CaptureEvent> {
|
257 + | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
258 + | ob.extract::<CaptureEvent>().map(Box::new)
|
259 + | }
|
260 + | }
|
261 + |
|
262 + | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CaptureEvent> {
|
263 + | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
264 + | (*self).into_py(py)
|
265 + | }
|
266 + | }
|
267 + | impl CaptureEvent {
|
268 + | /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
|
269 + | pub fn builder() -> crate::model::capture_event::Builder {
|
270 + | crate::model::capture_event::Builder::default()
|
271 + | }
|
272 + | }
|
273 + |
|
2 274 | #[::pyo3::pyclass]
|
3 275 | /// :param path str:
|
4 276 | /// :param message str:
|
5 277 | /// :rtype None:
|
6 278 | /// Describes one specific validation failure for an input member.
|
7 279 | #[derive(
|
8 280 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
9 281 | )]
|
10 282 | pub struct ValidationExceptionField {
|
11 283 | #[pyo3(get, set)]
|
240 579 | type Unconstrained = ::std::string::String;
|
241 580 | }
|
242 581 |
|
243 582 | impl ::std::convert::From<::std::string::String>
|
244 583 | for crate::constrained::MaybeConstrained<crate::model::Language>
|
245 584 | {
|
246 585 | fn from(value: ::std::string::String) -> Self {
|
247 586 | Self::Unconstrained(value)
|
248 587 | }
|
249 588 | }
|
589 + | /// See [`CapturingEvent`](crate::model::CapturingEvent).
|
590 + | pub(crate) mod capturing_event_internal {
|
250 591 |
|
251 - | #[allow(missing_docs)] // documentation missing in model
|
252 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
253 - | pub enum CapturePokemonEvents {
|
254 - | #[allow(missing_docs)] // documentation missing in model
|
255 - | Event(crate::model::CaptureEvent),
|
256 - | }
|
257 - | impl CapturePokemonEvents {
|
258 - | #[allow(irrefutable_let_patterns)]
|
259 - | /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
|
260 - | /// Returns `Err(&Self)` if it can't be converted.
|
261 - | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
|
262 - | if let CapturePokemonEvents::Event(val) = &self {
|
263 - | ::std::result::Result::Ok(val)
|
264 - | } else {
|
265 - | ::std::result::Result::Err(self)
|
266 - | }
|
267 - | }
|
268 - | /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
|
269 - | pub fn is_event(&self) -> bool {
|
270 - | self.as_event().is_ok()
|
271 - | }
|
272 - | }
|
273 - | #[pyo3::pyclass(name = "CapturePokemonEvents")]
|
274 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
275 - | pub struct PyUnionMarkerCapturePokemonEvents(pub CapturePokemonEvents);
|
276 - | #[::pyo3::pymethods]
|
277 - | impl PyUnionMarkerCapturePokemonEvents {
|
278 - | #[allow(irrefutable_let_patterns)]
|
279 - | #[staticmethod]
|
280 - | /// Creates a new union instance of [`Event`](crate::model::CapturePokemonEvents::Event)
|
281 - | /// :param data pokemon_service_server_sdk.model.CaptureEvent:
|
282 - | /// :rtype CapturePokemonEvents:
|
283 - | pub fn event(data: crate::model::CaptureEvent) -> Self {
|
284 - | Self(CapturePokemonEvents::Event(data))
|
285 - | }
|
286 - | /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
|
287 - | /// :rtype pokemon_service_server_sdk.model.CaptureEvent:
|
288 - | pub fn as_event(&self) -> ::pyo3::PyResult<crate::model::CaptureEvent> {
|
289 - | match self.0.as_event() {
|
290 - | Ok(variant) => Ok(variant.clone()),
|
291 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
292 - | r"CapturePokemonEvents variant is not of type pokemon_service_server_sdk.model.CaptureEvent",
|
293 - | )),
|
294 - | }
|
295 - | }
|
296 - | /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
|
297 - | /// :rtype bool:
|
298 - | pub fn is_event(&self) -> bool {
|
299 - | self.0.is_event()
|
300 - | }
|
301 - | }
|
302 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for CapturePokemonEvents {
|
303 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
304 - | PyUnionMarkerCapturePokemonEvents(self).into_py(py)
|
305 - | }
|
306 - | }
|
307 - | impl<'source> ::pyo3::FromPyObject<'source> for CapturePokemonEvents {
|
308 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
309 - | let data: PyUnionMarkerCapturePokemonEvents = obj.extract()?;
|
310 - | Ok(data.0)
|
311 - | }
|
312 - | }
|
313 - |
|
314 - | #[::pyo3::pyclass]
|
315 - | /// :param name typing.Optional\[str\]:
|
316 - | /// :param captured typing.Optional\[bool\]:
|
317 - | /// :param shiny typing.Optional\[bool\]:
|
318 - | /// :param pokedex_update typing.Optional\[pokemon_service_server_sdk.types.Blob\]:
|
319 - | /// :rtype None:
|
320 - | #[allow(missing_docs)] // documentation missing in model
|
321 - | #[derive(
|
322 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
323 - | )]
|
324 - | pub struct CaptureEvent {
|
325 - | #[pyo3(get, set)]
|
326 - | /// :type typing.Optional\[str\]:
|
327 - | #[allow(missing_docs)] // documentation missing in model
|
328 - | pub name: ::std::option::Option<::std::string::String>,
|
329 - | #[pyo3(get, set)]
|
330 - | /// :type typing.Optional\[bool\]:
|
331 - | #[allow(missing_docs)] // documentation missing in model
|
332 - | pub captured: ::std::option::Option<bool>,
|
333 - | #[pyo3(get, set)]
|
334 - | /// :type typing.Optional\[bool\]:
|
335 - | #[allow(missing_docs)] // documentation missing in model
|
336 - | pub shiny: ::std::option::Option<bool>,
|
337 - | #[pyo3(get, set)]
|
338 - | /// :type typing.Optional\[pokemon_service_server_sdk.types.Blob\]:
|
339 - | #[allow(missing_docs)] // documentation missing in model
|
340 - | pub pokedex_update: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
341 - | }
|
342 - | impl CaptureEvent {
|
343 - | #[allow(missing_docs)] // documentation missing in model
|
344 - | pub fn name(&self) -> ::std::option::Option<&str> {
|
345 - | self.name.as_deref()
|
592 + | impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
|
593 + | fn from(builder: Builder) -> Self {
|
594 + | builder.build()
|
346 595 | }
|
347 - | #[allow(missing_docs)] // documentation missing in model
|
348 - | pub fn captured(&self) -> ::std::option::Option<bool> {
|
349 - | self.captured
|
350 596 | }
|
351 - | #[allow(missing_docs)] // documentation missing in model
|
352 - | pub fn shiny(&self) -> ::std::option::Option<bool> {
|
353 - | self.shiny
|
597 + | /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
|
598 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
599 + | pub(crate) struct Builder {
|
600 + | pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
|
354 601 | }
|
602 + | impl Builder {
|
355 603 | #[allow(missing_docs)] // documentation missing in model
|
356 - | pub fn pokedex_update(
|
357 - | &self,
|
358 - | ) -> ::std::option::Option<&::aws_smithy_http_server_python::types::Blob> {
|
359 - | self.pokedex_update.as_ref()
|
360 - | }
|
361 - | }
|
362 - | #[allow(clippy::new_without_default)]
|
363 - | #[allow(clippy::too_many_arguments)]
|
364 - | #[::pyo3::pymethods]
|
365 - | impl CaptureEvent {
|
366 - | #[new]
|
367 - | pub fn new(
|
368 - | name: ::std::option::Option<::std::string::String>,
|
369 - | captured: ::std::option::Option<bool>,
|
370 - | shiny: ::std::option::Option<bool>,
|
371 - | pokedex_update: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
604 + | pub(crate) fn set_payload(
|
605 + | mut self,
|
606 + | input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
|
372 607 | ) -> Self {
|
373 - | Self {
|
374 - | name,
|
375 - | captured,
|
376 - | shiny,
|
377 - | pokedex_update,
|
378 - | }
|
379 - | }
|
380 - | fn __repr__(&self) -> String {
|
381 - | format!("{self:?}")
|
608 + | self.payload = input.map(|v| v.into());
|
609 + | self
|
382 610 | }
|
383 - | fn __str__(&self) -> String {
|
384 - | format!("{self:?}")
|
611 + | /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
|
612 + | pub fn build(self) -> crate::model::CapturingEvent {
|
613 + | self.build_enforcing_all_constraints()
|
385 614 | }
|
386 - | }
|
387 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CaptureEvent> {
|
388 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
389 - | ob.extract::<CaptureEvent>().map(Box::new)
|
615 + | fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
|
616 + | crate::model::CapturingEvent {
|
617 + | payload: self.payload,
|
390 618 | }
|
391 - | }
|
392 - |
|
393 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CaptureEvent> {
|
394 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
395 - | (*self).into_py(py)
|
396 619 | }
|
397 - | }
|
398 - | impl CaptureEvent {
|
399 - | /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
|
400 - | pub fn builder() -> crate::model::capture_event::Builder {
|
401 - | crate::model::capture_event::Builder::default()
|
402 620 | }
|
403 621 | }
|
622 + | /// See [`CapturingEvent`](crate::model::CapturingEvent).
|
623 + | pub mod capturing_event {
|
404 624 |
|
405 - | #[allow(missing_docs)] // documentation missing in model
|
406 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
407 - | pub enum AttemptCapturingPokemonEvent {
|
408 - | #[allow(missing_docs)] // documentation missing in model
|
409 - | Event(crate::model::CapturingEvent),
|
410 - | }
|
411 - | impl AttemptCapturingPokemonEvent {
|
412 - | #[allow(irrefutable_let_patterns)]
|
413 - | /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
|
414 - | /// Returns `Err(&Self)` if it can't be converted.
|
415 - | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
|
416 - | if let AttemptCapturingPokemonEvent::Event(val) = &self {
|
417 - | ::std::result::Result::Ok(val)
|
418 - | } else {
|
419 - | ::std::result::Result::Err(self)
|
420 - | }
|
421 - | }
|
422 - | /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
|
423 - | pub fn is_event(&self) -> bool {
|
424 - | self.as_event().is_ok()
|
425 - | }
|
426 - | }
|
427 - | #[pyo3::pyclass(name = "AttemptCapturingPokemonEvent")]
|
428 - | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
429 - | pub struct PyUnionMarkerAttemptCapturingPokemonEvent(pub AttemptCapturingPokemonEvent);
|
430 - | #[::pyo3::pymethods]
|
431 - | impl PyUnionMarkerAttemptCapturingPokemonEvent {
|
432 - | #[allow(irrefutable_let_patterns)]
|
433 - | #[staticmethod]
|
434 - | /// Creates a new union instance of [`Event`](crate::model::AttemptCapturingPokemonEvent::Event)
|
435 - | /// :param data pokemon_service_server_sdk.model.CapturingEvent:
|
436 - | /// :rtype AttemptCapturingPokemonEvent:
|
437 - | pub fn event(data: crate::model::CapturingEvent) -> Self {
|
438 - | Self(AttemptCapturingPokemonEvent::Event(data))
|
439 - | }
|
440 - | /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
|
441 - | /// :rtype pokemon_service_server_sdk.model.CapturingEvent:
|
442 - | pub fn as_event(&self) -> ::pyo3::PyResult<crate::model::CapturingEvent> {
|
443 - | match self.0.as_event() {
|
444 - | Ok(variant) => Ok(variant.clone()),
|
445 - | Err(_) => Err(::pyo3::exceptions::PyValueError::new_err(
|
446 - | r"AttemptCapturingPokemonEvent variant is not of type pokemon_service_server_sdk.model.CapturingEvent",
|
447 - | )),
|
448 - | }
|
449 - | }
|
450 - | /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
|
451 - | /// :rtype bool:
|
452 - | pub fn is_event(&self) -> bool {
|
453 - | self.0.is_event()
|
625 + | impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
|
626 + | fn from(builder: Builder) -> Self {
|
627 + | builder.build()
|
454 628 | }
|
455 - | }
|
456 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for AttemptCapturingPokemonEvent {
|
457 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
458 - | PyUnionMarkerAttemptCapturingPokemonEvent(self).into_py(py)
|
459 629 | }
|
460 - | }
|
461 - | impl<'source> ::pyo3::FromPyObject<'source> for AttemptCapturingPokemonEvent {
|
462 - | fn extract(obj: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
463 - | let data: PyUnionMarkerAttemptCapturingPokemonEvent = obj.extract()?;
|
464 - | Ok(data.0)
|
630 + | /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
|
631 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
632 + | pub struct Builder {
|
633 + | pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
|
465 634 | }
|
466 - | }
|
467 - |
|
468 - | #[::pyo3::pyclass]
|
469 - | /// :param payload typing.Optional\[pokemon_service_server_sdk.model.CapturingPayload\]:
|
470 - | /// :rtype None:
|
471 - | #[allow(missing_docs)] // documentation missing in model
|
472 - | #[derive(
|
473 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
474 - | )]
|
475 - | pub struct CapturingEvent {
|
476 - | #[pyo3(get, set)]
|
477 - | /// :type typing.Optional\[pokemon_service_server_sdk.model.CapturingPayload\]:
|
478 - | #[allow(missing_docs)] // documentation missing in model
|
479 - | pub payload: ::std::option::Option<crate::model::CapturingPayload>,
|
480 - | }
|
481 - | impl CapturingEvent {
|
635 + | impl Builder {
|
482 636 | #[allow(missing_docs)] // documentation missing in model
|
483 - | pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
|
484 - | self.payload.as_ref()
|
637 + | pub fn payload(
|
638 + | mut self,
|
639 + | input: ::std::option::Option<crate::model::CapturingPayload>,
|
640 + | ) -> Self {
|
641 + | self.payload = input;
|
642 + | self
|
485 643 | }
|
486 - | }
|
487 - | #[allow(clippy::new_without_default)]
|
488 - | #[allow(clippy::too_many_arguments)]
|
489 - | #[::pyo3::pymethods]
|
490 - | impl CapturingEvent {
|
491 - | #[new]
|
492 - | pub fn new(payload: ::std::option::Option<crate::model::CapturingPayload>) -> Self {
|
493 - | Self { payload }
|
644 + | /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
|
645 + | pub fn build(self) -> crate::model::CapturingEvent {
|
646 + | self.build_enforcing_required_and_enum_traits()
|
494 647 | }
|
495 - | fn __repr__(&self) -> String {
|
496 - | format!("{self:?}")
|
648 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::CapturingEvent {
|
649 + | crate::model::CapturingEvent {
|
650 + | payload: self.payload,
|
497 651 | }
|
498 - | fn __str__(&self) -> String {
|
499 - | format!("{self:?}")
|
500 652 | }
|
501 - | }
|
502 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CapturingEvent> {
|
503 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
504 - | ob.extract::<CapturingEvent>().map(Box::new)
|
505 653 | }
|
506 654 | }
|
655 + | /// See [`CaptureEvent`](crate::model::CaptureEvent).
|
656 + | pub mod capture_event {
|
507 657 |
|
508 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CapturingEvent> {
|
509 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
510 - | (*self).into_py(py)
|
658 + | impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
|
659 + | fn from(builder: Builder) -> Self {
|
660 + | builder.build()
|
511 661 | }
|
512 - | }
|
513 - | impl crate::constrained::Constrained for crate::model::CapturingEvent {
|
514 - | type Unconstrained = crate::model::capturing_event_internal::Builder;
|
515 - | }
|
516 - | impl CapturingEvent {
|
517 - | /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
|
518 - | pub fn builder() -> crate::model::capturing_event::Builder {
|
519 - | crate::model::capturing_event::Builder::default()
|
520 662 | }
|
521 - | }
|
522 - |
|
523 - | #[::pyo3::pyclass]
|
524 - | /// :param name typing.Optional\[str\]:
|
525 - | /// :param pokeball typing.Optional\[str\]:
|
526 - | /// :rtype None:
|
527 - | #[allow(missing_docs)] // documentation missing in model
|
528 - | #[derive(
|
529 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
530 - | )]
|
531 - | pub struct CapturingPayload {
|
532 - | #[pyo3(get, set)]
|
533 - | /// :type typing.Optional\[str\]:
|
534 - | #[allow(missing_docs)] // documentation missing in model
|
535 - | pub name: ::std::option::Option<::std::string::String>,
|
536 - | #[pyo3(get, set)]
|
537 - | /// :type typing.Optional\[str\]:
|
663 + | /// A builder for [`CaptureEvent`](crate::model::CaptureEvent).
|
664 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
665 + | pub struct Builder {
|
666 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
667 + | pub(crate) captured: ::std::option::Option<bool>,
|
668 + | pub(crate) shiny: ::std::option::Option<bool>,
|
669 + | pub(crate) pokedex_update:
|
670 + | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
671 + | }
|
672 + | impl Builder {
|
538 673 | #[allow(missing_docs)] // documentation missing in model
|
539 - | pub pokeball: ::std::option::Option<::std::string::String>,
|
540 - | }
|
541 - | impl CapturingPayload {
|
674 + | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
675 + | self.name = input;
|
676 + | self
|
677 + | }
|
542 678 | #[allow(missing_docs)] // documentation missing in model
|
543 - | pub fn name(&self) -> ::std::option::Option<&str> {
|
544 - | self.name.as_deref()
|
679 + | pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
|
680 + | self.captured = input;
|
681 + | self
|
545 682 | }
|
546 683 | #[allow(missing_docs)] // documentation missing in model
|
547 - | pub fn pokeball(&self) -> ::std::option::Option<&str> {
|
548 - | self.pokeball.as_deref()
|
684 + | pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
|
685 + | self.shiny = input;
|
686 + | self
|
549 687 | }
|
550 - | }
|
551 - | #[allow(clippy::new_without_default)]
|
552 - | #[allow(clippy::too_many_arguments)]
|
553 - | #[::pyo3::pymethods]
|
554 - | impl CapturingPayload {
|
555 - | #[new]
|
556 - | pub fn new(
|
557 - | name: ::std::option::Option<::std::string::String>,
|
558 - | pokeball: ::std::option::Option<::std::string::String>,
|
688 + | #[allow(missing_docs)] // documentation missing in model
|
689 + | pub fn pokedex_update(
|
690 + | mut self,
|
691 + | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
559 692 | ) -> Self {
|
560 - | Self { name, pokeball }
|
561 - | }
|
562 - | fn __repr__(&self) -> String {
|
563 - | format!("{self:?}")
|
693 + | self.pokedex_update = input;
|
694 + | self
|
564 695 | }
|
565 - | fn __str__(&self) -> String {
|
566 - | format!("{self:?}")
|
696 + | /// Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
|
697 + | pub fn build(self) -> crate::model::CaptureEvent {
|
698 + | self.build_enforcing_required_and_enum_traits()
|
567 699 | }
|
568 - | }
|
569 - | impl<'source> ::pyo3::FromPyObject<'source> for std::boxed::Box<CapturingPayload> {
|
570 - | fn extract(ob: &'source ::pyo3::PyAny) -> ::pyo3::PyResult<Self> {
|
571 - | ob.extract::<CapturingPayload>().map(Box::new)
|
700 + | fn build_enforcing_required_and_enum_traits(self) -> crate::model::CaptureEvent {
|
701 + | crate::model::CaptureEvent {
|
702 + | name: self.name,
|
703 + | captured: self.captured,
|
704 + | shiny: self.shiny,
|
705 + | pokedex_update: self.pokedex_update,
|
572 706 | }
|
573 - | }
|
574 - |
|
575 - | impl ::pyo3::IntoPy<::pyo3::PyObject> for std::boxed::Box<CapturingPayload> {
|
576 - | fn into_py(self, py: ::pyo3::Python<'_>) -> ::pyo3::PyObject {
|
577 - | (*self).into_py(py)
|
578 707 | }
|
579 - | }
|
580 - | impl crate::constrained::Constrained for crate::model::CapturingPayload {
|
581 - | type Unconstrained = crate::model::capturing_payload_internal::Builder;
|
582 - | }
|
583 - | impl CapturingPayload {
|
584 - | /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
|
585 - | pub fn builder() -> crate::model::capturing_payload::Builder {
|
586 - | crate::model::capturing_payload::Builder::default()
|
587 708 | }
|
588 709 | }
|
589 710 | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
590 711 | pub mod validation_exception_field {
|
591 712 |
|
592 713 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
593 714 | /// Holds one variant for each of the ways the builder can fail.
|
594 715 | #[allow(clippy::enum_variant_names)]
|
595 716 | pub enum ConstraintViolation {
|
596 717 | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
711 832 | ) -> Result<crate::model::FlavorText, ConstraintViolation> {
|
712 833 | Ok(crate::model::FlavorText {
|
713 834 | flavor_text: self
|
714 835 | .flavor_text
|
715 836 | .ok_or(ConstraintViolation::MissingFlavorText)?,
|
716 837 | language: self.language.ok_or(ConstraintViolation::MissingLanguage)?,
|
717 838 | })
|
718 839 | }
|
719 840 | }
|
720 841 | }
|
721 - | /// See [`CaptureEvent`](crate::model::CaptureEvent).
|
722 - | pub mod capture_event {
|
723 - |
|
724 - | impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
|
725 - | fn from(builder: Builder) -> Self {
|
726 - | builder.build()
|
727 - | }
|
728 - | }
|
729 - | /// A builder for [`CaptureEvent`](crate::model::CaptureEvent).
|
730 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
731 - | pub struct Builder {
|
732 - | pub(crate) name: ::std::option::Option<::std::string::String>,
|
733 - | pub(crate) captured: ::std::option::Option<bool>,
|
734 - | pub(crate) shiny: ::std::option::Option<bool>,
|
735 - | pub(crate) pokedex_update:
|
736 - | ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
737 - | }
|
738 - | impl Builder {
|
739 - | #[allow(missing_docs)] // documentation missing in model
|
740 - | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
741 - | self.name = input;
|
742 - | self
|
743 - | }
|
744 - | #[allow(missing_docs)] // documentation missing in model
|
745 - | pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
|
746 - | self.captured = input;
|
747 - | self
|
748 - | }
|
749 - | #[allow(missing_docs)] // documentation missing in model
|
750 - | pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
|
751 - | self.shiny = input;
|
752 - | self
|
753 - | }
|
754 - | #[allow(missing_docs)] // documentation missing in model
|
755 - | pub fn pokedex_update(
|
756 - | mut self,
|
757 - | input: ::std::option::Option<::aws_smithy_http_server_python::types::Blob>,
|
758 - | ) -> Self {
|
759 - | self.pokedex_update = input;
|
760 - | self
|
761 - | }
|
762 - | /// Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
|
763 - | pub fn build(self) -> crate::model::CaptureEvent {
|
764 - | self.build_enforcing_required_and_enum_traits()
|
765 - | }
|
766 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::CaptureEvent {
|
767 - | crate::model::CaptureEvent {
|
768 - | name: self.name,
|
769 - | captured: self.captured,
|
770 - | shiny: self.shiny,
|
771 - | pokedex_update: self.pokedex_update,
|
772 - | }
|
773 - | }
|
774 - | }
|
775 - | }
|
776 - | /// See [`CapturingEvent`](crate::model::CapturingEvent).
|
777 - | pub(crate) mod capturing_event_internal {
|
778 - |
|
779 - | impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
|
780 - | fn from(builder: Builder) -> Self {
|
781 - | builder.build()
|
782 - | }
|
783 - | }
|
784 - | /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
|
785 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
786 - | pub(crate) struct Builder {
|
787 - | pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
|
788 - | }
|
789 - | impl Builder {
|
790 - | #[allow(missing_docs)] // documentation missing in model
|
791 - | pub(crate) fn set_payload(
|
792 - | mut self,
|
793 - | input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
|
794 - | ) -> Self {
|
795 - | self.payload = input.map(|v| v.into());
|
796 - | self
|
797 - | }
|
798 - | /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
|
799 - | pub fn build(self) -> crate::model::CapturingEvent {
|
800 - | self.build_enforcing_all_constraints()
|
801 - | }
|
802 - | fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
|
803 - | crate::model::CapturingEvent {
|
804 - | payload: self.payload,
|
805 - | }
|
806 - | }
|
807 - | }
|
808 - | }
|
809 - | /// See [`CapturingEvent`](crate::model::CapturingEvent).
|
810 - | pub mod capturing_event {
|
811 - |
|
812 - | impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
|
813 - | fn from(builder: Builder) -> Self {
|
814 - | builder.build()
|
815 - | }
|
816 - | }
|
817 - | /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
|
818 - | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
819 - | pub struct Builder {
|
820 - | pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
|
821 - | }
|
822 - | impl Builder {
|
823 - | #[allow(missing_docs)] // documentation missing in model
|
824 - | pub fn payload(
|
825 - | mut self,
|
826 - | input: ::std::option::Option<crate::model::CapturingPayload>,
|
827 - | ) -> Self {
|
828 - | self.payload = input;
|
829 - | self
|
830 - | }
|
831 - | /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
|
832 - | pub fn build(self) -> crate::model::CapturingEvent {
|
833 - | self.build_enforcing_required_and_enum_traits()
|
834 - | }
|
835 - | fn build_enforcing_required_and_enum_traits(self) -> crate::model::CapturingEvent {
|
836 - | crate::model::CapturingEvent {
|
837 - | payload: self.payload,
|
838 - | }
|
839 - | }
|
840 - | }
|
841 - | }
|
842 842 | /// See [`CapturingPayload`](crate::model::CapturingPayload).
|
843 843 | pub(crate) mod capturing_payload_internal {
|
844 844 |
|
845 845 | impl ::std::convert::From<Builder> for crate::model::CapturingPayload {
|
846 846 | fn from(builder: Builder) -> Self {
|
847 847 | builder.build()
|
848 848 | }
|
849 849 | }
|
850 850 | /// A builder for [`CapturingPayload`](crate::model::CapturingPayload).
|
851 851 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|