1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + |
|
3 + | /// Describes one specific validation failure for an input member.
|
4 + | #[derive(
|
5 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
6 + | )]
|
7 + | pub struct ValidationExceptionField {
|
8 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
9 + | pub path: ::std::string::String,
|
10 + | /// A detailed description of the validation failure.
|
11 + | pub message: ::std::string::String,
|
12 + | }
|
13 + | impl ValidationExceptionField {
|
14 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
15 + | pub fn path(&self) -> &str {
|
16 + | use std::ops::Deref;
|
17 + | self.path.deref()
|
18 + | }
|
19 + | /// A detailed description of the validation failure.
|
20 + | pub fn message(&self) -> &str {
|
21 + | use std::ops::Deref;
|
22 + | self.message.deref()
|
23 + | }
|
24 + | }
|
25 + | impl ValidationExceptionField {
|
26 + | /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
27 + | pub fn builder() -> crate::model::validation_exception_field::Builder {
|
28 + | crate::model::validation_exception_field::Builder::default()
|
29 + | }
|
30 + | }
|
31 + |
|
32 + | #[allow(missing_docs)] // documentation missing in model
|
33 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
34 + | pub enum CapturePokemonEvents {
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | Event(crate::model::CaptureEvent),
|
37 + | }
|
38 + | impl CapturePokemonEvents {
|
39 + | #[allow(irrefutable_let_patterns)]
|
40 + | /// Tries to convert the enum instance into [`Event`](crate::model::CapturePokemonEvents::Event), extracting the inner [`CaptureEvent`](crate::model::CaptureEvent).
|
41 + | /// Returns `Err(&Self)` if it can't be converted.
|
42 + | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CaptureEvent, &Self> {
|
43 + | if let CapturePokemonEvents::Event(val) = &self {
|
44 + | ::std::result::Result::Ok(val)
|
45 + | } else {
|
46 + | ::std::result::Result::Err(self)
|
47 + | }
|
48 + | }
|
49 + | /// Returns true if this is a [`Event`](crate::model::CapturePokemonEvents::Event).
|
50 + | pub fn is_event(&self) -> bool {
|
51 + | self.as_event().is_ok()
|
52 + | }
|
53 + | }
|
54 + |
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | #[derive(
|
57 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
58 + | )]
|
59 + | pub struct CaptureEvent {
|
60 + | #[allow(missing_docs)] // documentation missing in model
|
61 + | pub name: ::std::option::Option<::std::string::String>,
|
62 + | #[allow(missing_docs)] // documentation missing in model
|
63 + | pub captured: ::std::option::Option<bool>,
|
64 + | #[allow(missing_docs)] // documentation missing in model
|
65 + | pub shiny: ::std::option::Option<bool>,
|
66 + | #[allow(missing_docs)] // documentation missing in model
|
67 + | pub pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
|
68 + | }
|
69 + | impl CaptureEvent {
|
70 + | #[allow(missing_docs)] // documentation missing in model
|
71 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
72 + | self.name.as_deref()
|
73 + | }
|
74 + | #[allow(missing_docs)] // documentation missing in model
|
75 + | pub fn captured(&self) -> ::std::option::Option<bool> {
|
76 + | self.captured
|
77 + | }
|
78 + | #[allow(missing_docs)] // documentation missing in model
|
79 + | pub fn shiny(&self) -> ::std::option::Option<bool> {
|
80 + | self.shiny
|
81 + | }
|
82 + | #[allow(missing_docs)] // documentation missing in model
|
83 + | pub fn pokedex_update(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
|
84 + | self.pokedex_update.as_ref()
|
85 + | }
|
86 + | }
|
87 + | impl CaptureEvent {
|
88 + | /// Creates a new builder-style object to manufacture [`CaptureEvent`](crate::model::CaptureEvent).
|
89 + | pub fn builder() -> crate::model::capture_event::Builder {
|
90 + | crate::model::capture_event::Builder::default()
|
91 + | }
|
92 + | }
|
93 + |
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
96 + | pub enum AttemptCapturingPokemonEvent {
|
97 + | #[allow(missing_docs)] // documentation missing in model
|
98 + | Event(crate::model::CapturingEvent),
|
99 + | }
|
100 + | impl AttemptCapturingPokemonEvent {
|
101 + | #[allow(irrefutable_let_patterns)]
|
102 + | /// Tries to convert the enum instance into [`Event`](crate::model::AttemptCapturingPokemonEvent::Event), extracting the inner [`CapturingEvent`](crate::model::CapturingEvent).
|
103 + | /// Returns `Err(&Self)` if it can't be converted.
|
104 + | pub fn as_event(&self) -> ::std::result::Result<&crate::model::CapturingEvent, &Self> {
|
105 + | if let AttemptCapturingPokemonEvent::Event(val) = &self {
|
106 + | ::std::result::Result::Ok(val)
|
107 + | } else {
|
108 + | ::std::result::Result::Err(self)
|
109 + | }
|
110 + | }
|
111 + | /// Returns true if this is a [`Event`](crate::model::AttemptCapturingPokemonEvent::Event).
|
112 + | pub fn is_event(&self) -> bool {
|
113 + | self.as_event().is_ok()
|
114 + | }
|
115 + | }
|
116 + |
|
117 + | #[allow(missing_docs)] // documentation missing in model
|
118 + | #[derive(
|
119 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
120 + | )]
|
121 + | pub struct CapturingEvent {
|
122 + | #[allow(missing_docs)] // documentation missing in model
|
123 + | pub payload: ::std::option::Option<crate::model::CapturingPayload>,
|
124 + | }
|
125 + | impl CapturingEvent {
|
126 + | #[allow(missing_docs)] // documentation missing in model
|
127 + | pub fn payload(&self) -> ::std::option::Option<&crate::model::CapturingPayload> {
|
128 + | self.payload.as_ref()
|
129 + | }
|
130 + | }
|
131 + | impl CapturingEvent {
|
132 + | /// Creates a new builder-style object to manufacture [`CapturingEvent`](crate::model::CapturingEvent).
|
133 + | pub fn builder() -> crate::model::capturing_event::Builder {
|
134 + | crate::model::capturing_event::Builder::default()
|
135 + | }
|
136 + | }
|
137 + | impl crate::constrained::Constrained for crate::model::CapturingEvent {
|
138 + | type Unconstrained = crate::model::capturing_event::Builder;
|
139 + | }
|
140 + |
|
141 + | #[allow(missing_docs)] // documentation missing in model
|
142 + | #[derive(
|
143 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
144 + | )]
|
145 + | pub struct CapturingPayload {
|
146 + | #[allow(missing_docs)] // documentation missing in model
|
147 + | pub name: ::std::option::Option<::std::string::String>,
|
148 + | #[allow(missing_docs)] // documentation missing in model
|
149 + | pub pokeball: ::std::option::Option<::std::string::String>,
|
150 + | }
|
151 + | impl CapturingPayload {
|
152 + | #[allow(missing_docs)] // documentation missing in model
|
153 + | pub fn name(&self) -> ::std::option::Option<&str> {
|
154 + | self.name.as_deref()
|
155 + | }
|
156 + | #[allow(missing_docs)] // documentation missing in model
|
157 + | pub fn pokeball(&self) -> ::std::option::Option<&str> {
|
158 + | self.pokeball.as_deref()
|
159 + | }
|
160 + | }
|
161 + | impl CapturingPayload {
|
162 + | /// Creates a new builder-style object to manufacture [`CapturingPayload`](crate::model::CapturingPayload).
|
163 + | pub fn builder() -> crate::model::capturing_payload::Builder {
|
164 + | crate::model::capturing_payload::Builder::default()
|
165 + | }
|
166 + | }
|
167 + | impl crate::constrained::Constrained for crate::model::CapturingPayload {
|
168 + | type Unconstrained = crate::model::capturing_payload::Builder;
|
169 + | }
|
170 + | /// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
171 + | pub mod validation_exception_field {
|
172 + |
|
173 + | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
174 + | /// Holds one variant for each of the ways the builder can fail.
|
175 + | #[non_exhaustive]
|
176 + | #[allow(clippy::enum_variant_names)]
|
177 + | pub enum ConstraintViolation {
|
178 + | /// `path` was not provided but it is required when building `ValidationExceptionField`.
|
179 + | MissingPath,
|
180 + | /// `message` was not provided but it is required when building `ValidationExceptionField`.
|
181 + | MissingMessage,
|
182 + | }
|
183 + | impl ::std::fmt::Display for ConstraintViolation {
|
184 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
185 + | match self {
|
186 + | ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
|
187 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
|
188 + | }
|
189 + | }
|
190 + | }
|
191 + | impl ::std::error::Error for ConstraintViolation {}
|
192 + | impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
|
193 + | type Error = ConstraintViolation;
|
194 + |
|
195 + | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
196 + | builder.build()
|
197 + | }
|
198 + | }
|
199 + | /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
200 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
201 + | pub struct Builder {
|
202 + | pub(crate) path: ::std::option::Option<::std::string::String>,
|
203 + | pub(crate) message: ::std::option::Option<::std::string::String>,
|
204 + | }
|
205 + | impl Builder {
|
206 + | /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
|
207 + | pub fn path(mut self, input: ::std::string::String) -> Self {
|
208 + | self.path = Some(input);
|
209 + | self
|
210 + | }
|
211 + | /// A detailed description of the validation failure.
|
212 + | pub fn message(mut self, input: ::std::string::String) -> Self {
|
213 + | self.message = Some(input);
|
214 + | self
|
215 + | }
|
216 + | /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
|
217 + | ///
|
218 + | /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
|
219 + | ///
|
220 + | /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
|
221 + | pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
222 + | self.build_enforcing_all_constraints()
|
223 + | }
|
224 + | fn build_enforcing_all_constraints(
|
225 + | self,
|
226 + | ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
|
227 + | Ok(crate::model::ValidationExceptionField {
|
228 + | path: self.path.ok_or(ConstraintViolation::MissingPath)?,
|
229 + | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
230 + | })
|
231 + | }
|
232 + | }
|
233 + | }
|
234 + | /// See [`CaptureEvent`](crate::model::CaptureEvent).
|
235 + | pub mod capture_event {
|
236 + |
|
237 + | impl ::std::convert::From<Builder> for crate::model::CaptureEvent {
|
238 + | fn from(builder: Builder) -> Self {
|
239 + | builder.build()
|
240 + | }
|
241 + | }
|
242 + | /// A builder for [`CaptureEvent`](crate::model::CaptureEvent).
|
243 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
244 + | pub struct Builder {
|
245 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
246 + | pub(crate) captured: ::std::option::Option<bool>,
|
247 + | pub(crate) shiny: ::std::option::Option<bool>,
|
248 + | pub(crate) pokedex_update: ::std::option::Option<::aws_smithy_types::Blob>,
|
249 + | }
|
250 + | impl Builder {
|
251 + | #[allow(missing_docs)] // documentation missing in model
|
252 + | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
253 + | self.name = input;
|
254 + | self
|
255 + | }
|
256 + | #[allow(missing_docs)] // documentation missing in model
|
257 + | pub fn captured(mut self, input: ::std::option::Option<bool>) -> Self {
|
258 + | self.captured = input;
|
259 + | self
|
260 + | }
|
261 + | #[allow(missing_docs)] // documentation missing in model
|
262 + | pub fn shiny(mut self, input: ::std::option::Option<bool>) -> Self {
|
263 + | self.shiny = input;
|
264 + | self
|
265 + | }
|
266 + | #[allow(missing_docs)] // documentation missing in model
|
267 + | pub fn pokedex_update(
|
268 + | mut self,
|
269 + | input: ::std::option::Option<::aws_smithy_types::Blob>,
|
270 + | ) -> Self {
|
271 + | self.pokedex_update = input;
|
272 + | self
|
273 + | }
|
274 + | /// Consumes the builder and constructs a [`CaptureEvent`](crate::model::CaptureEvent).
|
275 + | pub fn build(self) -> crate::model::CaptureEvent {
|
276 + | self.build_enforcing_all_constraints()
|
277 + | }
|
278 + | fn build_enforcing_all_constraints(self) -> crate::model::CaptureEvent {
|
279 + | crate::model::CaptureEvent {
|
280 + | name: self.name,
|
281 + | captured: self.captured,
|
282 + | shiny: self.shiny,
|
283 + | pokedex_update: self.pokedex_update,
|
284 + | }
|
285 + | }
|
286 + | }
|
287 + | }
|
288 + | /// See [`CapturingEvent`](crate::model::CapturingEvent).
|
289 + | pub mod capturing_event {
|
290 + |
|
291 + | impl ::std::convert::From<Builder> for crate::model::CapturingEvent {
|
292 + | fn from(builder: Builder) -> Self {
|
293 + | builder.build()
|
294 + | }
|
295 + | }
|
296 + | /// A builder for [`CapturingEvent`](crate::model::CapturingEvent).
|
297 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
298 + | pub struct Builder {
|
299 + | pub(crate) payload: ::std::option::Option<crate::model::CapturingPayload>,
|
300 + | }
|
301 + | impl Builder {
|
302 + | #[allow(missing_docs)] // documentation missing in model
|
303 + | pub fn payload(
|
304 + | mut self,
|
305 + | input: ::std::option::Option<crate::model::CapturingPayload>,
|
306 + | ) -> Self {
|
307 + | self.payload = input;
|
308 + | self
|
309 + | }
|
310 + | #[allow(missing_docs)] // documentation missing in model
|
311 + | pub(crate) fn set_payload(
|
312 + | mut self,
|
313 + | input: Option<impl ::std::convert::Into<crate::model::CapturingPayload>>,
|
314 + | ) -> Self {
|
315 + | self.payload = input.map(|v| v.into());
|
316 + | self
|
317 + | }
|
318 + | /// Consumes the builder and constructs a [`CapturingEvent`](crate::model::CapturingEvent).
|
319 + | pub fn build(self) -> crate::model::CapturingEvent {
|
320 + | self.build_enforcing_all_constraints()
|
321 + | }
|
322 + | fn build_enforcing_all_constraints(self) -> crate::model::CapturingEvent {
|
323 + | crate::model::CapturingEvent {
|
324 + | payload: self.payload,
|
325 + | }
|
326 + | }
|
327 + | }
|
328 + | }
|
329 + | /// See [`CapturingPayload`](crate::model::CapturingPayload).
|
330 + | pub mod capturing_payload {
|
331 + |
|
332 + | impl ::std::convert::From<Builder> for crate::model::CapturingPayload {
|
333 + | fn from(builder: Builder) -> Self {
|
334 + | builder.build()
|
335 + | }
|
336 + | }
|
337 + | /// A builder for [`CapturingPayload`](crate::model::CapturingPayload).
|
338 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
339 + | pub struct Builder {
|
340 + | pub(crate) name: ::std::option::Option<::std::string::String>,
|
341 + | pub(crate) pokeball: ::std::option::Option<::std::string::String>,
|
342 + | }
|
343 + | impl Builder {
|
344 + | #[allow(missing_docs)] // documentation missing in model
|
345 + | pub fn name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
346 + | self.name = input;
|
347 + | self
|
348 + | }
|
349 + | #[allow(missing_docs)] // documentation missing in model
|
350 + | pub(crate) fn set_name(
|
351 + | mut self,
|
352 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
353 + | ) -> Self {
|
354 + | self.name = input.map(|v| v.into());
|
355 + | self
|
356 + | }
|
357 + | #[allow(missing_docs)] // documentation missing in model
|
358 + | pub fn pokeball(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
359 + | self.pokeball = input;
|
360 + | self
|
361 + | }
|
362 + | #[allow(missing_docs)] // documentation missing in model
|
363 + | pub(crate) fn set_pokeball(
|
364 + | mut self,
|
365 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
366 + | ) -> Self {
|
367 + | self.pokeball = input.map(|v| v.into());
|
368 + | self
|
369 + | }
|
370 + | /// Consumes the builder and constructs a [`CapturingPayload`](crate::model::CapturingPayload).
|
371 + | pub fn build(self) -> crate::model::CapturingPayload {
|
372 + | self.build_enforcing_all_constraints()
|
373 + | }
|
374 + | fn build_enforcing_all_constraints(self) -> crate::model::CapturingPayload {
|
375 + | crate::model::CapturingPayload {
|
376 + | name: self.name,
|
377 + | pokeball: self.pokeball,
|
378 + | }
|
379 + | }
|
380 + | }
|
381 + | }
|