1#[derive(Clone, Eq, PartialEq)]
2#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
3#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
4#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
5pub struct IssuingAuthorizationVerificationData {
6 pub address_line1_check: IssuingAuthorizationVerificationDataAddressLine1Check,
8 pub address_postal_code_check: IssuingAuthorizationVerificationDataAddressPostalCodeCheck,
10 pub authentication_exemption:
12 Option<stripe_shared::IssuingAuthorizationAuthenticationExemption>,
13 pub cvc_check: IssuingAuthorizationVerificationDataCvcCheck,
15 pub expiry_check: IssuingAuthorizationVerificationDataExpiryCheck,
17 pub postal_code: Option<String>,
19 pub three_d_secure: Option<stripe_shared::IssuingAuthorizationThreeDSecure>,
21}
22#[cfg(feature = "redact-generated-debug")]
23impl std::fmt::Debug for IssuingAuthorizationVerificationData {
24 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
25 f.debug_struct("IssuingAuthorizationVerificationData").finish_non_exhaustive()
26 }
27}
28#[doc(hidden)]
29pub struct IssuingAuthorizationVerificationDataBuilder {
30 address_line1_check: Option<IssuingAuthorizationVerificationDataAddressLine1Check>,
31 address_postal_code_check: Option<IssuingAuthorizationVerificationDataAddressPostalCodeCheck>,
32 authentication_exemption:
33 Option<Option<stripe_shared::IssuingAuthorizationAuthenticationExemption>>,
34 cvc_check: Option<IssuingAuthorizationVerificationDataCvcCheck>,
35 expiry_check: Option<IssuingAuthorizationVerificationDataExpiryCheck>,
36 postal_code: Option<Option<String>>,
37 three_d_secure: Option<Option<stripe_shared::IssuingAuthorizationThreeDSecure>>,
38}
39
40#[allow(
41 unused_variables,
42 irrefutable_let_patterns,
43 clippy::let_unit_value,
44 clippy::match_single_binding,
45 clippy::single_match
46)]
47const _: () = {
48 use miniserde::de::{Map, Visitor};
49 use miniserde::json::Value;
50 use miniserde::{Deserialize, Result, make_place};
51 use stripe_types::miniserde_helpers::FromValueOpt;
52 use stripe_types::{MapBuilder, ObjectDeser};
53
54 make_place!(Place);
55
56 impl Deserialize for IssuingAuthorizationVerificationData {
57 fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
58 Place::new(out)
59 }
60 }
61
62 struct Builder<'a> {
63 out: &'a mut Option<IssuingAuthorizationVerificationData>,
64 builder: IssuingAuthorizationVerificationDataBuilder,
65 }
66
67 impl Visitor for Place<IssuingAuthorizationVerificationData> {
68 fn map(&mut self) -> Result<Box<dyn Map + '_>> {
69 Ok(Box::new(Builder {
70 out: &mut self.out,
71 builder: IssuingAuthorizationVerificationDataBuilder::deser_default(),
72 }))
73 }
74 }
75
76 impl MapBuilder for IssuingAuthorizationVerificationDataBuilder {
77 type Out = IssuingAuthorizationVerificationData;
78 fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
79 Ok(match k {
80 "address_line1_check" => Deserialize::begin(&mut self.address_line1_check),
81 "address_postal_code_check" => {
82 Deserialize::begin(&mut self.address_postal_code_check)
83 }
84 "authentication_exemption" => {
85 Deserialize::begin(&mut self.authentication_exemption)
86 }
87 "cvc_check" => Deserialize::begin(&mut self.cvc_check),
88 "expiry_check" => Deserialize::begin(&mut self.expiry_check),
89 "postal_code" => Deserialize::begin(&mut self.postal_code),
90 "three_d_secure" => Deserialize::begin(&mut self.three_d_secure),
91 _ => <dyn Visitor>::ignore(),
92 })
93 }
94
95 fn deser_default() -> Self {
96 Self {
97 address_line1_check: None,
98 address_postal_code_check: None,
99 authentication_exemption: Some(None),
100 cvc_check: None,
101 expiry_check: None,
102 postal_code: Some(None),
103 three_d_secure: Some(None),
104 }
105 }
106
107 fn take_out(&mut self) -> Option<Self::Out> {
108 let (
109 Some(address_line1_check),
110 Some(address_postal_code_check),
111 Some(authentication_exemption),
112 Some(cvc_check),
113 Some(expiry_check),
114 Some(postal_code),
115 Some(three_d_secure),
116 ) = (
117 self.address_line1_check.take(),
118 self.address_postal_code_check.take(),
119 self.authentication_exemption.take(),
120 self.cvc_check.take(),
121 self.expiry_check.take(),
122 self.postal_code.take(),
123 self.three_d_secure.take(),
124 )
125 else {
126 return None;
127 };
128 Some(Self::Out {
129 address_line1_check,
130 address_postal_code_check,
131 authentication_exemption,
132 cvc_check,
133 expiry_check,
134 postal_code,
135 three_d_secure,
136 })
137 }
138 }
139
140 impl Map for Builder<'_> {
141 fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
142 self.builder.key(k)
143 }
144
145 fn finish(&mut self) -> Result<()> {
146 *self.out = self.builder.take_out();
147 Ok(())
148 }
149 }
150
151 impl ObjectDeser for IssuingAuthorizationVerificationData {
152 type Builder = IssuingAuthorizationVerificationDataBuilder;
153 }
154
155 impl FromValueOpt for IssuingAuthorizationVerificationData {
156 fn from_value(v: Value) -> Option<Self> {
157 let Value::Object(obj) = v else {
158 return None;
159 };
160 let mut b = IssuingAuthorizationVerificationDataBuilder::deser_default();
161 for (k, v) in obj {
162 match k.as_str() {
163 "address_line1_check" => b.address_line1_check = FromValueOpt::from_value(v),
164 "address_postal_code_check" => {
165 b.address_postal_code_check = FromValueOpt::from_value(v)
166 }
167 "authentication_exemption" => {
168 b.authentication_exemption = FromValueOpt::from_value(v)
169 }
170 "cvc_check" => b.cvc_check = FromValueOpt::from_value(v),
171 "expiry_check" => b.expiry_check = FromValueOpt::from_value(v),
172 "postal_code" => b.postal_code = FromValueOpt::from_value(v),
173 "three_d_secure" => b.three_d_secure = FromValueOpt::from_value(v),
174 _ => {}
175 }
176 }
177 b.take_out()
178 }
179 }
180};
181#[derive(Clone, Eq, PartialEq)]
183#[non_exhaustive]
184pub enum IssuingAuthorizationVerificationDataAddressLine1Check {
185 Match,
186 Mismatch,
187 NotProvided,
188 Unknown(String),
190}
191impl IssuingAuthorizationVerificationDataAddressLine1Check {
192 pub fn as_str(&self) -> &str {
193 use IssuingAuthorizationVerificationDataAddressLine1Check::*;
194 match self {
195 Match => "match",
196 Mismatch => "mismatch",
197 NotProvided => "not_provided",
198 Unknown(v) => v,
199 }
200 }
201}
202
203impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressLine1Check {
204 type Err = std::convert::Infallible;
205 fn from_str(s: &str) -> Result<Self, Self::Err> {
206 use IssuingAuthorizationVerificationDataAddressLine1Check::*;
207 match s {
208 "match" => Ok(Match),
209 "mismatch" => Ok(Mismatch),
210 "not_provided" => Ok(NotProvided),
211 v => {
212 tracing::warn!(
213 "Unknown value '{}' for enum '{}'",
214 v,
215 "IssuingAuthorizationVerificationDataAddressLine1Check"
216 );
217 Ok(Unknown(v.to_owned()))
218 }
219 }
220 }
221}
222impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressLine1Check {
223 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
224 f.write_str(self.as_str())
225 }
226}
227
228#[cfg(not(feature = "redact-generated-debug"))]
229impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressLine1Check {
230 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
231 f.write_str(self.as_str())
232 }
233}
234#[cfg(feature = "redact-generated-debug")]
235impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressLine1Check {
236 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
237 f.debug_struct(stringify!(IssuingAuthorizationVerificationDataAddressLine1Check))
238 .finish_non_exhaustive()
239 }
240}
241#[cfg(feature = "serialize")]
242impl serde::Serialize for IssuingAuthorizationVerificationDataAddressLine1Check {
243 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
244 where
245 S: serde::Serializer,
246 {
247 serializer.serialize_str(self.as_str())
248 }
249}
250impl miniserde::Deserialize for IssuingAuthorizationVerificationDataAddressLine1Check {
251 fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
252 crate::Place::new(out)
253 }
254}
255
256impl miniserde::de::Visitor
257 for crate::Place<IssuingAuthorizationVerificationDataAddressLine1Check>
258{
259 fn string(&mut self, s: &str) -> miniserde::Result<()> {
260 use std::str::FromStr;
261 self.out = Some(
262 IssuingAuthorizationVerificationDataAddressLine1Check::from_str(s).expect("infallible"),
263 );
264 Ok(())
265 }
266}
267
268stripe_types::impl_from_val_with_from_str!(IssuingAuthorizationVerificationDataAddressLine1Check);
269#[cfg(feature = "deserialize")]
270impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressLine1Check {
271 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
272 use std::str::FromStr;
273 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
274 Ok(Self::from_str(&s).expect("infallible"))
275 }
276}
277#[derive(Clone, Eq, PartialEq)]
279#[non_exhaustive]
280pub enum IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
281 Match,
282 Mismatch,
283 NotProvided,
284 Unknown(String),
286}
287impl IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
288 pub fn as_str(&self) -> &str {
289 use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*;
290 match self {
291 Match => "match",
292 Mismatch => "mismatch",
293 NotProvided => "not_provided",
294 Unknown(v) => v,
295 }
296 }
297}
298
299impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
300 type Err = std::convert::Infallible;
301 fn from_str(s: &str) -> Result<Self, Self::Err> {
302 use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*;
303 match s {
304 "match" => Ok(Match),
305 "mismatch" => Ok(Mismatch),
306 "not_provided" => Ok(NotProvided),
307 v => {
308 tracing::warn!(
309 "Unknown value '{}' for enum '{}'",
310 v,
311 "IssuingAuthorizationVerificationDataAddressPostalCodeCheck"
312 );
313 Ok(Unknown(v.to_owned()))
314 }
315 }
316 }
317}
318impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
319 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
320 f.write_str(self.as_str())
321 }
322}
323
324#[cfg(not(feature = "redact-generated-debug"))]
325impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
326 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
327 f.write_str(self.as_str())
328 }
329}
330#[cfg(feature = "redact-generated-debug")]
331impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
332 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
333 f.debug_struct(stringify!(IssuingAuthorizationVerificationDataAddressPostalCodeCheck))
334 .finish_non_exhaustive()
335 }
336}
337#[cfg(feature = "serialize")]
338impl serde::Serialize for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
339 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
340 where
341 S: serde::Serializer,
342 {
343 serializer.serialize_str(self.as_str())
344 }
345}
346impl miniserde::Deserialize for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
347 fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
348 crate::Place::new(out)
349 }
350}
351
352impl miniserde::de::Visitor
353 for crate::Place<IssuingAuthorizationVerificationDataAddressPostalCodeCheck>
354{
355 fn string(&mut self, s: &str) -> miniserde::Result<()> {
356 use std::str::FromStr;
357 self.out = Some(
358 IssuingAuthorizationVerificationDataAddressPostalCodeCheck::from_str(s)
359 .expect("infallible"),
360 );
361 Ok(())
362 }
363}
364
365stripe_types::impl_from_val_with_from_str!(
366 IssuingAuthorizationVerificationDataAddressPostalCodeCheck
367);
368#[cfg(feature = "deserialize")]
369impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressPostalCodeCheck {
370 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
371 use std::str::FromStr;
372 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
373 Ok(Self::from_str(&s).expect("infallible"))
374 }
375}
376#[derive(Clone, Eq, PartialEq)]
378#[non_exhaustive]
379pub enum IssuingAuthorizationVerificationDataCvcCheck {
380 Match,
381 Mismatch,
382 NotProvided,
383 Unknown(String),
385}
386impl IssuingAuthorizationVerificationDataCvcCheck {
387 pub fn as_str(&self) -> &str {
388 use IssuingAuthorizationVerificationDataCvcCheck::*;
389 match self {
390 Match => "match",
391 Mismatch => "mismatch",
392 NotProvided => "not_provided",
393 Unknown(v) => v,
394 }
395 }
396}
397
398impl std::str::FromStr for IssuingAuthorizationVerificationDataCvcCheck {
399 type Err = std::convert::Infallible;
400 fn from_str(s: &str) -> Result<Self, Self::Err> {
401 use IssuingAuthorizationVerificationDataCvcCheck::*;
402 match s {
403 "match" => Ok(Match),
404 "mismatch" => Ok(Mismatch),
405 "not_provided" => Ok(NotProvided),
406 v => {
407 tracing::warn!(
408 "Unknown value '{}' for enum '{}'",
409 v,
410 "IssuingAuthorizationVerificationDataCvcCheck"
411 );
412 Ok(Unknown(v.to_owned()))
413 }
414 }
415 }
416}
417impl std::fmt::Display for IssuingAuthorizationVerificationDataCvcCheck {
418 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
419 f.write_str(self.as_str())
420 }
421}
422
423#[cfg(not(feature = "redact-generated-debug"))]
424impl std::fmt::Debug for IssuingAuthorizationVerificationDataCvcCheck {
425 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
426 f.write_str(self.as_str())
427 }
428}
429#[cfg(feature = "redact-generated-debug")]
430impl std::fmt::Debug for IssuingAuthorizationVerificationDataCvcCheck {
431 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
432 f.debug_struct(stringify!(IssuingAuthorizationVerificationDataCvcCheck))
433 .finish_non_exhaustive()
434 }
435}
436#[cfg(feature = "serialize")]
437impl serde::Serialize for IssuingAuthorizationVerificationDataCvcCheck {
438 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
439 where
440 S: serde::Serializer,
441 {
442 serializer.serialize_str(self.as_str())
443 }
444}
445impl miniserde::Deserialize for IssuingAuthorizationVerificationDataCvcCheck {
446 fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
447 crate::Place::new(out)
448 }
449}
450
451impl miniserde::de::Visitor for crate::Place<IssuingAuthorizationVerificationDataCvcCheck> {
452 fn string(&mut self, s: &str) -> miniserde::Result<()> {
453 use std::str::FromStr;
454 self.out =
455 Some(IssuingAuthorizationVerificationDataCvcCheck::from_str(s).expect("infallible"));
456 Ok(())
457 }
458}
459
460stripe_types::impl_from_val_with_from_str!(IssuingAuthorizationVerificationDataCvcCheck);
461#[cfg(feature = "deserialize")]
462impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataCvcCheck {
463 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
464 use std::str::FromStr;
465 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
466 Ok(Self::from_str(&s).expect("infallible"))
467 }
468}
469#[derive(Clone, Eq, PartialEq)]
471#[non_exhaustive]
472pub enum IssuingAuthorizationVerificationDataExpiryCheck {
473 Match,
474 Mismatch,
475 NotProvided,
476 Unknown(String),
478}
479impl IssuingAuthorizationVerificationDataExpiryCheck {
480 pub fn as_str(&self) -> &str {
481 use IssuingAuthorizationVerificationDataExpiryCheck::*;
482 match self {
483 Match => "match",
484 Mismatch => "mismatch",
485 NotProvided => "not_provided",
486 Unknown(v) => v,
487 }
488 }
489}
490
491impl std::str::FromStr for IssuingAuthorizationVerificationDataExpiryCheck {
492 type Err = std::convert::Infallible;
493 fn from_str(s: &str) -> Result<Self, Self::Err> {
494 use IssuingAuthorizationVerificationDataExpiryCheck::*;
495 match s {
496 "match" => Ok(Match),
497 "mismatch" => Ok(Mismatch),
498 "not_provided" => Ok(NotProvided),
499 v => {
500 tracing::warn!(
501 "Unknown value '{}' for enum '{}'",
502 v,
503 "IssuingAuthorizationVerificationDataExpiryCheck"
504 );
505 Ok(Unknown(v.to_owned()))
506 }
507 }
508 }
509}
510impl std::fmt::Display for IssuingAuthorizationVerificationDataExpiryCheck {
511 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
512 f.write_str(self.as_str())
513 }
514}
515
516#[cfg(not(feature = "redact-generated-debug"))]
517impl std::fmt::Debug for IssuingAuthorizationVerificationDataExpiryCheck {
518 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
519 f.write_str(self.as_str())
520 }
521}
522#[cfg(feature = "redact-generated-debug")]
523impl std::fmt::Debug for IssuingAuthorizationVerificationDataExpiryCheck {
524 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
525 f.debug_struct(stringify!(IssuingAuthorizationVerificationDataExpiryCheck))
526 .finish_non_exhaustive()
527 }
528}
529#[cfg(feature = "serialize")]
530impl serde::Serialize for IssuingAuthorizationVerificationDataExpiryCheck {
531 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
532 where
533 S: serde::Serializer,
534 {
535 serializer.serialize_str(self.as_str())
536 }
537}
538impl miniserde::Deserialize for IssuingAuthorizationVerificationDataExpiryCheck {
539 fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
540 crate::Place::new(out)
541 }
542}
543
544impl miniserde::de::Visitor for crate::Place<IssuingAuthorizationVerificationDataExpiryCheck> {
545 fn string(&mut self, s: &str) -> miniserde::Result<()> {
546 use std::str::FromStr;
547 self.out =
548 Some(IssuingAuthorizationVerificationDataExpiryCheck::from_str(s).expect("infallible"));
549 Ok(())
550 }
551}
552
553stripe_types::impl_from_val_with_from_str!(IssuingAuthorizationVerificationDataExpiryCheck);
554#[cfg(feature = "deserialize")]
555impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataExpiryCheck {
556 fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
557 use std::str::FromStr;
558 let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
559 Ok(Self::from_str(&s).expect("infallible"))
560 }
561}