Skip to main content

stripe_webhook/generated/
mod.rs

1#[derive(Clone)]
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))]
5#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
6pub enum AccountExternalAccountCreated {
7    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
8    BankAccount(stripe_shared::BankAccount),
9    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
10    Card(stripe_shared::Card),
11    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
12    Source(stripe_shared::Source),
13}
14
15#[derive(Default)]
16pub struct AccountExternalAccountCreatedBuilder {
17    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
18}
19
20const _: () = {
21    use miniserde::de::{Map, Visitor};
22    use miniserde::json::Value;
23    use miniserde::{Deserialize, Result, make_place};
24    use stripe_types::MapBuilder;
25    use stripe_types::miniserde_helpers::FromValueOpt;
26
27    use super::*;
28
29    make_place!(Place);
30
31    struct Builder<'a> {
32        out: &'a mut Option<AccountExternalAccountCreated>,
33        builder: AccountExternalAccountCreatedBuilder,
34    }
35
36    impl Deserialize for AccountExternalAccountCreated {
37        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
38            Place::new(out)
39        }
40    }
41
42    impl Visitor for Place<AccountExternalAccountCreated> {
43        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
44            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
45        }
46    }
47
48    impl Map for Builder<'_> {
49        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
50            self.builder.key(k)
51        }
52
53        fn finish(&mut self) -> Result<()> {
54            *self.out = self.builder.take_out();
55            Ok(())
56        }
57    }
58
59    impl MapBuilder for AccountExternalAccountCreatedBuilder {
60        type Out = AccountExternalAccountCreated;
61        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
62            self.inner.key_inner(k)
63        }
64
65        fn deser_default() -> Self {
66            Self::default()
67        }
68
69        fn take_out(&mut self) -> Option<Self::Out> {
70            let (k, o) = self.inner.finish_inner()?;
71            AccountExternalAccountCreated::construct(&k, o)
72        }
73    }
74
75    impl stripe_types::ObjectDeser for AccountExternalAccountCreated {
76        type Builder = AccountExternalAccountCreatedBuilder;
77    }
78    impl AccountExternalAccountCreated {
79        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
80            Some(match key {
81                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
82                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
83                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
84
85                _ => {
86                    tracing::warn!(
87                        "Unknown object type '{}' for enum '{}'",
88                        key,
89                        "AccountExternalAccountCreated"
90                    );
91                    return None;
92                }
93            })
94        }
95    }
96
97    impl FromValueOpt for AccountExternalAccountCreated {
98        fn from_value(v: Value) -> Option<Self> {
99            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
100            Self::construct(&typ, obj)
101        }
102    }
103};
104
105#[cfg(feature = "redact-generated-debug")]
106impl std::fmt::Debug for AccountExternalAccountCreated {
107    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
108        f.debug_struct("AccountExternalAccountCreated").finish_non_exhaustive()
109    }
110}
111#[derive(Clone)]
112#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
113#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
114#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
115#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
116pub enum AccountExternalAccountDeleted {
117    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
118    BankAccount(stripe_shared::BankAccount),
119    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
120    Card(stripe_shared::Card),
121    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
122    Source(stripe_shared::Source),
123}
124
125#[derive(Default)]
126pub struct AccountExternalAccountDeletedBuilder {
127    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
128}
129
130const _: () = {
131    use miniserde::de::{Map, Visitor};
132    use miniserde::json::Value;
133    use miniserde::{Deserialize, Result, make_place};
134    use stripe_types::MapBuilder;
135    use stripe_types::miniserde_helpers::FromValueOpt;
136
137    use super::*;
138
139    make_place!(Place);
140
141    struct Builder<'a> {
142        out: &'a mut Option<AccountExternalAccountDeleted>,
143        builder: AccountExternalAccountDeletedBuilder,
144    }
145
146    impl Deserialize for AccountExternalAccountDeleted {
147        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
148            Place::new(out)
149        }
150    }
151
152    impl Visitor for Place<AccountExternalAccountDeleted> {
153        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
154            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
155        }
156    }
157
158    impl Map for Builder<'_> {
159        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
160            self.builder.key(k)
161        }
162
163        fn finish(&mut self) -> Result<()> {
164            *self.out = self.builder.take_out();
165            Ok(())
166        }
167    }
168
169    impl MapBuilder for AccountExternalAccountDeletedBuilder {
170        type Out = AccountExternalAccountDeleted;
171        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
172            self.inner.key_inner(k)
173        }
174
175        fn deser_default() -> Self {
176            Self::default()
177        }
178
179        fn take_out(&mut self) -> Option<Self::Out> {
180            let (k, o) = self.inner.finish_inner()?;
181            AccountExternalAccountDeleted::construct(&k, o)
182        }
183    }
184
185    impl stripe_types::ObjectDeser for AccountExternalAccountDeleted {
186        type Builder = AccountExternalAccountDeletedBuilder;
187    }
188    impl AccountExternalAccountDeleted {
189        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
190            Some(match key {
191                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
192                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
193                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
194
195                _ => {
196                    tracing::warn!(
197                        "Unknown object type '{}' for enum '{}'",
198                        key,
199                        "AccountExternalAccountDeleted"
200                    );
201                    return None;
202                }
203            })
204        }
205    }
206
207    impl FromValueOpt for AccountExternalAccountDeleted {
208        fn from_value(v: Value) -> Option<Self> {
209            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
210            Self::construct(&typ, obj)
211        }
212    }
213};
214
215#[cfg(feature = "redact-generated-debug")]
216impl std::fmt::Debug for AccountExternalAccountDeleted {
217    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
218        f.debug_struct("AccountExternalAccountDeleted").finish_non_exhaustive()
219    }
220}
221#[derive(Clone)]
222#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
223#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
224#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
225#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
226pub enum AccountExternalAccountUpdated {
227    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
228    BankAccount(stripe_shared::BankAccount),
229    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
230    Card(stripe_shared::Card),
231    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
232    Source(stripe_shared::Source),
233}
234
235#[derive(Default)]
236pub struct AccountExternalAccountUpdatedBuilder {
237    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
238}
239
240const _: () = {
241    use miniserde::de::{Map, Visitor};
242    use miniserde::json::Value;
243    use miniserde::{Deserialize, Result, make_place};
244    use stripe_types::MapBuilder;
245    use stripe_types::miniserde_helpers::FromValueOpt;
246
247    use super::*;
248
249    make_place!(Place);
250
251    struct Builder<'a> {
252        out: &'a mut Option<AccountExternalAccountUpdated>,
253        builder: AccountExternalAccountUpdatedBuilder,
254    }
255
256    impl Deserialize for AccountExternalAccountUpdated {
257        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
258            Place::new(out)
259        }
260    }
261
262    impl Visitor for Place<AccountExternalAccountUpdated> {
263        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
264            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
265        }
266    }
267
268    impl Map for Builder<'_> {
269        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
270            self.builder.key(k)
271        }
272
273        fn finish(&mut self) -> Result<()> {
274            *self.out = self.builder.take_out();
275            Ok(())
276        }
277    }
278
279    impl MapBuilder for AccountExternalAccountUpdatedBuilder {
280        type Out = AccountExternalAccountUpdated;
281        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
282            self.inner.key_inner(k)
283        }
284
285        fn deser_default() -> Self {
286            Self::default()
287        }
288
289        fn take_out(&mut self) -> Option<Self::Out> {
290            let (k, o) = self.inner.finish_inner()?;
291            AccountExternalAccountUpdated::construct(&k, o)
292        }
293    }
294
295    impl stripe_types::ObjectDeser for AccountExternalAccountUpdated {
296        type Builder = AccountExternalAccountUpdatedBuilder;
297    }
298    impl AccountExternalAccountUpdated {
299        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
300            Some(match key {
301                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
302                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
303                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
304
305                _ => {
306                    tracing::warn!(
307                        "Unknown object type '{}' for enum '{}'",
308                        key,
309                        "AccountExternalAccountUpdated"
310                    );
311                    return None;
312                }
313            })
314        }
315    }
316
317    impl FromValueOpt for AccountExternalAccountUpdated {
318        fn from_value(v: Value) -> Option<Self> {
319            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
320            Self::construct(&typ, obj)
321        }
322    }
323};
324
325#[cfg(feature = "redact-generated-debug")]
326impl std::fmt::Debug for AccountExternalAccountUpdated {
327    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
328        f.debug_struct("AccountExternalAccountUpdated").finish_non_exhaustive()
329    }
330}
331#[derive(Clone)]
332#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
333#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
334#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
335#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
336pub enum CustomerSourceCreated {
337    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
338    BankAccount(stripe_shared::BankAccount),
339    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
340    Card(stripe_shared::Card),
341    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
342    Source(stripe_shared::Source),
343}
344
345#[derive(Default)]
346pub struct CustomerSourceCreatedBuilder {
347    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
348}
349
350const _: () = {
351    use miniserde::de::{Map, Visitor};
352    use miniserde::json::Value;
353    use miniserde::{Deserialize, Result, make_place};
354    use stripe_types::MapBuilder;
355    use stripe_types::miniserde_helpers::FromValueOpt;
356
357    use super::*;
358
359    make_place!(Place);
360
361    struct Builder<'a> {
362        out: &'a mut Option<CustomerSourceCreated>,
363        builder: CustomerSourceCreatedBuilder,
364    }
365
366    impl Deserialize for CustomerSourceCreated {
367        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
368            Place::new(out)
369        }
370    }
371
372    impl Visitor for Place<CustomerSourceCreated> {
373        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
374            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
375        }
376    }
377
378    impl Map for Builder<'_> {
379        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
380            self.builder.key(k)
381        }
382
383        fn finish(&mut self) -> Result<()> {
384            *self.out = self.builder.take_out();
385            Ok(())
386        }
387    }
388
389    impl MapBuilder for CustomerSourceCreatedBuilder {
390        type Out = CustomerSourceCreated;
391        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
392            self.inner.key_inner(k)
393        }
394
395        fn deser_default() -> Self {
396            Self::default()
397        }
398
399        fn take_out(&mut self) -> Option<Self::Out> {
400            let (k, o) = self.inner.finish_inner()?;
401            CustomerSourceCreated::construct(&k, o)
402        }
403    }
404
405    impl stripe_types::ObjectDeser for CustomerSourceCreated {
406        type Builder = CustomerSourceCreatedBuilder;
407    }
408    impl CustomerSourceCreated {
409        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
410            Some(match key {
411                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
412                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
413                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
414
415                _ => {
416                    tracing::warn!(
417                        "Unknown object type '{}' for enum '{}'",
418                        key,
419                        "CustomerSourceCreated"
420                    );
421                    return None;
422                }
423            })
424        }
425    }
426
427    impl FromValueOpt for CustomerSourceCreated {
428        fn from_value(v: Value) -> Option<Self> {
429            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
430            Self::construct(&typ, obj)
431        }
432    }
433};
434
435#[cfg(feature = "redact-generated-debug")]
436impl std::fmt::Debug for CustomerSourceCreated {
437    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
438        f.debug_struct("CustomerSourceCreated").finish_non_exhaustive()
439    }
440}
441#[derive(Clone)]
442#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
443#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
444#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
445#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
446pub enum CustomerSourceDeleted {
447    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
448    BankAccount(stripe_shared::BankAccount),
449    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
450    Card(stripe_shared::Card),
451    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
452    Source(stripe_shared::Source),
453}
454
455#[derive(Default)]
456pub struct CustomerSourceDeletedBuilder {
457    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
458}
459
460const _: () = {
461    use miniserde::de::{Map, Visitor};
462    use miniserde::json::Value;
463    use miniserde::{Deserialize, Result, make_place};
464    use stripe_types::MapBuilder;
465    use stripe_types::miniserde_helpers::FromValueOpt;
466
467    use super::*;
468
469    make_place!(Place);
470
471    struct Builder<'a> {
472        out: &'a mut Option<CustomerSourceDeleted>,
473        builder: CustomerSourceDeletedBuilder,
474    }
475
476    impl Deserialize for CustomerSourceDeleted {
477        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
478            Place::new(out)
479        }
480    }
481
482    impl Visitor for Place<CustomerSourceDeleted> {
483        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
484            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
485        }
486    }
487
488    impl Map for Builder<'_> {
489        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
490            self.builder.key(k)
491        }
492
493        fn finish(&mut self) -> Result<()> {
494            *self.out = self.builder.take_out();
495            Ok(())
496        }
497    }
498
499    impl MapBuilder for CustomerSourceDeletedBuilder {
500        type Out = CustomerSourceDeleted;
501        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
502            self.inner.key_inner(k)
503        }
504
505        fn deser_default() -> Self {
506            Self::default()
507        }
508
509        fn take_out(&mut self) -> Option<Self::Out> {
510            let (k, o) = self.inner.finish_inner()?;
511            CustomerSourceDeleted::construct(&k, o)
512        }
513    }
514
515    impl stripe_types::ObjectDeser for CustomerSourceDeleted {
516        type Builder = CustomerSourceDeletedBuilder;
517    }
518    impl CustomerSourceDeleted {
519        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
520            Some(match key {
521                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
522                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
523                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
524
525                _ => {
526                    tracing::warn!(
527                        "Unknown object type '{}' for enum '{}'",
528                        key,
529                        "CustomerSourceDeleted"
530                    );
531                    return None;
532                }
533            })
534        }
535    }
536
537    impl FromValueOpt for CustomerSourceDeleted {
538        fn from_value(v: Value) -> Option<Self> {
539            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
540            Self::construct(&typ, obj)
541        }
542    }
543};
544
545#[cfg(feature = "redact-generated-debug")]
546impl std::fmt::Debug for CustomerSourceDeleted {
547    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
548        f.debug_struct("CustomerSourceDeleted").finish_non_exhaustive()
549    }
550}
551#[derive(Clone)]
552#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
553#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
554#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
555#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
556pub enum CustomerSourceExpiring {
557    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
558    Card(stripe_shared::Card),
559    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
560    Source(stripe_shared::Source),
561}
562
563#[derive(Default)]
564pub struct CustomerSourceExpiringBuilder {
565    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
566}
567
568const _: () = {
569    use miniserde::de::{Map, Visitor};
570    use miniserde::json::Value;
571    use miniserde::{Deserialize, Result, make_place};
572    use stripe_types::MapBuilder;
573    use stripe_types::miniserde_helpers::FromValueOpt;
574
575    use super::*;
576
577    make_place!(Place);
578
579    struct Builder<'a> {
580        out: &'a mut Option<CustomerSourceExpiring>,
581        builder: CustomerSourceExpiringBuilder,
582    }
583
584    impl Deserialize for CustomerSourceExpiring {
585        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
586            Place::new(out)
587        }
588    }
589
590    impl Visitor for Place<CustomerSourceExpiring> {
591        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
592            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
593        }
594    }
595
596    impl Map for Builder<'_> {
597        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
598            self.builder.key(k)
599        }
600
601        fn finish(&mut self) -> Result<()> {
602            *self.out = self.builder.take_out();
603            Ok(())
604        }
605    }
606
607    impl MapBuilder for CustomerSourceExpiringBuilder {
608        type Out = CustomerSourceExpiring;
609        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
610            self.inner.key_inner(k)
611        }
612
613        fn deser_default() -> Self {
614            Self::default()
615        }
616
617        fn take_out(&mut self) -> Option<Self::Out> {
618            let (k, o) = self.inner.finish_inner()?;
619            CustomerSourceExpiring::construct(&k, o)
620        }
621    }
622
623    impl stripe_types::ObjectDeser for CustomerSourceExpiring {
624        type Builder = CustomerSourceExpiringBuilder;
625    }
626    impl CustomerSourceExpiring {
627        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
628            Some(match key {
629                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
630                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
631
632                _ => {
633                    tracing::warn!(
634                        "Unknown object type '{}' for enum '{}'",
635                        key,
636                        "CustomerSourceExpiring"
637                    );
638                    return None;
639                }
640            })
641        }
642    }
643
644    impl FromValueOpt for CustomerSourceExpiring {
645        fn from_value(v: Value) -> Option<Self> {
646            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
647            Self::construct(&typ, obj)
648        }
649    }
650};
651
652#[cfg(feature = "redact-generated-debug")]
653impl std::fmt::Debug for CustomerSourceExpiring {
654    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
655        f.debug_struct("CustomerSourceExpiring").finish_non_exhaustive()
656    }
657}
658#[derive(Clone)]
659#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
660#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
661#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
662#[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(tag = "object"))]
663pub enum CustomerSourceUpdated {
664    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "bank_account"))]
665    BankAccount(stripe_shared::BankAccount),
666    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "card"))]
667    Card(stripe_shared::Card),
668    #[cfg_attr(any(feature = "deserialize", feature = "serialize"), serde(rename = "source"))]
669    Source(stripe_shared::Source),
670}
671
672#[derive(Default)]
673pub struct CustomerSourceUpdatedBuilder {
674    inner: stripe_types::miniserde_helpers::ObjectBuilderInner,
675}
676
677const _: () = {
678    use miniserde::de::{Map, Visitor};
679    use miniserde::json::Value;
680    use miniserde::{Deserialize, Result, make_place};
681    use stripe_types::MapBuilder;
682    use stripe_types::miniserde_helpers::FromValueOpt;
683
684    use super::*;
685
686    make_place!(Place);
687
688    struct Builder<'a> {
689        out: &'a mut Option<CustomerSourceUpdated>,
690        builder: CustomerSourceUpdatedBuilder,
691    }
692
693    impl Deserialize for CustomerSourceUpdated {
694        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
695            Place::new(out)
696        }
697    }
698
699    impl Visitor for Place<CustomerSourceUpdated> {
700        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
701            Ok(Box::new(Builder { out: &mut self.out, builder: Default::default() }))
702        }
703    }
704
705    impl Map for Builder<'_> {
706        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
707            self.builder.key(k)
708        }
709
710        fn finish(&mut self) -> Result<()> {
711            *self.out = self.builder.take_out();
712            Ok(())
713        }
714    }
715
716    impl MapBuilder for CustomerSourceUpdatedBuilder {
717        type Out = CustomerSourceUpdated;
718        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
719            self.inner.key_inner(k)
720        }
721
722        fn deser_default() -> Self {
723            Self::default()
724        }
725
726        fn take_out(&mut self) -> Option<Self::Out> {
727            let (k, o) = self.inner.finish_inner()?;
728            CustomerSourceUpdated::construct(&k, o)
729        }
730    }
731
732    impl stripe_types::ObjectDeser for CustomerSourceUpdated {
733        type Builder = CustomerSourceUpdatedBuilder;
734    }
735    impl CustomerSourceUpdated {
736        fn construct(key: &str, o: miniserde::json::Object) -> Option<Self> {
737            Some(match key {
738                "bank_account" => Self::BankAccount(FromValueOpt::from_value(Value::Object(o))?),
739                "card" => Self::Card(FromValueOpt::from_value(Value::Object(o))?),
740                "source" => Self::Source(FromValueOpt::from_value(Value::Object(o))?),
741
742                _ => {
743                    tracing::warn!(
744                        "Unknown object type '{}' for enum '{}'",
745                        key,
746                        "CustomerSourceUpdated"
747                    );
748                    return None;
749                }
750            })
751        }
752    }
753
754    impl FromValueOpt for CustomerSourceUpdated {
755        fn from_value(v: Value) -> Option<Self> {
756            let (typ, obj) = stripe_types::miniserde_helpers::extract_object_discr(v)?;
757            Self::construct(&typ, obj)
758        }
759    }
760};
761
762#[cfg(feature = "redact-generated-debug")]
763impl std::fmt::Debug for CustomerSourceUpdated {
764    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
765        f.debug_struct("CustomerSourceUpdated").finish_non_exhaustive()
766    }
767}
768#[derive(Clone)]
769#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
770#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
771#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
772#[cfg_attr(any(feature = "serialize", feature = "deserialize"), serde(untagged))]
773#[non_exhaustive]
774/// The event data for a webhook event.
775pub enum EventObject {
776    /// Occurs whenever a user authorizes an application. Sent to the related application only.
777    AccountApplicationAuthorized(Box<stripe_shared::Application>),
778    /// Occurs whenever a user deauthorizes an application. Sent to the related application only.
779    AccountApplicationDeauthorized(Box<stripe_shared::Application>),
780    /// Occurs whenever an external account is created.
781    AccountExternalAccountCreated(Box<AccountExternalAccountCreated>),
782    /// Occurs whenever an external account is deleted.
783    AccountExternalAccountDeleted(Box<AccountExternalAccountDeleted>),
784    /// Occurs whenever an external account is updated.
785    AccountExternalAccountUpdated(Box<AccountExternalAccountUpdated>),
786    /// Occurs whenever an account status or property has changed.
787    AccountUpdated(Box<stripe_shared::Account>),
788    /// Occurs whenever an application fee is created on a charge.
789    ApplicationFeeCreated(Box<stripe_shared::ApplicationFee>),
790    /// Occurs whenever an application fee refund is updated.
791    ApplicationFeeRefundUpdated(Box<stripe_shared::ApplicationFeeRefund>),
792    /// Occurs whenever an application fee is refunded, whether from refunding a charge or from [refunding the application fee directly](#fee_refunds).
793    /// This includes partial refunds.
794    ApplicationFeeRefunded(Box<stripe_shared::ApplicationFee>),
795    /// Occurs whenever your Stripe balance has been updated (e.g., when a charge is available to be paid out).
796    /// By default, Stripe automatically transfers funds in your balance to your bank account on a daily basis.
797    /// This event is not fired for negative transactions.
798    #[cfg(feature = "async-stripe-core")]
799    BalanceAvailable(Box<stripe_core::Balance>),
800    /// Occurs whenever a balance settings status or property has changed.
801    #[cfg(feature = "async-stripe-core")]
802    BalanceSettingsUpdated(Box<stripe_core::BalanceSettings>),
803    /// Occurs whenever your custom alert threshold is met.
804    #[cfg(feature = "async-stripe-billing")]
805    BillingAlertTriggered(Box<stripe_billing::BillingAlertTriggered>),
806    /// Occurs when a credit balance transaction is created
807    BillingCreditBalanceTransactionCreated(Box<stripe_shared::BillingCreditBalanceTransaction>),
808    /// Occurs when a credit grant is created
809    BillingCreditGrantCreated(Box<stripe_shared::BillingCreditGrant>),
810    /// Occurs when a credit grant is updated
811    BillingCreditGrantUpdated(Box<stripe_shared::BillingCreditGrant>),
812    /// Occurs when a meter is created
813    #[cfg(feature = "async-stripe-billing")]
814    BillingMeterCreated(Box<stripe_billing::BillingMeter>),
815    /// Occurs when a meter is deactivated
816    #[cfg(feature = "async-stripe-billing")]
817    BillingMeterDeactivated(Box<stripe_billing::BillingMeter>),
818    /// Occurs when a meter is reactivated
819    #[cfg(feature = "async-stripe-billing")]
820    BillingMeterReactivated(Box<stripe_billing::BillingMeter>),
821    /// Occurs when a meter is updated
822    #[cfg(feature = "async-stripe-billing")]
823    BillingMeterUpdated(Box<stripe_billing::BillingMeter>),
824    /// Occurs whenever a portal configuration is created.
825    #[cfg(feature = "async-stripe-billing")]
826    BillingPortalConfigurationCreated(Box<stripe_billing::BillingPortalConfiguration>),
827    /// Occurs whenever a portal configuration is updated.
828    #[cfg(feature = "async-stripe-billing")]
829    BillingPortalConfigurationUpdated(Box<stripe_billing::BillingPortalConfiguration>),
830    /// Occurs whenever a portal session is created.
831    #[cfg(feature = "async-stripe-billing")]
832    BillingPortalSessionCreated(Box<stripe_billing::BillingPortalSession>),
833    /// Occurs whenever a capability has new requirements or a new status.
834    CapabilityUpdated(Box<stripe_shared::Capability>),
835    /// Occurs whenever there is a positive remaining cash balance after Stripe automatically reconciles new funds into the cash balance.
836    /// If you enabled manual reconciliation, this webhook will fire whenever there are new funds into the cash balance.
837    CashBalanceFundsAvailable(Box<stripe_shared::CashBalance>),
838    /// Occurs whenever a previously uncaptured charge is captured.
839    ChargeCaptured(Box<stripe_shared::Charge>),
840    /// Occurs when a dispute is closed and the dispute status changes to `lost`, `warning_closed`, or `won`.
841    ChargeDisputeClosed(Box<stripe_shared::Dispute>),
842    /// Occurs whenever a customer disputes a charge with their bank.
843    ChargeDisputeCreated(Box<stripe_shared::Dispute>),
844    /// Occurs when funds are reinstated to your account after a dispute is closed.
845    /// This includes [partially refunded payments](https://docs.stripe.com/disputes#disputes-on-partially-refunded-payments).
846    ChargeDisputeFundsReinstated(Box<stripe_shared::Dispute>),
847    /// Occurs when funds are removed from your account due to a dispute.
848    ChargeDisputeFundsWithdrawn(Box<stripe_shared::Dispute>),
849    /// Occurs when the dispute is updated (usually with evidence).
850    ChargeDisputeUpdated(Box<stripe_shared::Dispute>),
851    /// Occurs whenever an uncaptured charge expires.
852    ChargeExpired(Box<stripe_shared::Charge>),
853    /// Occurs whenever a failed charge attempt occurs.
854    ChargeFailed(Box<stripe_shared::Charge>),
855    /// Occurs whenever a pending charge is created.
856    ChargePending(Box<stripe_shared::Charge>),
857    /// Occurs whenever a refund is updated on selected payment methods.
858    /// For updates on all refunds, listen to `refund.updated` instead.
859    ChargeRefundUpdated(Box<stripe_shared::Refund>),
860    /// Occurs whenever a charge is refunded, including partial refunds.
861    /// Listen to `refund.created` for information about the refund.
862    ChargeRefunded(Box<stripe_shared::Charge>),
863    /// Occurs whenever a charge is successful.
864    ChargeSucceeded(Box<stripe_shared::Charge>),
865    /// Occurs whenever a charge description or metadata is updated, or upon an asynchronous capture.
866    ChargeUpdated(Box<stripe_shared::Charge>),
867    /// Occurs when a payment intent using a delayed payment method fails.
868    CheckoutSessionAsyncPaymentFailed(Box<stripe_shared::CheckoutSession>),
869    /// Occurs when a payment intent using a delayed payment method finally succeeds.
870    CheckoutSessionAsyncPaymentSucceeded(Box<stripe_shared::CheckoutSession>),
871    /// Occurs when a Checkout Session has been successfully completed.
872    CheckoutSessionCompleted(Box<stripe_shared::CheckoutSession>),
873    /// Occurs when a Checkout Session is expired.
874    CheckoutSessionExpired(Box<stripe_shared::CheckoutSession>),
875    /// Occurs when a Climate order is canceled.
876    #[cfg(feature = "async-stripe-misc")]
877    ClimateOrderCanceled(Box<stripe_misc::ClimateOrder>),
878    /// Occurs when a Climate order is created.
879    #[cfg(feature = "async-stripe-misc")]
880    ClimateOrderCreated(Box<stripe_misc::ClimateOrder>),
881    /// Occurs when a Climate order is delayed.
882    #[cfg(feature = "async-stripe-misc")]
883    ClimateOrderDelayed(Box<stripe_misc::ClimateOrder>),
884    /// Occurs when a Climate order is delivered.
885    #[cfg(feature = "async-stripe-misc")]
886    ClimateOrderDelivered(Box<stripe_misc::ClimateOrder>),
887    /// Occurs when a Climate order's product is substituted for another.
888    #[cfg(feature = "async-stripe-misc")]
889    ClimateOrderProductSubstituted(Box<stripe_misc::ClimateOrder>),
890    /// Occurs when a Climate product is created.
891    #[cfg(feature = "async-stripe-misc")]
892    ClimateProductCreated(Box<stripe_misc::ClimateProduct>),
893    /// Occurs when a Climate product is updated.
894    #[cfg(feature = "async-stripe-misc")]
895    ClimateProductPricingUpdated(Box<stripe_misc::ClimateProduct>),
896    /// Occurs whenever a coupon is created.
897    CouponCreated(Box<stripe_shared::Coupon>),
898    /// Occurs whenever a coupon is deleted.
899    CouponDeleted(Box<stripe_shared::Coupon>),
900    /// Occurs whenever a coupon is updated.
901    CouponUpdated(Box<stripe_shared::Coupon>),
902    /// Occurs whenever a credit note is created.
903    CreditNoteCreated(Box<stripe_shared::CreditNote>),
904    /// Occurs whenever a credit note is updated.
905    CreditNoteUpdated(Box<stripe_shared::CreditNote>),
906    /// Occurs whenever a credit note is voided.
907    CreditNoteVoided(Box<stripe_shared::CreditNote>),
908    /// Occurs whenever a new customer is created.
909    CustomerCreated(Box<stripe_shared::Customer>),
910    /// Occurs whenever a customer is deleted.
911    CustomerDeleted(Box<stripe_shared::Customer>),
912    /// Occurs whenever a coupon is attached to a customer.
913    CustomerDiscountCreated(Box<stripe_shared::Discount>),
914    /// Occurs whenever a coupon is removed from a customer.
915    CustomerDiscountDeleted(Box<stripe_shared::Discount>),
916    /// Occurs whenever a customer is switched from one coupon to another.
917    CustomerDiscountUpdated(Box<stripe_shared::Discount>),
918    /// Occurs whenever a new source is created for a customer.
919    CustomerSourceCreated(Box<CustomerSourceCreated>),
920    /// Occurs whenever a source is removed from a customer.
921    CustomerSourceDeleted(Box<CustomerSourceDeleted>),
922    /// Occurs whenever a card or source will expire at the end of the month.
923    /// This event only works with legacy integrations using Card or Source objects.
924    /// If you use the PaymentMethod API, this event won't occur.
925    CustomerSourceExpiring(Box<CustomerSourceExpiring>),
926    /// Occurs whenever a source's details are changed.
927    CustomerSourceUpdated(Box<CustomerSourceUpdated>),
928    /// Occurs whenever a customer is signed up for a new plan.
929    CustomerSubscriptionCreated(Box<stripe_shared::Subscription>),
930    /// Occurs whenever a customer's subscription ends.
931    CustomerSubscriptionDeleted(Box<stripe_shared::Subscription>),
932    /// Occurs whenever a customer's subscription is paused.
933    /// Only applies when subscriptions enter `status=paused`, not when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is paused.
934    CustomerSubscriptionPaused(Box<stripe_shared::Subscription>),
935    /// Occurs whenever a customer's subscription's pending update is applied, and the subscription is updated.
936    CustomerSubscriptionPendingUpdateApplied(Box<stripe_shared::Subscription>),
937    /// Occurs whenever a customer's subscription's pending update expires before the related invoice is paid.
938    CustomerSubscriptionPendingUpdateExpired(Box<stripe_shared::Subscription>),
939    /// Occurs whenever a customer's subscription is no longer paused.
940    /// Only applies when a `status=paused` subscription is [resumed](https://docs.stripe.com/api/subscriptions/resume), not when [payment collection](https://docs.stripe.com/billing/subscriptions/pause) is resumed.
941    CustomerSubscriptionResumed(Box<stripe_shared::Subscription>),
942    /// Occurs three days before a subscription's trial period is scheduled to end, or when a trial is ended immediately (using `trial_end=now`).
943    CustomerSubscriptionTrialWillEnd(Box<stripe_shared::Subscription>),
944    /// Occurs whenever a subscription changes (e.g., switching from one plan to another, or changing the status from trial to active).
945    CustomerSubscriptionUpdated(Box<stripe_shared::Subscription>),
946    /// Occurs whenever a tax ID is created for a customer.
947    CustomerTaxIdCreated(Box<stripe_shared::TaxId>),
948    /// Occurs whenever a tax ID is deleted from a customer.
949    CustomerTaxIdDeleted(Box<stripe_shared::TaxId>),
950    /// Occurs whenever a customer's tax ID is updated.
951    CustomerTaxIdUpdated(Box<stripe_shared::TaxId>),
952    /// Occurs whenever any property of a customer changes.
953    CustomerUpdated(Box<stripe_shared::Customer>),
954    /// Occurs whenever a new customer cash balance transactions is created.
955    CustomerCashBalanceTransactionCreated(Box<stripe_shared::CustomerCashBalanceTransaction>),
956    /// Occurs whenever a customer's entitlements change.
957    #[cfg(feature = "async-stripe-misc")]
958    EntitlementsActiveEntitlementSummaryUpdated(
959        Box<stripe_misc::EntitlementsActiveEntitlementSummary>,
960    ),
961    /// Occurs whenever a new Stripe-generated file is available for your account.
962    FileCreated(Box<stripe_shared::File>),
963    /// Occurs when a Financial Connections account's account numbers are updated.
964    #[cfg(feature = "async-stripe-misc")]
965    FinancialConnectionsAccountAccountNumbersUpdated(Box<stripe_misc::FinancialConnectionsAccount>),
966    /// Occurs when a new Financial Connections account is created.
967    #[cfg(feature = "async-stripe-misc")]
968    FinancialConnectionsAccountCreated(Box<stripe_misc::FinancialConnectionsAccount>),
969    /// Occurs when a Financial Connections account's status is updated from `active` to `inactive`.
970    #[cfg(feature = "async-stripe-misc")]
971    FinancialConnectionsAccountDeactivated(Box<stripe_misc::FinancialConnectionsAccount>),
972    /// Occurs when a Financial Connections account is disconnected.
973    #[cfg(feature = "async-stripe-misc")]
974    FinancialConnectionsAccountDisconnected(Box<stripe_misc::FinancialConnectionsAccount>),
975    /// Occurs when a Financial Connections account's status is updated from `inactive` to `active`.
976    #[cfg(feature = "async-stripe-misc")]
977    FinancialConnectionsAccountReactivated(Box<stripe_misc::FinancialConnectionsAccount>),
978    /// Occurs when an Account’s `balance_refresh` status transitions from `pending` to either `succeeded` or `failed`.
979    #[cfg(feature = "async-stripe-misc")]
980    FinancialConnectionsAccountRefreshedBalance(Box<stripe_misc::FinancialConnectionsAccount>),
981    /// Occurs when an Account’s `ownership_refresh` status transitions from `pending` to either `succeeded` or `failed`.
982    #[cfg(feature = "async-stripe-misc")]
983    FinancialConnectionsAccountRefreshedOwnership(Box<stripe_misc::FinancialConnectionsAccount>),
984    /// Occurs when an Account’s `transaction_refresh` status transitions from `pending` to either `succeeded` or `failed`.
985    #[cfg(feature = "async-stripe-misc")]
986    FinancialConnectionsAccountRefreshedTransactions(Box<stripe_misc::FinancialConnectionsAccount>),
987    /// Occurs when an Account’s tokenized account number is about to expire.
988    #[cfg(feature = "async-stripe-misc")]
989    FinancialConnectionsAccountUpcomingAccountNumberExpiry(
990        Box<stripe_misc::FinancialConnectionsAccount>,
991    ),
992    /// Occurs whenever a VerificationSession is canceled
993    #[cfg(feature = "async-stripe-misc")]
994    IdentityVerificationSessionCanceled(Box<stripe_misc::IdentityVerificationSession>),
995    /// Occurs whenever a VerificationSession is created
996    #[cfg(feature = "async-stripe-misc")]
997    IdentityVerificationSessionCreated(Box<stripe_misc::IdentityVerificationSession>),
998    /// Occurs whenever a VerificationSession transitions to processing
999    #[cfg(feature = "async-stripe-misc")]
1000    IdentityVerificationSessionProcessing(Box<stripe_misc::IdentityVerificationSession>),
1001    /// Occurs whenever a VerificationSession is redacted.
1002    #[cfg(feature = "async-stripe-misc")]
1003    IdentityVerificationSessionRedacted(Box<stripe_misc::IdentityVerificationSession>),
1004    /// Occurs whenever a VerificationSession transitions to require user input
1005    #[cfg(feature = "async-stripe-misc")]
1006    IdentityVerificationSessionRequiresInput(Box<stripe_misc::IdentityVerificationSession>),
1007    /// Occurs whenever a VerificationSession transitions to verified
1008    #[cfg(feature = "async-stripe-misc")]
1009    IdentityVerificationSessionVerified(Box<stripe_misc::IdentityVerificationSession>),
1010    /// Occurs whenever a new invoice is created.
1011    /// To learn how webhooks can be used with this event, and how they can affect it, see [Using Webhooks with Subscriptions](https://docs.stripe.com/subscriptions/webhooks).
1012    InvoiceCreated(Box<stripe_shared::Invoice>),
1013    /// Occurs whenever a draft invoice is deleted.
1014    /// Note: This event is not sent for [invoice previews](https://docs.stripe.com/api/invoices/create_preview).
1015    InvoiceDeleted(Box<stripe_shared::Invoice>),
1016    /// Occurs whenever a draft invoice cannot be finalized.
1017    /// See the invoice’s [last finalization error](https://docs.stripe.com/api/invoices/object#invoice_object-last_finalization_error) for details.
1018    InvoiceFinalizationFailed(Box<stripe_shared::Invoice>),
1019    /// Occurs whenever a draft invoice is finalized and updated to be an open invoice.
1020    InvoiceFinalized(Box<stripe_shared::Invoice>),
1021    /// Occurs whenever an invoice is marked uncollectible.
1022    InvoiceMarkedUncollectible(Box<stripe_shared::Invoice>),
1023    /// Occurs X number of days after an invoice becomes due&mdash;where X is determined by Automations
1024    InvoiceOverdue(Box<stripe_shared::Invoice>),
1025    /// Occurs when an invoice transitions to paid with a non-zero amount_overpaid.
1026    InvoiceOverpaid(Box<stripe_shared::Invoice>),
1027    /// Occurs whenever an invoice payment attempt succeeds or an invoice is marked as paid out-of-band.
1028    InvoicePaid(Box<stripe_shared::Invoice>),
1029    /// Occurs whenever an invoice payment attempt requires further user action to complete.
1030    InvoicePaymentActionRequired(Box<stripe_shared::Invoice>),
1031    /// Occurs when an invoice requires a payment using a payment method that cannot be processed by Stripe.
1032    InvoicePaymentAttemptRequired(Box<stripe_shared::Invoice>),
1033    /// Occurs whenever an invoice payment attempt fails, due to either a declined payment, including soft decline, or to the lack of a stored payment method.
1034    InvoicePaymentFailed(Box<stripe_shared::Invoice>),
1035    /// Occurs whenever an invoice payment attempt succeeds.
1036    InvoicePaymentSucceeded(Box<stripe_shared::Invoice>),
1037    /// Occurs whenever an invoice email is sent out.
1038    InvoiceSent(Box<stripe_shared::Invoice>),
1039    /// Occurs X number of days before a subscription is scheduled to create an invoice that is automatically charged&mdash;where X is determined by your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic).
1040    /// Note: The received `Invoice` object will not have an invoice ID.
1041    InvoiceUpcoming(Box<stripe_shared::Invoice>),
1042    /// Occurs whenever an invoice changes (e.g., the invoice amount).
1043    InvoiceUpdated(Box<stripe_shared::Invoice>),
1044    /// Occurs whenever an invoice is voided.
1045    InvoiceVoided(Box<stripe_shared::Invoice>),
1046    /// Occurs X number of days before an invoice becomes due&mdash;where X is determined by Automations
1047    InvoiceWillBeDue(Box<stripe_shared::Invoice>),
1048    /// Occurs when an InvoicePayment is successfully paid.
1049    InvoicePaymentPaid(Box<stripe_shared::InvoicePayment>),
1050    /// Occurs whenever an invoice item is created.
1051    #[cfg(feature = "async-stripe-billing")]
1052    InvoiceitemCreated(Box<stripe_billing::InvoiceItem>),
1053    /// Occurs whenever an invoice item is deleted.
1054    #[cfg(feature = "async-stripe-billing")]
1055    InvoiceitemDeleted(Box<stripe_billing::InvoiceItem>),
1056    /// Occurs whenever an authorization is created.
1057    IssuingAuthorizationCreated(Box<stripe_shared::IssuingAuthorization>),
1058    /// Represents a synchronous request for authorization, see [Using your integration to handle authorization requests](https://docs.stripe.com/issuing/purchases/authorizations#authorization-handling).
1059    IssuingAuthorizationRequest(Box<stripe_shared::IssuingAuthorization>),
1060    /// Occurs whenever an authorization is updated.
1061    IssuingAuthorizationUpdated(Box<stripe_shared::IssuingAuthorization>),
1062    /// Occurs whenever a card is created.
1063    IssuingCardCreated(Box<stripe_shared::IssuingCard>),
1064    /// Occurs whenever a card is updated.
1065    IssuingCardUpdated(Box<stripe_shared::IssuingCard>),
1066    /// Occurs whenever a cardholder is created.
1067    IssuingCardholderCreated(Box<stripe_shared::IssuingCardholder>),
1068    /// Occurs whenever a cardholder is updated.
1069    IssuingCardholderUpdated(Box<stripe_shared::IssuingCardholder>),
1070    /// Occurs whenever a dispute is won, lost or expired.
1071    IssuingDisputeClosed(Box<stripe_shared::IssuingDispute>),
1072    /// Occurs whenever a dispute is created.
1073    IssuingDisputeCreated(Box<stripe_shared::IssuingDispute>),
1074    /// Occurs whenever funds are reinstated to your account for an Issuing dispute.
1075    IssuingDisputeFundsReinstated(Box<stripe_shared::IssuingDispute>),
1076    /// Occurs whenever funds are deducted from your account for an Issuing dispute.
1077    IssuingDisputeFundsRescinded(Box<stripe_shared::IssuingDispute>),
1078    /// Occurs whenever a dispute is submitted.
1079    IssuingDisputeSubmitted(Box<stripe_shared::IssuingDispute>),
1080    /// Occurs whenever a dispute is updated.
1081    IssuingDisputeUpdated(Box<stripe_shared::IssuingDispute>),
1082    /// Occurs whenever a personalization design is activated following the activation of the physical bundle that belongs to it.
1083    IssuingPersonalizationDesignActivated(Box<stripe_shared::IssuingPersonalizationDesign>),
1084    /// Occurs whenever a personalization design is deactivated following the deactivation of the physical bundle that belongs to it.
1085    IssuingPersonalizationDesignDeactivated(Box<stripe_shared::IssuingPersonalizationDesign>),
1086    /// Occurs whenever a personalization design is rejected by design review.
1087    IssuingPersonalizationDesignRejected(Box<stripe_shared::IssuingPersonalizationDesign>),
1088    /// Occurs whenever a personalization design is updated.
1089    IssuingPersonalizationDesignUpdated(Box<stripe_shared::IssuingPersonalizationDesign>),
1090    /// Occurs whenever an issuing digital wallet token is created.
1091    IssuingTokenCreated(Box<stripe_shared::IssuingToken>),
1092    /// Occurs whenever an issuing digital wallet token is updated.
1093    IssuingTokenUpdated(Box<stripe_shared::IssuingToken>),
1094    /// Occurs whenever an issuing transaction is created.
1095    IssuingTransactionCreated(Box<stripe_shared::IssuingTransaction>),
1096    /// Occurs whenever an issuing transaction is updated with receipt data.
1097    IssuingTransactionPurchaseDetailsReceiptUpdated(Box<stripe_shared::IssuingTransaction>),
1098    /// Occurs whenever an issuing transaction is updated.
1099    IssuingTransactionUpdated(Box<stripe_shared::IssuingTransaction>),
1100    /// Occurs whenever a Mandate is updated.
1101    MandateUpdated(Box<stripe_shared::Mandate>),
1102    /// Occurs when a PaymentIntent has funds to be captured.
1103    /// Check the `amount_capturable` property on the PaymentIntent to determine the amount that can be captured.
1104    /// You may capture the PaymentIntent with an `amount_to_capture` value up to the specified amount.
1105    /// [Learn more about capturing PaymentIntents.](https://docs.stripe.com/api/payment_intents/capture).
1106    PaymentIntentAmountCapturableUpdated(Box<stripe_shared::PaymentIntent>),
1107    /// Occurs when a PaymentIntent is canceled.
1108    PaymentIntentCanceled(Box<stripe_shared::PaymentIntent>),
1109    /// Occurs when a new PaymentIntent is created.
1110    PaymentIntentCreated(Box<stripe_shared::PaymentIntent>),
1111    /// Occurs when funds are applied to a customer_balance PaymentIntent and the 'amount_remaining' changes.
1112    PaymentIntentPartiallyFunded(Box<stripe_shared::PaymentIntent>),
1113    /// Occurs when a PaymentIntent has failed the attempt to create a payment method or a payment.
1114    PaymentIntentPaymentFailed(Box<stripe_shared::PaymentIntent>),
1115    /// Occurs when a PaymentIntent has started processing.
1116    PaymentIntentProcessing(Box<stripe_shared::PaymentIntent>),
1117    /// Occurs when a PaymentIntent transitions to requires_action state
1118    PaymentIntentRequiresAction(Box<stripe_shared::PaymentIntent>),
1119    /// Occurs when a PaymentIntent has successfully completed payment.
1120    PaymentIntentSucceeded(Box<stripe_shared::PaymentIntent>),
1121    /// Occurs when a payment link is created.
1122    PaymentLinkCreated(Box<stripe_shared::PaymentLink>),
1123    /// Occurs when a payment link is updated.
1124    PaymentLinkUpdated(Box<stripe_shared::PaymentLink>),
1125    /// Occurs whenever a new payment method is attached to a customer.
1126    PaymentMethodAttached(Box<stripe_shared::PaymentMethod>),
1127    /// Occurs whenever a payment method's details are automatically updated by the network.
1128    PaymentMethodAutomaticallyUpdated(Box<stripe_shared::PaymentMethod>),
1129    /// Occurs whenever a payment method is detached from a customer.
1130    PaymentMethodDetached(Box<stripe_shared::PaymentMethod>),
1131    /// Occurs whenever a payment method is updated via the [PaymentMethod update API](https://docs.stripe.com/api/payment_methods/update).
1132    PaymentMethodUpdated(Box<stripe_shared::PaymentMethod>),
1133    /// Occurs whenever a payout is canceled.
1134    PayoutCanceled(Box<stripe_shared::Payout>),
1135    /// Occurs whenever a payout is created.
1136    PayoutCreated(Box<stripe_shared::Payout>),
1137    /// Occurs whenever a payout attempt fails.
1138    PayoutFailed(Box<stripe_shared::Payout>),
1139    /// Occurs whenever a payout is *expected* to be available in the destination account.
1140    /// If the payout fails, a `payout.failed` notification is also sent, at a later time.
1141    PayoutPaid(Box<stripe_shared::Payout>),
1142    /// Occurs whenever balance transactions paid out in an automatic payout can be queried.
1143    PayoutReconciliationCompleted(Box<stripe_shared::Payout>),
1144    /// Occurs whenever a payout is updated.
1145    PayoutUpdated(Box<stripe_shared::Payout>),
1146    /// Occurs whenever a person associated with an account is created.
1147    PersonCreated(Box<stripe_shared::Person>),
1148    /// Occurs whenever a person associated with an account is deleted.
1149    PersonDeleted(Box<stripe_shared::Person>),
1150    /// Occurs whenever a person associated with an account is updated.
1151    PersonUpdated(Box<stripe_shared::Person>),
1152    /// Occurs whenever a plan is created.
1153    PlanCreated(Box<stripe_shared::Plan>),
1154    /// Occurs whenever a plan is deleted.
1155    PlanDeleted(Box<stripe_shared::Plan>),
1156    /// Occurs whenever a plan is updated.
1157    PlanUpdated(Box<stripe_shared::Plan>),
1158    /// Occurs whenever a price is created.
1159    PriceCreated(Box<stripe_shared::Price>),
1160    /// Occurs whenever a price is deleted.
1161    PriceDeleted(Box<stripe_shared::Price>),
1162    /// Occurs whenever a price is updated.
1163    PriceUpdated(Box<stripe_shared::Price>),
1164    /// Occurs whenever a product is created.
1165    ProductCreated(Box<stripe_shared::Product>),
1166    /// Occurs whenever a product is deleted.
1167    ProductDeleted(Box<stripe_shared::Product>),
1168    /// Occurs whenever a product is updated.
1169    ProductUpdated(Box<stripe_shared::Product>),
1170    /// Occurs whenever a promotion code is created.
1171    PromotionCodeCreated(Box<stripe_shared::PromotionCode>),
1172    /// Occurs whenever a promotion code is updated.
1173    PromotionCodeUpdated(Box<stripe_shared::PromotionCode>),
1174    /// Occurs whenever a quote is accepted.
1175    #[cfg(feature = "async-stripe-billing")]
1176    QuoteAccepted(Box<stripe_billing::Quote>),
1177    /// Occurs whenever a quote is canceled.
1178    #[cfg(feature = "async-stripe-billing")]
1179    QuoteCanceled(Box<stripe_billing::Quote>),
1180    /// Occurs whenever a quote is created.
1181    #[cfg(feature = "async-stripe-billing")]
1182    QuoteCreated(Box<stripe_billing::Quote>),
1183    /// Occurs whenever a quote is finalized.
1184    #[cfg(feature = "async-stripe-billing")]
1185    QuoteFinalized(Box<stripe_billing::Quote>),
1186    /// Occurs whenever an early fraud warning is created.
1187    #[cfg(feature = "async-stripe-fraud")]
1188    RadarEarlyFraudWarningCreated(Box<stripe_fraud::RadarEarlyFraudWarning>),
1189    /// Occurs whenever an early fraud warning is updated.
1190    #[cfg(feature = "async-stripe-fraud")]
1191    RadarEarlyFraudWarningUpdated(Box<stripe_fraud::RadarEarlyFraudWarning>),
1192    /// Occurs whenever a refund is created.
1193    RefundCreated(Box<stripe_shared::Refund>),
1194    /// Occurs whenever a refund has failed.
1195    RefundFailed(Box<stripe_shared::Refund>),
1196    /// Occurs whenever a refund is updated.
1197    RefundUpdated(Box<stripe_shared::Refund>),
1198    /// Occurs whenever a requested `ReportRun` failed to complete.
1199    #[cfg(feature = "async-stripe-misc")]
1200    ReportingReportRunFailed(Box<stripe_misc::ReportingReportRun>),
1201    /// Occurs whenever a requested `ReportRun` completed successfully.
1202    #[cfg(feature = "async-stripe-misc")]
1203    ReportingReportRunSucceeded(Box<stripe_misc::ReportingReportRun>),
1204    /// Occurs whenever a `ReportType` is updated (typically to indicate that a new day's data has come available).
1205    #[cfg(feature = "async-stripe-misc")]
1206    ReportingReportTypeUpdated(Box<stripe_misc::ReportingReportType>),
1207    /// Occurs when a reserve hold is created.
1208    #[cfg(feature = "async-stripe-reserve")]
1209    ReserveHoldCreated(Box<stripe_reserve::ReserveHold>),
1210    /// Occurs when a reserve hold is updated.
1211    #[cfg(feature = "async-stripe-reserve")]
1212    ReserveHoldUpdated(Box<stripe_reserve::ReserveHold>),
1213    /// Occurs when a reserve plan is created.
1214    #[cfg(feature = "async-stripe-reserve")]
1215    ReservePlanCreated(Box<stripe_reserve::ReservePlan>),
1216    /// Occurs when a reserve plan is disabled.
1217    #[cfg(feature = "async-stripe-reserve")]
1218    ReservePlanDisabled(Box<stripe_reserve::ReservePlan>),
1219    /// Occurs when a reserve plan expires.
1220    #[cfg(feature = "async-stripe-reserve")]
1221    ReservePlanExpired(Box<stripe_reserve::ReservePlan>),
1222    /// Occurs when a reserve plan is updated.
1223    #[cfg(feature = "async-stripe-reserve")]
1224    ReservePlanUpdated(Box<stripe_reserve::ReservePlan>),
1225    /// Occurs when a reserve release is created.
1226    #[cfg(feature = "async-stripe-reserve")]
1227    ReserveReleaseCreated(Box<stripe_reserve::ReserveRelease>),
1228    /// Occurs whenever a review is closed.
1229    /// The review's `reason` field indicates why: `approved`, `disputed`, `refunded`, `refunded_as_fraud`, or `canceled`.
1230    ReviewClosed(Box<stripe_shared::Review>),
1231    /// Occurs whenever a review is opened.
1232    ReviewOpened(Box<stripe_shared::Review>),
1233    /// Occurs when a SetupIntent is canceled.
1234    SetupIntentCanceled(Box<stripe_shared::SetupIntent>),
1235    /// Occurs when a new SetupIntent is created.
1236    SetupIntentCreated(Box<stripe_shared::SetupIntent>),
1237    /// Occurs when a SetupIntent is in requires_action state.
1238    SetupIntentRequiresAction(Box<stripe_shared::SetupIntent>),
1239    /// Occurs when a SetupIntent has failed the attempt to setup a payment method.
1240    SetupIntentSetupFailed(Box<stripe_shared::SetupIntent>),
1241    /// Occurs when an SetupIntent has successfully setup a payment method.
1242    SetupIntentSucceeded(Box<stripe_shared::SetupIntent>),
1243    /// Occurs whenever a Sigma scheduled query run finishes.
1244    #[cfg(feature = "async-stripe-misc")]
1245    SigmaScheduledQueryRunCreated(Box<stripe_misc::ScheduledQueryRun>),
1246    /// Occurs whenever a source is canceled.
1247    SourceCanceled(Box<stripe_shared::Source>),
1248    /// Occurs whenever a source transitions to chargeable.
1249    SourceChargeable(Box<stripe_shared::Source>),
1250    /// Occurs whenever a source fails.
1251    SourceFailed(Box<stripe_shared::Source>),
1252    /// Occurs whenever a source mandate notification method is set to manual.
1253    #[cfg(feature = "async-stripe-payment")]
1254    SourceMandateNotification(Box<stripe_payment::SourceMandateNotification>),
1255    /// Occurs whenever the refund attributes are required on a receiver source to process a refund or a mispayment.
1256    SourceRefundAttributesRequired(Box<stripe_shared::Source>),
1257    /// Occurs whenever a source transaction is created.
1258    SourceTransactionCreated(Box<stripe_shared::SourceTransaction>),
1259    /// Occurs whenever a source transaction is updated.
1260    SourceTransactionUpdated(Box<stripe_shared::SourceTransaction>),
1261    /// Occurs whenever a subscription schedule is canceled due to the underlying subscription being canceled because of delinquency.
1262    SubscriptionScheduleAborted(Box<stripe_shared::SubscriptionSchedule>),
1263    /// Occurs whenever a subscription schedule is canceled.
1264    SubscriptionScheduleCanceled(Box<stripe_shared::SubscriptionSchedule>),
1265    /// Occurs whenever a new subscription schedule is completed.
1266    SubscriptionScheduleCompleted(Box<stripe_shared::SubscriptionSchedule>),
1267    /// Occurs whenever a new subscription schedule is created.
1268    SubscriptionScheduleCreated(Box<stripe_shared::SubscriptionSchedule>),
1269    /// Occurs 7 days before a subscription schedule will expire.
1270    SubscriptionScheduleExpiring(Box<stripe_shared::SubscriptionSchedule>),
1271    /// Occurs whenever a new subscription schedule is released.
1272    SubscriptionScheduleReleased(Box<stripe_shared::SubscriptionSchedule>),
1273    /// Occurs whenever a subscription schedule is updated.
1274    SubscriptionScheduleUpdated(Box<stripe_shared::SubscriptionSchedule>),
1275    /// Occurs whenever tax settings is updated.
1276    #[cfg(feature = "async-stripe-misc")]
1277    TaxSettingsUpdated(Box<stripe_misc::TaxSettings>),
1278    /// Occurs whenever a new tax rate is created.
1279    TaxRateCreated(Box<stripe_shared::TaxRate>),
1280    /// Occurs whenever a tax rate is updated.
1281    TaxRateUpdated(Box<stripe_shared::TaxRate>),
1282    /// Occurs whenever an action sent to a Terminal reader failed.
1283    #[cfg(feature = "async-stripe-terminal")]
1284    TerminalReaderActionFailed(Box<stripe_terminal::TerminalReader>),
1285    /// Occurs whenever an action sent to a Terminal reader was successful.
1286    #[cfg(feature = "async-stripe-terminal")]
1287    TerminalReaderActionSucceeded(Box<stripe_terminal::TerminalReader>),
1288    /// Occurs whenever an action sent to a Terminal reader is updated.
1289    #[cfg(feature = "async-stripe-terminal")]
1290    TerminalReaderActionUpdated(Box<stripe_terminal::TerminalReader>),
1291    /// Occurs whenever a test clock starts advancing.
1292    TestHelpersTestClockAdvancing(Box<stripe_shared::TestHelpersTestClock>),
1293    /// Occurs whenever a test clock is created.
1294    TestHelpersTestClockCreated(Box<stripe_shared::TestHelpersTestClock>),
1295    /// Occurs whenever a test clock is deleted.
1296    TestHelpersTestClockDeleted(Box<stripe_shared::TestHelpersTestClock>),
1297    /// Occurs whenever a test clock fails to advance its frozen time.
1298    TestHelpersTestClockInternalFailure(Box<stripe_shared::TestHelpersTestClock>),
1299    /// Occurs whenever a test clock transitions to a ready status.
1300    TestHelpersTestClockReady(Box<stripe_shared::TestHelpersTestClock>),
1301    /// Occurs whenever a top-up is canceled.
1302    TopupCanceled(Box<stripe_shared::Topup>),
1303    /// Occurs whenever a top-up is created.
1304    TopupCreated(Box<stripe_shared::Topup>),
1305    /// Occurs whenever a top-up fails.
1306    TopupFailed(Box<stripe_shared::Topup>),
1307    /// Occurs whenever a top-up is reversed.
1308    TopupReversed(Box<stripe_shared::Topup>),
1309    /// Occurs whenever a top-up succeeds.
1310    TopupSucceeded(Box<stripe_shared::Topup>),
1311    /// Occurs whenever a transfer is created.
1312    TransferCreated(Box<stripe_shared::Transfer>),
1313    /// Occurs whenever a transfer is reversed, including partial reversals.
1314    TransferReversed(Box<stripe_shared::Transfer>),
1315    /// Occurs whenever a transfer's description or metadata is updated.
1316    TransferUpdated(Box<stripe_shared::Transfer>),
1317    /// Occurs whenever an CreditReversal is submitted and created.
1318    #[cfg(feature = "async-stripe-treasury")]
1319    TreasuryCreditReversalCreated(Box<stripe_treasury::TreasuryCreditReversal>),
1320    /// Occurs whenever an CreditReversal post is posted.
1321    #[cfg(feature = "async-stripe-treasury")]
1322    TreasuryCreditReversalPosted(Box<stripe_treasury::TreasuryCreditReversal>),
1323    /// Occurs whenever a DebitReversal is completed.
1324    #[cfg(feature = "async-stripe-treasury")]
1325    TreasuryDebitReversalCompleted(Box<stripe_treasury::TreasuryDebitReversal>),
1326    /// Occurs whenever a DebitReversal is created.
1327    #[cfg(feature = "async-stripe-treasury")]
1328    TreasuryDebitReversalCreated(Box<stripe_treasury::TreasuryDebitReversal>),
1329    /// Occurs whenever an initial credit is granted on a DebitReversal.
1330    #[cfg(feature = "async-stripe-treasury")]
1331    TreasuryDebitReversalInitialCreditGranted(Box<stripe_treasury::TreasuryDebitReversal>),
1332    /// Occurs whenever the status of the FinancialAccount becomes closed.
1333    #[cfg(feature = "async-stripe-treasury")]
1334    TreasuryFinancialAccountClosed(Box<stripe_treasury::TreasuryFinancialAccount>),
1335    /// Occurs whenever a new FinancialAccount is created.
1336    #[cfg(feature = "async-stripe-treasury")]
1337    TreasuryFinancialAccountCreated(Box<stripe_treasury::TreasuryFinancialAccount>),
1338    /// Occurs whenever the statuses of any features within an existing FinancialAccount are updated.
1339    #[cfg(feature = "async-stripe-treasury")]
1340    TreasuryFinancialAccountFeaturesStatusUpdated(Box<stripe_treasury::TreasuryFinancialAccount>),
1341    /// Occurs whenever an InboundTransfer is canceled.
1342    #[cfg(feature = "async-stripe-treasury")]
1343    TreasuryInboundTransferCanceled(Box<stripe_treasury::TreasuryInboundTransfer>),
1344    /// Occurs whenever an InboundTransfer is created.
1345    #[cfg(feature = "async-stripe-treasury")]
1346    TreasuryInboundTransferCreated(Box<stripe_treasury::TreasuryInboundTransfer>),
1347    /// Occurs whenever an InboundTransfer has failed.
1348    #[cfg(feature = "async-stripe-treasury")]
1349    TreasuryInboundTransferFailed(Box<stripe_treasury::TreasuryInboundTransfer>),
1350    /// Occurs whenever an InboundTransfer has succeeded.
1351    #[cfg(feature = "async-stripe-treasury")]
1352    TreasuryInboundTransferSucceeded(Box<stripe_treasury::TreasuryInboundTransfer>),
1353    /// Occurs whenever an OutboundPayment is canceled.
1354    #[cfg(feature = "async-stripe-treasury")]
1355    TreasuryOutboundPaymentCanceled(Box<stripe_treasury::TreasuryOutboundPayment>),
1356    /// Occurs whenever a new OutboundPayment is successfully created.
1357    #[cfg(feature = "async-stripe-treasury")]
1358    TreasuryOutboundPaymentCreated(Box<stripe_treasury::TreasuryOutboundPayment>),
1359    /// Occurs whenever the arrival date on an OutboundPayment updates.
1360    #[cfg(feature = "async-stripe-treasury")]
1361    TreasuryOutboundPaymentExpectedArrivalDateUpdated(
1362        Box<stripe_treasury::TreasuryOutboundPayment>,
1363    ),
1364    /// Occurs whenever an OutboundPayment fails.
1365    #[cfg(feature = "async-stripe-treasury")]
1366    TreasuryOutboundPaymentFailed(Box<stripe_treasury::TreasuryOutboundPayment>),
1367    /// Occurs whenever an OutboundPayment posts.
1368    #[cfg(feature = "async-stripe-treasury")]
1369    TreasuryOutboundPaymentPosted(Box<stripe_treasury::TreasuryOutboundPayment>),
1370    /// Occurs whenever an OutboundPayment was returned.
1371    #[cfg(feature = "async-stripe-treasury")]
1372    TreasuryOutboundPaymentReturned(Box<stripe_treasury::TreasuryOutboundPayment>),
1373    /// Occurs whenever tracking_details on an OutboundPayment is updated.
1374    #[cfg(feature = "async-stripe-treasury")]
1375    TreasuryOutboundPaymentTrackingDetailsUpdated(Box<stripe_treasury::TreasuryOutboundPayment>),
1376    /// Occurs whenever an OutboundTransfer is canceled.
1377    #[cfg(feature = "async-stripe-treasury")]
1378    TreasuryOutboundTransferCanceled(Box<stripe_treasury::TreasuryOutboundTransfer>),
1379    /// Occurs whenever an OutboundTransfer is created.
1380    #[cfg(feature = "async-stripe-treasury")]
1381    TreasuryOutboundTransferCreated(Box<stripe_treasury::TreasuryOutboundTransfer>),
1382    /// Occurs whenever the arrival date on an OutboundTransfer updates.
1383    #[cfg(feature = "async-stripe-treasury")]
1384    TreasuryOutboundTransferExpectedArrivalDateUpdated(
1385        Box<stripe_treasury::TreasuryOutboundTransfer>,
1386    ),
1387    /// Occurs whenever an OutboundTransfer has failed.
1388    #[cfg(feature = "async-stripe-treasury")]
1389    TreasuryOutboundTransferFailed(Box<stripe_treasury::TreasuryOutboundTransfer>),
1390    /// Occurs whenever an OutboundTransfer is posted.
1391    #[cfg(feature = "async-stripe-treasury")]
1392    TreasuryOutboundTransferPosted(Box<stripe_treasury::TreasuryOutboundTransfer>),
1393    /// Occurs whenever an OutboundTransfer is returned.
1394    #[cfg(feature = "async-stripe-treasury")]
1395    TreasuryOutboundTransferReturned(Box<stripe_treasury::TreasuryOutboundTransfer>),
1396    /// Occurs whenever tracking_details on an OutboundTransfer is updated.
1397    #[cfg(feature = "async-stripe-treasury")]
1398    TreasuryOutboundTransferTrackingDetailsUpdated(Box<stripe_treasury::TreasuryOutboundTransfer>),
1399    /// Occurs whenever a received_credit is created as a result of funds being pushed by another account.
1400    #[cfg(feature = "async-stripe-treasury")]
1401    TreasuryReceivedCreditCreated(Box<stripe_treasury::TreasuryReceivedCredit>),
1402    /// Occurs whenever a received_credit transitions to failed state. Only applicable for check deposits.
1403    #[cfg(feature = "async-stripe-treasury")]
1404    TreasuryReceivedCreditFailed(Box<stripe_treasury::TreasuryReceivedCredit>),
1405    /// Occurs whenever a received_credit transitions to succeeded state.
1406    /// Only applicable for check deposits.
1407    #[cfg(feature = "async-stripe-treasury")]
1408    TreasuryReceivedCreditSucceeded(Box<stripe_treasury::TreasuryReceivedCredit>),
1409    /// Occurs whenever a received_debit is created as a result of funds being pulled by another account.
1410    #[cfg(feature = "async-stripe-treasury")]
1411    TreasuryReceivedDebitCreated(Box<stripe_treasury::TreasuryReceivedDebit>),
1412    #[cfg_attr(
1413        any(feature = "deserialize", feature = "serialize"),
1414        serde(with = "stripe_types::with_serde_json")
1415    )]
1416    Unknown(miniserde::json::Value),
1417}
1418#[cfg(feature = "redact-generated-debug")]
1419impl std::fmt::Debug for EventObject {
1420    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
1421        f.debug_struct("EventObject").finish_non_exhaustive()
1422    }
1423}
1424impl EventObject {
1425    #[inline(never)]
1426    pub(crate) fn from_raw_data(typ: &str, data: miniserde::json::Value) -> Option<Self> {
1427        use stripe_types::miniserde_helpers::FromValueOpt;
1428
1429        // Helper to avoid stack allocation for each branch
1430        #[inline(always)]
1431        fn parse_and_box<T: FromValueOpt>(data: miniserde::json::Value) -> Option<Box<T>> {
1432            FromValueOpt::from_value(data).map(Box::new)
1433        }
1434
1435        if typ == "account.application.authorized" {
1436            return parse_and_box(data).map(Self::AccountApplicationAuthorized);
1437        }
1438        if typ == "account.application.deauthorized" {
1439            return parse_and_box(data).map(Self::AccountApplicationDeauthorized);
1440        }
1441        if typ == "account.external_account.created" {
1442            return parse_and_box(data).map(Self::AccountExternalAccountCreated);
1443        }
1444        if typ == "account.external_account.deleted" {
1445            return parse_and_box(data).map(Self::AccountExternalAccountDeleted);
1446        }
1447        if typ == "account.external_account.updated" {
1448            return parse_and_box(data).map(Self::AccountExternalAccountUpdated);
1449        }
1450        if typ == "account.updated" {
1451            return parse_and_box(data).map(Self::AccountUpdated);
1452        }
1453        if typ == "application_fee.created" {
1454            return parse_and_box(data).map(Self::ApplicationFeeCreated);
1455        }
1456        if typ == "application_fee.refund.updated" {
1457            return parse_and_box(data).map(Self::ApplicationFeeRefundUpdated);
1458        }
1459        if typ == "application_fee.refunded" {
1460            return parse_and_box(data).map(Self::ApplicationFeeRefunded);
1461        }
1462        #[cfg(feature = "async-stripe-core")]
1463        if typ == "balance.available" {
1464            return parse_and_box(data).map(Self::BalanceAvailable);
1465        }
1466        #[cfg(feature = "async-stripe-core")]
1467        if typ == "balance_settings.updated" {
1468            return parse_and_box(data).map(Self::BalanceSettingsUpdated);
1469        }
1470        #[cfg(feature = "async-stripe-billing")]
1471        if typ == "billing.alert.triggered" {
1472            return parse_and_box(data).map(Self::BillingAlertTriggered);
1473        }
1474        if typ == "billing.credit_balance_transaction.created" {
1475            return parse_and_box(data).map(Self::BillingCreditBalanceTransactionCreated);
1476        }
1477        if typ == "billing.credit_grant.created" {
1478            return parse_and_box(data).map(Self::BillingCreditGrantCreated);
1479        }
1480        if typ == "billing.credit_grant.updated" {
1481            return parse_and_box(data).map(Self::BillingCreditGrantUpdated);
1482        }
1483        #[cfg(feature = "async-stripe-billing")]
1484        if typ == "billing.meter.created" {
1485            return parse_and_box(data).map(Self::BillingMeterCreated);
1486        }
1487        #[cfg(feature = "async-stripe-billing")]
1488        if typ == "billing.meter.deactivated" {
1489            return parse_and_box(data).map(Self::BillingMeterDeactivated);
1490        }
1491        #[cfg(feature = "async-stripe-billing")]
1492        if typ == "billing.meter.reactivated" {
1493            return parse_and_box(data).map(Self::BillingMeterReactivated);
1494        }
1495        #[cfg(feature = "async-stripe-billing")]
1496        if typ == "billing.meter.updated" {
1497            return parse_and_box(data).map(Self::BillingMeterUpdated);
1498        }
1499        #[cfg(feature = "async-stripe-billing")]
1500        if typ == "billing_portal.configuration.created" {
1501            return parse_and_box(data).map(Self::BillingPortalConfigurationCreated);
1502        }
1503        #[cfg(feature = "async-stripe-billing")]
1504        if typ == "billing_portal.configuration.updated" {
1505            return parse_and_box(data).map(Self::BillingPortalConfigurationUpdated);
1506        }
1507        #[cfg(feature = "async-stripe-billing")]
1508        if typ == "billing_portal.session.created" {
1509            return parse_and_box(data).map(Self::BillingPortalSessionCreated);
1510        }
1511        if typ == "capability.updated" {
1512            return parse_and_box(data).map(Self::CapabilityUpdated);
1513        }
1514        if typ == "cash_balance.funds_available" {
1515            return parse_and_box(data).map(Self::CashBalanceFundsAvailable);
1516        }
1517        if typ == "charge.captured" {
1518            return parse_and_box(data).map(Self::ChargeCaptured);
1519        }
1520        if typ == "charge.dispute.closed" {
1521            return parse_and_box(data).map(Self::ChargeDisputeClosed);
1522        }
1523        if typ == "charge.dispute.created" {
1524            return parse_and_box(data).map(Self::ChargeDisputeCreated);
1525        }
1526        if typ == "charge.dispute.funds_reinstated" {
1527            return parse_and_box(data).map(Self::ChargeDisputeFundsReinstated);
1528        }
1529        if typ == "charge.dispute.funds_withdrawn" {
1530            return parse_and_box(data).map(Self::ChargeDisputeFundsWithdrawn);
1531        }
1532        if typ == "charge.dispute.updated" {
1533            return parse_and_box(data).map(Self::ChargeDisputeUpdated);
1534        }
1535        if typ == "charge.expired" {
1536            return parse_and_box(data).map(Self::ChargeExpired);
1537        }
1538        if typ == "charge.failed" {
1539            return parse_and_box(data).map(Self::ChargeFailed);
1540        }
1541        if typ == "charge.pending" {
1542            return parse_and_box(data).map(Self::ChargePending);
1543        }
1544        if typ == "charge.refund.updated" {
1545            return parse_and_box(data).map(Self::ChargeRefundUpdated);
1546        }
1547        if typ == "charge.refunded" {
1548            return parse_and_box(data).map(Self::ChargeRefunded);
1549        }
1550        if typ == "charge.succeeded" {
1551            return parse_and_box(data).map(Self::ChargeSucceeded);
1552        }
1553        if typ == "charge.updated" {
1554            return parse_and_box(data).map(Self::ChargeUpdated);
1555        }
1556        if typ == "checkout.session.async_payment_failed" {
1557            return parse_and_box(data).map(Self::CheckoutSessionAsyncPaymentFailed);
1558        }
1559        if typ == "checkout.session.async_payment_succeeded" {
1560            return parse_and_box(data).map(Self::CheckoutSessionAsyncPaymentSucceeded);
1561        }
1562        if typ == "checkout.session.completed" {
1563            return parse_and_box(data).map(Self::CheckoutSessionCompleted);
1564        }
1565        if typ == "checkout.session.expired" {
1566            return parse_and_box(data).map(Self::CheckoutSessionExpired);
1567        }
1568        #[cfg(feature = "async-stripe-misc")]
1569        if typ == "climate.order.canceled" {
1570            return parse_and_box(data).map(Self::ClimateOrderCanceled);
1571        }
1572        #[cfg(feature = "async-stripe-misc")]
1573        if typ == "climate.order.created" {
1574            return parse_and_box(data).map(Self::ClimateOrderCreated);
1575        }
1576        #[cfg(feature = "async-stripe-misc")]
1577        if typ == "climate.order.delayed" {
1578            return parse_and_box(data).map(Self::ClimateOrderDelayed);
1579        }
1580        #[cfg(feature = "async-stripe-misc")]
1581        if typ == "climate.order.delivered" {
1582            return parse_and_box(data).map(Self::ClimateOrderDelivered);
1583        }
1584        #[cfg(feature = "async-stripe-misc")]
1585        if typ == "climate.order.product_substituted" {
1586            return parse_and_box(data).map(Self::ClimateOrderProductSubstituted);
1587        }
1588        #[cfg(feature = "async-stripe-misc")]
1589        if typ == "climate.product.created" {
1590            return parse_and_box(data).map(Self::ClimateProductCreated);
1591        }
1592        #[cfg(feature = "async-stripe-misc")]
1593        if typ == "climate.product.pricing_updated" {
1594            return parse_and_box(data).map(Self::ClimateProductPricingUpdated);
1595        }
1596        if typ == "coupon.created" {
1597            return parse_and_box(data).map(Self::CouponCreated);
1598        }
1599        if typ == "coupon.deleted" {
1600            return parse_and_box(data).map(Self::CouponDeleted);
1601        }
1602        if typ == "coupon.updated" {
1603            return parse_and_box(data).map(Self::CouponUpdated);
1604        }
1605        if typ == "credit_note.created" {
1606            return parse_and_box(data).map(Self::CreditNoteCreated);
1607        }
1608        if typ == "credit_note.updated" {
1609            return parse_and_box(data).map(Self::CreditNoteUpdated);
1610        }
1611        if typ == "credit_note.voided" {
1612            return parse_and_box(data).map(Self::CreditNoteVoided);
1613        }
1614        if typ == "customer.created" {
1615            return parse_and_box(data).map(Self::CustomerCreated);
1616        }
1617        if typ == "customer.deleted" {
1618            return parse_and_box(data).map(Self::CustomerDeleted);
1619        }
1620        if typ == "customer.discount.created" {
1621            return parse_and_box(data).map(Self::CustomerDiscountCreated);
1622        }
1623        if typ == "customer.discount.deleted" {
1624            return parse_and_box(data).map(Self::CustomerDiscountDeleted);
1625        }
1626        if typ == "customer.discount.updated" {
1627            return parse_and_box(data).map(Self::CustomerDiscountUpdated);
1628        }
1629        if typ == "customer.source.created" {
1630            return parse_and_box(data).map(Self::CustomerSourceCreated);
1631        }
1632        if typ == "customer.source.deleted" {
1633            return parse_and_box(data).map(Self::CustomerSourceDeleted);
1634        }
1635        if typ == "customer.source.expiring" {
1636            return parse_and_box(data).map(Self::CustomerSourceExpiring);
1637        }
1638        if typ == "customer.source.updated" {
1639            return parse_and_box(data).map(Self::CustomerSourceUpdated);
1640        }
1641        if typ == "customer.subscription.created" {
1642            return parse_and_box(data).map(Self::CustomerSubscriptionCreated);
1643        }
1644        if typ == "customer.subscription.deleted" {
1645            return parse_and_box(data).map(Self::CustomerSubscriptionDeleted);
1646        }
1647        if typ == "customer.subscription.paused" {
1648            return parse_and_box(data).map(Self::CustomerSubscriptionPaused);
1649        }
1650        if typ == "customer.subscription.pending_update_applied" {
1651            return parse_and_box(data).map(Self::CustomerSubscriptionPendingUpdateApplied);
1652        }
1653        if typ == "customer.subscription.pending_update_expired" {
1654            return parse_and_box(data).map(Self::CustomerSubscriptionPendingUpdateExpired);
1655        }
1656        if typ == "customer.subscription.resumed" {
1657            return parse_and_box(data).map(Self::CustomerSubscriptionResumed);
1658        }
1659        if typ == "customer.subscription.trial_will_end" {
1660            return parse_and_box(data).map(Self::CustomerSubscriptionTrialWillEnd);
1661        }
1662        if typ == "customer.subscription.updated" {
1663            return parse_and_box(data).map(Self::CustomerSubscriptionUpdated);
1664        }
1665        if typ == "customer.tax_id.created" {
1666            return parse_and_box(data).map(Self::CustomerTaxIdCreated);
1667        }
1668        if typ == "customer.tax_id.deleted" {
1669            return parse_and_box(data).map(Self::CustomerTaxIdDeleted);
1670        }
1671        if typ == "customer.tax_id.updated" {
1672            return parse_and_box(data).map(Self::CustomerTaxIdUpdated);
1673        }
1674        if typ == "customer.updated" {
1675            return parse_and_box(data).map(Self::CustomerUpdated);
1676        }
1677        if typ == "customer_cash_balance_transaction.created" {
1678            return parse_and_box(data).map(Self::CustomerCashBalanceTransactionCreated);
1679        }
1680        #[cfg(feature = "async-stripe-misc")]
1681        if typ == "entitlements.active_entitlement_summary.updated" {
1682            return parse_and_box(data).map(Self::EntitlementsActiveEntitlementSummaryUpdated);
1683        }
1684        if typ == "file.created" {
1685            return parse_and_box(data).map(Self::FileCreated);
1686        }
1687        #[cfg(feature = "async-stripe-misc")]
1688        if typ == "financial_connections.account.account_numbers_updated" {
1689            return parse_and_box(data).map(Self::FinancialConnectionsAccountAccountNumbersUpdated);
1690        }
1691        #[cfg(feature = "async-stripe-misc")]
1692        if typ == "financial_connections.account.created" {
1693            return parse_and_box(data).map(Self::FinancialConnectionsAccountCreated);
1694        }
1695        #[cfg(feature = "async-stripe-misc")]
1696        if typ == "financial_connections.account.deactivated" {
1697            return parse_and_box(data).map(Self::FinancialConnectionsAccountDeactivated);
1698        }
1699        #[cfg(feature = "async-stripe-misc")]
1700        if typ == "financial_connections.account.disconnected" {
1701            return parse_and_box(data).map(Self::FinancialConnectionsAccountDisconnected);
1702        }
1703        #[cfg(feature = "async-stripe-misc")]
1704        if typ == "financial_connections.account.reactivated" {
1705            return parse_and_box(data).map(Self::FinancialConnectionsAccountReactivated);
1706        }
1707        #[cfg(feature = "async-stripe-misc")]
1708        if typ == "financial_connections.account.refreshed_balance" {
1709            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedBalance);
1710        }
1711        #[cfg(feature = "async-stripe-misc")]
1712        if typ == "financial_connections.account.refreshed_ownership" {
1713            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedOwnership);
1714        }
1715        #[cfg(feature = "async-stripe-misc")]
1716        if typ == "financial_connections.account.refreshed_transactions" {
1717            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedTransactions);
1718        }
1719        #[cfg(feature = "async-stripe-misc")]
1720        if typ == "financial_connections.account.upcoming_account_number_expiry" {
1721            return parse_and_box(data)
1722                .map(Self::FinancialConnectionsAccountUpcomingAccountNumberExpiry);
1723        }
1724        #[cfg(feature = "async-stripe-misc")]
1725        if typ == "identity.verification_session.canceled" {
1726            return parse_and_box(data).map(Self::IdentityVerificationSessionCanceled);
1727        }
1728        #[cfg(feature = "async-stripe-misc")]
1729        if typ == "identity.verification_session.created" {
1730            return parse_and_box(data).map(Self::IdentityVerificationSessionCreated);
1731        }
1732        #[cfg(feature = "async-stripe-misc")]
1733        if typ == "identity.verification_session.processing" {
1734            return parse_and_box(data).map(Self::IdentityVerificationSessionProcessing);
1735        }
1736        #[cfg(feature = "async-stripe-misc")]
1737        if typ == "identity.verification_session.redacted" {
1738            return parse_and_box(data).map(Self::IdentityVerificationSessionRedacted);
1739        }
1740        #[cfg(feature = "async-stripe-misc")]
1741        if typ == "identity.verification_session.requires_input" {
1742            return parse_and_box(data).map(Self::IdentityVerificationSessionRequiresInput);
1743        }
1744        #[cfg(feature = "async-stripe-misc")]
1745        if typ == "identity.verification_session.verified" {
1746            return parse_and_box(data).map(Self::IdentityVerificationSessionVerified);
1747        }
1748        if typ == "invoice.created" {
1749            return parse_and_box(data).map(Self::InvoiceCreated);
1750        }
1751        if typ == "invoice.deleted" {
1752            return parse_and_box(data).map(Self::InvoiceDeleted);
1753        }
1754        if typ == "invoice.finalization_failed" {
1755            return parse_and_box(data).map(Self::InvoiceFinalizationFailed);
1756        }
1757        if typ == "invoice.finalized" {
1758            return parse_and_box(data).map(Self::InvoiceFinalized);
1759        }
1760        if typ == "invoice.marked_uncollectible" {
1761            return parse_and_box(data).map(Self::InvoiceMarkedUncollectible);
1762        }
1763        if typ == "invoice.overdue" {
1764            return parse_and_box(data).map(Self::InvoiceOverdue);
1765        }
1766        if typ == "invoice.overpaid" {
1767            return parse_and_box(data).map(Self::InvoiceOverpaid);
1768        }
1769        if typ == "invoice.paid" {
1770            return parse_and_box(data).map(Self::InvoicePaid);
1771        }
1772        if typ == "invoice.payment_action_required" {
1773            return parse_and_box(data).map(Self::InvoicePaymentActionRequired);
1774        }
1775        if typ == "invoice.payment_attempt_required" {
1776            return parse_and_box(data).map(Self::InvoicePaymentAttemptRequired);
1777        }
1778        if typ == "invoice.payment_failed" {
1779            return parse_and_box(data).map(Self::InvoicePaymentFailed);
1780        }
1781        if typ == "invoice.payment_succeeded" {
1782            return parse_and_box(data).map(Self::InvoicePaymentSucceeded);
1783        }
1784        if typ == "invoice.sent" {
1785            return parse_and_box(data).map(Self::InvoiceSent);
1786        }
1787        if typ == "invoice.upcoming" {
1788            return parse_and_box(data).map(Self::InvoiceUpcoming);
1789        }
1790        if typ == "invoice.updated" {
1791            return parse_and_box(data).map(Self::InvoiceUpdated);
1792        }
1793        if typ == "invoice.voided" {
1794            return parse_and_box(data).map(Self::InvoiceVoided);
1795        }
1796        if typ == "invoice.will_be_due" {
1797            return parse_and_box(data).map(Self::InvoiceWillBeDue);
1798        }
1799        if typ == "invoice_payment.paid" {
1800            return parse_and_box(data).map(Self::InvoicePaymentPaid);
1801        }
1802        #[cfg(feature = "async-stripe-billing")]
1803        if typ == "invoiceitem.created" {
1804            return parse_and_box(data).map(Self::InvoiceitemCreated);
1805        }
1806        #[cfg(feature = "async-stripe-billing")]
1807        if typ == "invoiceitem.deleted" {
1808            return parse_and_box(data).map(Self::InvoiceitemDeleted);
1809        }
1810        if typ == "issuing_authorization.created" {
1811            return parse_and_box(data).map(Self::IssuingAuthorizationCreated);
1812        }
1813        if typ == "issuing_authorization.request" {
1814            return parse_and_box(data).map(Self::IssuingAuthorizationRequest);
1815        }
1816        if typ == "issuing_authorization.updated" {
1817            return parse_and_box(data).map(Self::IssuingAuthorizationUpdated);
1818        }
1819        if typ == "issuing_card.created" {
1820            return parse_and_box(data).map(Self::IssuingCardCreated);
1821        }
1822        if typ == "issuing_card.updated" {
1823            return parse_and_box(data).map(Self::IssuingCardUpdated);
1824        }
1825        if typ == "issuing_cardholder.created" {
1826            return parse_and_box(data).map(Self::IssuingCardholderCreated);
1827        }
1828        if typ == "issuing_cardholder.updated" {
1829            return parse_and_box(data).map(Self::IssuingCardholderUpdated);
1830        }
1831        if typ == "issuing_dispute.closed" {
1832            return parse_and_box(data).map(Self::IssuingDisputeClosed);
1833        }
1834        if typ == "issuing_dispute.created" {
1835            return parse_and_box(data).map(Self::IssuingDisputeCreated);
1836        }
1837        if typ == "issuing_dispute.funds_reinstated" {
1838            return parse_and_box(data).map(Self::IssuingDisputeFundsReinstated);
1839        }
1840        if typ == "issuing_dispute.funds_rescinded" {
1841            return parse_and_box(data).map(Self::IssuingDisputeFundsRescinded);
1842        }
1843        if typ == "issuing_dispute.submitted" {
1844            return parse_and_box(data).map(Self::IssuingDisputeSubmitted);
1845        }
1846        if typ == "issuing_dispute.updated" {
1847            return parse_and_box(data).map(Self::IssuingDisputeUpdated);
1848        }
1849        if typ == "issuing_personalization_design.activated" {
1850            return parse_and_box(data).map(Self::IssuingPersonalizationDesignActivated);
1851        }
1852        if typ == "issuing_personalization_design.deactivated" {
1853            return parse_and_box(data).map(Self::IssuingPersonalizationDesignDeactivated);
1854        }
1855        if typ == "issuing_personalization_design.rejected" {
1856            return parse_and_box(data).map(Self::IssuingPersonalizationDesignRejected);
1857        }
1858        if typ == "issuing_personalization_design.updated" {
1859            return parse_and_box(data).map(Self::IssuingPersonalizationDesignUpdated);
1860        }
1861        if typ == "issuing_token.created" {
1862            return parse_and_box(data).map(Self::IssuingTokenCreated);
1863        }
1864        if typ == "issuing_token.updated" {
1865            return parse_and_box(data).map(Self::IssuingTokenUpdated);
1866        }
1867        if typ == "issuing_transaction.created" {
1868            return parse_and_box(data).map(Self::IssuingTransactionCreated);
1869        }
1870        if typ == "issuing_transaction.purchase_details_receipt_updated" {
1871            return parse_and_box(data).map(Self::IssuingTransactionPurchaseDetailsReceiptUpdated);
1872        }
1873        if typ == "issuing_transaction.updated" {
1874            return parse_and_box(data).map(Self::IssuingTransactionUpdated);
1875        }
1876        if typ == "mandate.updated" {
1877            return parse_and_box(data).map(Self::MandateUpdated);
1878        }
1879        if typ == "payment_intent.amount_capturable_updated" {
1880            return parse_and_box(data).map(Self::PaymentIntentAmountCapturableUpdated);
1881        }
1882        if typ == "payment_intent.canceled" {
1883            return parse_and_box(data).map(Self::PaymentIntentCanceled);
1884        }
1885        if typ == "payment_intent.created" {
1886            return parse_and_box(data).map(Self::PaymentIntentCreated);
1887        }
1888        if typ == "payment_intent.partially_funded" {
1889            return parse_and_box(data).map(Self::PaymentIntentPartiallyFunded);
1890        }
1891        if typ == "payment_intent.payment_failed" {
1892            return parse_and_box(data).map(Self::PaymentIntentPaymentFailed);
1893        }
1894        if typ == "payment_intent.processing" {
1895            return parse_and_box(data).map(Self::PaymentIntentProcessing);
1896        }
1897        if typ == "payment_intent.requires_action" {
1898            return parse_and_box(data).map(Self::PaymentIntentRequiresAction);
1899        }
1900        if typ == "payment_intent.succeeded" {
1901            return parse_and_box(data).map(Self::PaymentIntentSucceeded);
1902        }
1903        if typ == "payment_link.created" {
1904            return parse_and_box(data).map(Self::PaymentLinkCreated);
1905        }
1906        if typ == "payment_link.updated" {
1907            return parse_and_box(data).map(Self::PaymentLinkUpdated);
1908        }
1909        if typ == "payment_method.attached" {
1910            return parse_and_box(data).map(Self::PaymentMethodAttached);
1911        }
1912        if typ == "payment_method.automatically_updated" {
1913            return parse_and_box(data).map(Self::PaymentMethodAutomaticallyUpdated);
1914        }
1915        if typ == "payment_method.detached" {
1916            return parse_and_box(data).map(Self::PaymentMethodDetached);
1917        }
1918        if typ == "payment_method.updated" {
1919            return parse_and_box(data).map(Self::PaymentMethodUpdated);
1920        }
1921        if typ == "payout.canceled" {
1922            return parse_and_box(data).map(Self::PayoutCanceled);
1923        }
1924        if typ == "payout.created" {
1925            return parse_and_box(data).map(Self::PayoutCreated);
1926        }
1927        if typ == "payout.failed" {
1928            return parse_and_box(data).map(Self::PayoutFailed);
1929        }
1930        if typ == "payout.paid" {
1931            return parse_and_box(data).map(Self::PayoutPaid);
1932        }
1933        if typ == "payout.reconciliation_completed" {
1934            return parse_and_box(data).map(Self::PayoutReconciliationCompleted);
1935        }
1936        if typ == "payout.updated" {
1937            return parse_and_box(data).map(Self::PayoutUpdated);
1938        }
1939        if typ == "person.created" {
1940            return parse_and_box(data).map(Self::PersonCreated);
1941        }
1942        if typ == "person.deleted" {
1943            return parse_and_box(data).map(Self::PersonDeleted);
1944        }
1945        if typ == "person.updated" {
1946            return parse_and_box(data).map(Self::PersonUpdated);
1947        }
1948        if typ == "plan.created" {
1949            return parse_and_box(data).map(Self::PlanCreated);
1950        }
1951        if typ == "plan.deleted" {
1952            return parse_and_box(data).map(Self::PlanDeleted);
1953        }
1954        if typ == "plan.updated" {
1955            return parse_and_box(data).map(Self::PlanUpdated);
1956        }
1957        if typ == "price.created" {
1958            return parse_and_box(data).map(Self::PriceCreated);
1959        }
1960        if typ == "price.deleted" {
1961            return parse_and_box(data).map(Self::PriceDeleted);
1962        }
1963        if typ == "price.updated" {
1964            return parse_and_box(data).map(Self::PriceUpdated);
1965        }
1966        if typ == "product.created" {
1967            return parse_and_box(data).map(Self::ProductCreated);
1968        }
1969        if typ == "product.deleted" {
1970            return parse_and_box(data).map(Self::ProductDeleted);
1971        }
1972        if typ == "product.updated" {
1973            return parse_and_box(data).map(Self::ProductUpdated);
1974        }
1975        if typ == "promotion_code.created" {
1976            return parse_and_box(data).map(Self::PromotionCodeCreated);
1977        }
1978        if typ == "promotion_code.updated" {
1979            return parse_and_box(data).map(Self::PromotionCodeUpdated);
1980        }
1981        #[cfg(feature = "async-stripe-billing")]
1982        if typ == "quote.accepted" {
1983            return parse_and_box(data).map(Self::QuoteAccepted);
1984        }
1985        #[cfg(feature = "async-stripe-billing")]
1986        if typ == "quote.canceled" {
1987            return parse_and_box(data).map(Self::QuoteCanceled);
1988        }
1989        #[cfg(feature = "async-stripe-billing")]
1990        if typ == "quote.created" {
1991            return parse_and_box(data).map(Self::QuoteCreated);
1992        }
1993        #[cfg(feature = "async-stripe-billing")]
1994        if typ == "quote.finalized" {
1995            return parse_and_box(data).map(Self::QuoteFinalized);
1996        }
1997        #[cfg(feature = "async-stripe-fraud")]
1998        if typ == "radar.early_fraud_warning.created" {
1999            return parse_and_box(data).map(Self::RadarEarlyFraudWarningCreated);
2000        }
2001        #[cfg(feature = "async-stripe-fraud")]
2002        if typ == "radar.early_fraud_warning.updated" {
2003            return parse_and_box(data).map(Self::RadarEarlyFraudWarningUpdated);
2004        }
2005        if typ == "refund.created" {
2006            return parse_and_box(data).map(Self::RefundCreated);
2007        }
2008        if typ == "refund.failed" {
2009            return parse_and_box(data).map(Self::RefundFailed);
2010        }
2011        if typ == "refund.updated" {
2012            return parse_and_box(data).map(Self::RefundUpdated);
2013        }
2014        #[cfg(feature = "async-stripe-misc")]
2015        if typ == "reporting.report_run.failed" {
2016            return parse_and_box(data).map(Self::ReportingReportRunFailed);
2017        }
2018        #[cfg(feature = "async-stripe-misc")]
2019        if typ == "reporting.report_run.succeeded" {
2020            return parse_and_box(data).map(Self::ReportingReportRunSucceeded);
2021        }
2022        #[cfg(feature = "async-stripe-misc")]
2023        if typ == "reporting.report_type.updated" {
2024            return parse_and_box(data).map(Self::ReportingReportTypeUpdated);
2025        }
2026        #[cfg(feature = "async-stripe-reserve")]
2027        if typ == "reserve.hold.created" {
2028            return parse_and_box(data).map(Self::ReserveHoldCreated);
2029        }
2030        #[cfg(feature = "async-stripe-reserve")]
2031        if typ == "reserve.hold.updated" {
2032            return parse_and_box(data).map(Self::ReserveHoldUpdated);
2033        }
2034        #[cfg(feature = "async-stripe-reserve")]
2035        if typ == "reserve.plan.created" {
2036            return parse_and_box(data).map(Self::ReservePlanCreated);
2037        }
2038        #[cfg(feature = "async-stripe-reserve")]
2039        if typ == "reserve.plan.disabled" {
2040            return parse_and_box(data).map(Self::ReservePlanDisabled);
2041        }
2042        #[cfg(feature = "async-stripe-reserve")]
2043        if typ == "reserve.plan.expired" {
2044            return parse_and_box(data).map(Self::ReservePlanExpired);
2045        }
2046        #[cfg(feature = "async-stripe-reserve")]
2047        if typ == "reserve.plan.updated" {
2048            return parse_and_box(data).map(Self::ReservePlanUpdated);
2049        }
2050        #[cfg(feature = "async-stripe-reserve")]
2051        if typ == "reserve.release.created" {
2052            return parse_and_box(data).map(Self::ReserveReleaseCreated);
2053        }
2054        if typ == "review.closed" {
2055            return parse_and_box(data).map(Self::ReviewClosed);
2056        }
2057        if typ == "review.opened" {
2058            return parse_and_box(data).map(Self::ReviewOpened);
2059        }
2060        if typ == "setup_intent.canceled" {
2061            return parse_and_box(data).map(Self::SetupIntentCanceled);
2062        }
2063        if typ == "setup_intent.created" {
2064            return parse_and_box(data).map(Self::SetupIntentCreated);
2065        }
2066        if typ == "setup_intent.requires_action" {
2067            return parse_and_box(data).map(Self::SetupIntentRequiresAction);
2068        }
2069        if typ == "setup_intent.setup_failed" {
2070            return parse_and_box(data).map(Self::SetupIntentSetupFailed);
2071        }
2072        if typ == "setup_intent.succeeded" {
2073            return parse_and_box(data).map(Self::SetupIntentSucceeded);
2074        }
2075        #[cfg(feature = "async-stripe-misc")]
2076        if typ == "sigma.scheduled_query_run.created" {
2077            return parse_and_box(data).map(Self::SigmaScheduledQueryRunCreated);
2078        }
2079        if typ == "source.canceled" {
2080            return parse_and_box(data).map(Self::SourceCanceled);
2081        }
2082        if typ == "source.chargeable" {
2083            return parse_and_box(data).map(Self::SourceChargeable);
2084        }
2085        if typ == "source.failed" {
2086            return parse_and_box(data).map(Self::SourceFailed);
2087        }
2088        #[cfg(feature = "async-stripe-payment")]
2089        if typ == "source.mandate_notification" {
2090            return parse_and_box(data).map(Self::SourceMandateNotification);
2091        }
2092        if typ == "source.refund_attributes_required" {
2093            return parse_and_box(data).map(Self::SourceRefundAttributesRequired);
2094        }
2095        if typ == "source.transaction.created" {
2096            return parse_and_box(data).map(Self::SourceTransactionCreated);
2097        }
2098        if typ == "source.transaction.updated" {
2099            return parse_and_box(data).map(Self::SourceTransactionUpdated);
2100        }
2101        if typ == "subscription_schedule.aborted" {
2102            return parse_and_box(data).map(Self::SubscriptionScheduleAborted);
2103        }
2104        if typ == "subscription_schedule.canceled" {
2105            return parse_and_box(data).map(Self::SubscriptionScheduleCanceled);
2106        }
2107        if typ == "subscription_schedule.completed" {
2108            return parse_and_box(data).map(Self::SubscriptionScheduleCompleted);
2109        }
2110        if typ == "subscription_schedule.created" {
2111            return parse_and_box(data).map(Self::SubscriptionScheduleCreated);
2112        }
2113        if typ == "subscription_schedule.expiring" {
2114            return parse_and_box(data).map(Self::SubscriptionScheduleExpiring);
2115        }
2116        if typ == "subscription_schedule.released" {
2117            return parse_and_box(data).map(Self::SubscriptionScheduleReleased);
2118        }
2119        if typ == "subscription_schedule.updated" {
2120            return parse_and_box(data).map(Self::SubscriptionScheduleUpdated);
2121        }
2122        #[cfg(feature = "async-stripe-misc")]
2123        if typ == "tax.settings.updated" {
2124            return parse_and_box(data).map(Self::TaxSettingsUpdated);
2125        }
2126        if typ == "tax_rate.created" {
2127            return parse_and_box(data).map(Self::TaxRateCreated);
2128        }
2129        if typ == "tax_rate.updated" {
2130            return parse_and_box(data).map(Self::TaxRateUpdated);
2131        }
2132        #[cfg(feature = "async-stripe-terminal")]
2133        if typ == "terminal.reader.action_failed" {
2134            return parse_and_box(data).map(Self::TerminalReaderActionFailed);
2135        }
2136        #[cfg(feature = "async-stripe-terminal")]
2137        if typ == "terminal.reader.action_succeeded" {
2138            return parse_and_box(data).map(Self::TerminalReaderActionSucceeded);
2139        }
2140        #[cfg(feature = "async-stripe-terminal")]
2141        if typ == "terminal.reader.action_updated" {
2142            return parse_and_box(data).map(Self::TerminalReaderActionUpdated);
2143        }
2144        if typ == "test_helpers.test_clock.advancing" {
2145            return parse_and_box(data).map(Self::TestHelpersTestClockAdvancing);
2146        }
2147        if typ == "test_helpers.test_clock.created" {
2148            return parse_and_box(data).map(Self::TestHelpersTestClockCreated);
2149        }
2150        if typ == "test_helpers.test_clock.deleted" {
2151            return parse_and_box(data).map(Self::TestHelpersTestClockDeleted);
2152        }
2153        if typ == "test_helpers.test_clock.internal_failure" {
2154            return parse_and_box(data).map(Self::TestHelpersTestClockInternalFailure);
2155        }
2156        if typ == "test_helpers.test_clock.ready" {
2157            return parse_and_box(data).map(Self::TestHelpersTestClockReady);
2158        }
2159        if typ == "topup.canceled" {
2160            return parse_and_box(data).map(Self::TopupCanceled);
2161        }
2162        if typ == "topup.created" {
2163            return parse_and_box(data).map(Self::TopupCreated);
2164        }
2165        if typ == "topup.failed" {
2166            return parse_and_box(data).map(Self::TopupFailed);
2167        }
2168        if typ == "topup.reversed" {
2169            return parse_and_box(data).map(Self::TopupReversed);
2170        }
2171        if typ == "topup.succeeded" {
2172            return parse_and_box(data).map(Self::TopupSucceeded);
2173        }
2174        if typ == "transfer.created" {
2175            return parse_and_box(data).map(Self::TransferCreated);
2176        }
2177        if typ == "transfer.reversed" {
2178            return parse_and_box(data).map(Self::TransferReversed);
2179        }
2180        if typ == "transfer.updated" {
2181            return parse_and_box(data).map(Self::TransferUpdated);
2182        }
2183        #[cfg(feature = "async-stripe-treasury")]
2184        if typ == "treasury.credit_reversal.created" {
2185            return parse_and_box(data).map(Self::TreasuryCreditReversalCreated);
2186        }
2187        #[cfg(feature = "async-stripe-treasury")]
2188        if typ == "treasury.credit_reversal.posted" {
2189            return parse_and_box(data).map(Self::TreasuryCreditReversalPosted);
2190        }
2191        #[cfg(feature = "async-stripe-treasury")]
2192        if typ == "treasury.debit_reversal.completed" {
2193            return parse_and_box(data).map(Self::TreasuryDebitReversalCompleted);
2194        }
2195        #[cfg(feature = "async-stripe-treasury")]
2196        if typ == "treasury.debit_reversal.created" {
2197            return parse_and_box(data).map(Self::TreasuryDebitReversalCreated);
2198        }
2199        #[cfg(feature = "async-stripe-treasury")]
2200        if typ == "treasury.debit_reversal.initial_credit_granted" {
2201            return parse_and_box(data).map(Self::TreasuryDebitReversalInitialCreditGranted);
2202        }
2203        #[cfg(feature = "async-stripe-treasury")]
2204        if typ == "treasury.financial_account.closed" {
2205            return parse_and_box(data).map(Self::TreasuryFinancialAccountClosed);
2206        }
2207        #[cfg(feature = "async-stripe-treasury")]
2208        if typ == "treasury.financial_account.created" {
2209            return parse_and_box(data).map(Self::TreasuryFinancialAccountCreated);
2210        }
2211        #[cfg(feature = "async-stripe-treasury")]
2212        if typ == "treasury.financial_account.features_status_updated" {
2213            return parse_and_box(data).map(Self::TreasuryFinancialAccountFeaturesStatusUpdated);
2214        }
2215        #[cfg(feature = "async-stripe-treasury")]
2216        if typ == "treasury.inbound_transfer.canceled" {
2217            return parse_and_box(data).map(Self::TreasuryInboundTransferCanceled);
2218        }
2219        #[cfg(feature = "async-stripe-treasury")]
2220        if typ == "treasury.inbound_transfer.created" {
2221            return parse_and_box(data).map(Self::TreasuryInboundTransferCreated);
2222        }
2223        #[cfg(feature = "async-stripe-treasury")]
2224        if typ == "treasury.inbound_transfer.failed" {
2225            return parse_and_box(data).map(Self::TreasuryInboundTransferFailed);
2226        }
2227        #[cfg(feature = "async-stripe-treasury")]
2228        if typ == "treasury.inbound_transfer.succeeded" {
2229            return parse_and_box(data).map(Self::TreasuryInboundTransferSucceeded);
2230        }
2231        #[cfg(feature = "async-stripe-treasury")]
2232        if typ == "treasury.outbound_payment.canceled" {
2233            return parse_and_box(data).map(Self::TreasuryOutboundPaymentCanceled);
2234        }
2235        #[cfg(feature = "async-stripe-treasury")]
2236        if typ == "treasury.outbound_payment.created" {
2237            return parse_and_box(data).map(Self::TreasuryOutboundPaymentCreated);
2238        }
2239        #[cfg(feature = "async-stripe-treasury")]
2240        if typ == "treasury.outbound_payment.expected_arrival_date_updated" {
2241            return parse_and_box(data)
2242                .map(Self::TreasuryOutboundPaymentExpectedArrivalDateUpdated);
2243        }
2244        #[cfg(feature = "async-stripe-treasury")]
2245        if typ == "treasury.outbound_payment.failed" {
2246            return parse_and_box(data).map(Self::TreasuryOutboundPaymentFailed);
2247        }
2248        #[cfg(feature = "async-stripe-treasury")]
2249        if typ == "treasury.outbound_payment.posted" {
2250            return parse_and_box(data).map(Self::TreasuryOutboundPaymentPosted);
2251        }
2252        #[cfg(feature = "async-stripe-treasury")]
2253        if typ == "treasury.outbound_payment.returned" {
2254            return parse_and_box(data).map(Self::TreasuryOutboundPaymentReturned);
2255        }
2256        #[cfg(feature = "async-stripe-treasury")]
2257        if typ == "treasury.outbound_payment.tracking_details_updated" {
2258            return parse_and_box(data).map(Self::TreasuryOutboundPaymentTrackingDetailsUpdated);
2259        }
2260        #[cfg(feature = "async-stripe-treasury")]
2261        if typ == "treasury.outbound_transfer.canceled" {
2262            return parse_and_box(data).map(Self::TreasuryOutboundTransferCanceled);
2263        }
2264        #[cfg(feature = "async-stripe-treasury")]
2265        if typ == "treasury.outbound_transfer.created" {
2266            return parse_and_box(data).map(Self::TreasuryOutboundTransferCreated);
2267        }
2268        #[cfg(feature = "async-stripe-treasury")]
2269        if typ == "treasury.outbound_transfer.expected_arrival_date_updated" {
2270            return parse_and_box(data)
2271                .map(Self::TreasuryOutboundTransferExpectedArrivalDateUpdated);
2272        }
2273        #[cfg(feature = "async-stripe-treasury")]
2274        if typ == "treasury.outbound_transfer.failed" {
2275            return parse_and_box(data).map(Self::TreasuryOutboundTransferFailed);
2276        }
2277        #[cfg(feature = "async-stripe-treasury")]
2278        if typ == "treasury.outbound_transfer.posted" {
2279            return parse_and_box(data).map(Self::TreasuryOutboundTransferPosted);
2280        }
2281        #[cfg(feature = "async-stripe-treasury")]
2282        if typ == "treasury.outbound_transfer.returned" {
2283            return parse_and_box(data).map(Self::TreasuryOutboundTransferReturned);
2284        }
2285        #[cfg(feature = "async-stripe-treasury")]
2286        if typ == "treasury.outbound_transfer.tracking_details_updated" {
2287            return parse_and_box(data).map(Self::TreasuryOutboundTransferTrackingDetailsUpdated);
2288        }
2289        #[cfg(feature = "async-stripe-treasury")]
2290        if typ == "treasury.received_credit.created" {
2291            return parse_and_box(data).map(Self::TreasuryReceivedCreditCreated);
2292        }
2293        #[cfg(feature = "async-stripe-treasury")]
2294        if typ == "treasury.received_credit.failed" {
2295            return parse_and_box(data).map(Self::TreasuryReceivedCreditFailed);
2296        }
2297        #[cfg(feature = "async-stripe-treasury")]
2298        if typ == "treasury.received_credit.succeeded" {
2299            return parse_and_box(data).map(Self::TreasuryReceivedCreditSucceeded);
2300        }
2301        #[cfg(feature = "async-stripe-treasury")]
2302        if typ == "treasury.received_debit.created" {
2303            return parse_and_box(data).map(Self::TreasuryReceivedDebitCreated);
2304        }
2305
2306        Some(Self::Unknown(data))
2307    }
2308
2309    #[cfg(feature = "deserialize")]
2310    #[inline(never)]
2311    pub(crate) fn from_json_value(typ: &str, data: serde_json::Value) -> Result<Self, String> {
2312        // Helper to avoid stack allocation for each branch
2313        #[inline(always)]
2314        fn parse_and_box<T: serde::de::DeserializeOwned>(
2315            data: serde_json::Value,
2316        ) -> Result<Box<T>, String> {
2317            use serde::de::IntoDeserializer;
2318            let deserializer = data.into_deserializer();
2319            #[cfg(feature = "detailed-errors")]
2320            {
2321                serde_path_to_error::deserialize(deserializer)
2322                    .map(Box::new)
2323                    .map_err(|e| e.to_string())
2324            }
2325            #[cfg(not(feature = "detailed-errors"))]
2326            {
2327                T::deserialize(deserializer).map(Box::new).map_err(|e| e.to_string())
2328            }
2329        }
2330
2331        if typ == "account.application.authorized" {
2332            return parse_and_box(data).map(Self::AccountApplicationAuthorized);
2333        }
2334        if typ == "account.application.deauthorized" {
2335            return parse_and_box(data).map(Self::AccountApplicationDeauthorized);
2336        }
2337        if typ == "account.external_account.created" {
2338            return parse_and_box(data).map(Self::AccountExternalAccountCreated);
2339        }
2340        if typ == "account.external_account.deleted" {
2341            return parse_and_box(data).map(Self::AccountExternalAccountDeleted);
2342        }
2343        if typ == "account.external_account.updated" {
2344            return parse_and_box(data).map(Self::AccountExternalAccountUpdated);
2345        }
2346        if typ == "account.updated" {
2347            return parse_and_box(data).map(Self::AccountUpdated);
2348        }
2349        if typ == "application_fee.created" {
2350            return parse_and_box(data).map(Self::ApplicationFeeCreated);
2351        }
2352        if typ == "application_fee.refund.updated" {
2353            return parse_and_box(data).map(Self::ApplicationFeeRefundUpdated);
2354        }
2355        if typ == "application_fee.refunded" {
2356            return parse_and_box(data).map(Self::ApplicationFeeRefunded);
2357        }
2358        #[cfg(feature = "async-stripe-core")]
2359        if typ == "balance.available" {
2360            return parse_and_box(data).map(Self::BalanceAvailable);
2361        }
2362        #[cfg(feature = "async-stripe-core")]
2363        if typ == "balance_settings.updated" {
2364            return parse_and_box(data).map(Self::BalanceSettingsUpdated);
2365        }
2366        #[cfg(feature = "async-stripe-billing")]
2367        if typ == "billing.alert.triggered" {
2368            return parse_and_box(data).map(Self::BillingAlertTriggered);
2369        }
2370        if typ == "billing.credit_balance_transaction.created" {
2371            return parse_and_box(data).map(Self::BillingCreditBalanceTransactionCreated);
2372        }
2373        if typ == "billing.credit_grant.created" {
2374            return parse_and_box(data).map(Self::BillingCreditGrantCreated);
2375        }
2376        if typ == "billing.credit_grant.updated" {
2377            return parse_and_box(data).map(Self::BillingCreditGrantUpdated);
2378        }
2379        #[cfg(feature = "async-stripe-billing")]
2380        if typ == "billing.meter.created" {
2381            return parse_and_box(data).map(Self::BillingMeterCreated);
2382        }
2383        #[cfg(feature = "async-stripe-billing")]
2384        if typ == "billing.meter.deactivated" {
2385            return parse_and_box(data).map(Self::BillingMeterDeactivated);
2386        }
2387        #[cfg(feature = "async-stripe-billing")]
2388        if typ == "billing.meter.reactivated" {
2389            return parse_and_box(data).map(Self::BillingMeterReactivated);
2390        }
2391        #[cfg(feature = "async-stripe-billing")]
2392        if typ == "billing.meter.updated" {
2393            return parse_and_box(data).map(Self::BillingMeterUpdated);
2394        }
2395        #[cfg(feature = "async-stripe-billing")]
2396        if typ == "billing_portal.configuration.created" {
2397            return parse_and_box(data).map(Self::BillingPortalConfigurationCreated);
2398        }
2399        #[cfg(feature = "async-stripe-billing")]
2400        if typ == "billing_portal.configuration.updated" {
2401            return parse_and_box(data).map(Self::BillingPortalConfigurationUpdated);
2402        }
2403        #[cfg(feature = "async-stripe-billing")]
2404        if typ == "billing_portal.session.created" {
2405            return parse_and_box(data).map(Self::BillingPortalSessionCreated);
2406        }
2407        if typ == "capability.updated" {
2408            return parse_and_box(data).map(Self::CapabilityUpdated);
2409        }
2410        if typ == "cash_balance.funds_available" {
2411            return parse_and_box(data).map(Self::CashBalanceFundsAvailable);
2412        }
2413        if typ == "charge.captured" {
2414            return parse_and_box(data).map(Self::ChargeCaptured);
2415        }
2416        if typ == "charge.dispute.closed" {
2417            return parse_and_box(data).map(Self::ChargeDisputeClosed);
2418        }
2419        if typ == "charge.dispute.created" {
2420            return parse_and_box(data).map(Self::ChargeDisputeCreated);
2421        }
2422        if typ == "charge.dispute.funds_reinstated" {
2423            return parse_and_box(data).map(Self::ChargeDisputeFundsReinstated);
2424        }
2425        if typ == "charge.dispute.funds_withdrawn" {
2426            return parse_and_box(data).map(Self::ChargeDisputeFundsWithdrawn);
2427        }
2428        if typ == "charge.dispute.updated" {
2429            return parse_and_box(data).map(Self::ChargeDisputeUpdated);
2430        }
2431        if typ == "charge.expired" {
2432            return parse_and_box(data).map(Self::ChargeExpired);
2433        }
2434        if typ == "charge.failed" {
2435            return parse_and_box(data).map(Self::ChargeFailed);
2436        }
2437        if typ == "charge.pending" {
2438            return parse_and_box(data).map(Self::ChargePending);
2439        }
2440        if typ == "charge.refund.updated" {
2441            return parse_and_box(data).map(Self::ChargeRefundUpdated);
2442        }
2443        if typ == "charge.refunded" {
2444            return parse_and_box(data).map(Self::ChargeRefunded);
2445        }
2446        if typ == "charge.succeeded" {
2447            return parse_and_box(data).map(Self::ChargeSucceeded);
2448        }
2449        if typ == "charge.updated" {
2450            return parse_and_box(data).map(Self::ChargeUpdated);
2451        }
2452        if typ == "checkout.session.async_payment_failed" {
2453            return parse_and_box(data).map(Self::CheckoutSessionAsyncPaymentFailed);
2454        }
2455        if typ == "checkout.session.async_payment_succeeded" {
2456            return parse_and_box(data).map(Self::CheckoutSessionAsyncPaymentSucceeded);
2457        }
2458        if typ == "checkout.session.completed" {
2459            return parse_and_box(data).map(Self::CheckoutSessionCompleted);
2460        }
2461        if typ == "checkout.session.expired" {
2462            return parse_and_box(data).map(Self::CheckoutSessionExpired);
2463        }
2464        #[cfg(feature = "async-stripe-misc")]
2465        if typ == "climate.order.canceled" {
2466            return parse_and_box(data).map(Self::ClimateOrderCanceled);
2467        }
2468        #[cfg(feature = "async-stripe-misc")]
2469        if typ == "climate.order.created" {
2470            return parse_and_box(data).map(Self::ClimateOrderCreated);
2471        }
2472        #[cfg(feature = "async-stripe-misc")]
2473        if typ == "climate.order.delayed" {
2474            return parse_and_box(data).map(Self::ClimateOrderDelayed);
2475        }
2476        #[cfg(feature = "async-stripe-misc")]
2477        if typ == "climate.order.delivered" {
2478            return parse_and_box(data).map(Self::ClimateOrderDelivered);
2479        }
2480        #[cfg(feature = "async-stripe-misc")]
2481        if typ == "climate.order.product_substituted" {
2482            return parse_and_box(data).map(Self::ClimateOrderProductSubstituted);
2483        }
2484        #[cfg(feature = "async-stripe-misc")]
2485        if typ == "climate.product.created" {
2486            return parse_and_box(data).map(Self::ClimateProductCreated);
2487        }
2488        #[cfg(feature = "async-stripe-misc")]
2489        if typ == "climate.product.pricing_updated" {
2490            return parse_and_box(data).map(Self::ClimateProductPricingUpdated);
2491        }
2492        if typ == "coupon.created" {
2493            return parse_and_box(data).map(Self::CouponCreated);
2494        }
2495        if typ == "coupon.deleted" {
2496            return parse_and_box(data).map(Self::CouponDeleted);
2497        }
2498        if typ == "coupon.updated" {
2499            return parse_and_box(data).map(Self::CouponUpdated);
2500        }
2501        if typ == "credit_note.created" {
2502            return parse_and_box(data).map(Self::CreditNoteCreated);
2503        }
2504        if typ == "credit_note.updated" {
2505            return parse_and_box(data).map(Self::CreditNoteUpdated);
2506        }
2507        if typ == "credit_note.voided" {
2508            return parse_and_box(data).map(Self::CreditNoteVoided);
2509        }
2510        if typ == "customer.created" {
2511            return parse_and_box(data).map(Self::CustomerCreated);
2512        }
2513        if typ == "customer.deleted" {
2514            return parse_and_box(data).map(Self::CustomerDeleted);
2515        }
2516        if typ == "customer.discount.created" {
2517            return parse_and_box(data).map(Self::CustomerDiscountCreated);
2518        }
2519        if typ == "customer.discount.deleted" {
2520            return parse_and_box(data).map(Self::CustomerDiscountDeleted);
2521        }
2522        if typ == "customer.discount.updated" {
2523            return parse_and_box(data).map(Self::CustomerDiscountUpdated);
2524        }
2525        if typ == "customer.source.created" {
2526            return parse_and_box(data).map(Self::CustomerSourceCreated);
2527        }
2528        if typ == "customer.source.deleted" {
2529            return parse_and_box(data).map(Self::CustomerSourceDeleted);
2530        }
2531        if typ == "customer.source.expiring" {
2532            return parse_and_box(data).map(Self::CustomerSourceExpiring);
2533        }
2534        if typ == "customer.source.updated" {
2535            return parse_and_box(data).map(Self::CustomerSourceUpdated);
2536        }
2537        if typ == "customer.subscription.created" {
2538            return parse_and_box(data).map(Self::CustomerSubscriptionCreated);
2539        }
2540        if typ == "customer.subscription.deleted" {
2541            return parse_and_box(data).map(Self::CustomerSubscriptionDeleted);
2542        }
2543        if typ == "customer.subscription.paused" {
2544            return parse_and_box(data).map(Self::CustomerSubscriptionPaused);
2545        }
2546        if typ == "customer.subscription.pending_update_applied" {
2547            return parse_and_box(data).map(Self::CustomerSubscriptionPendingUpdateApplied);
2548        }
2549        if typ == "customer.subscription.pending_update_expired" {
2550            return parse_and_box(data).map(Self::CustomerSubscriptionPendingUpdateExpired);
2551        }
2552        if typ == "customer.subscription.resumed" {
2553            return parse_and_box(data).map(Self::CustomerSubscriptionResumed);
2554        }
2555        if typ == "customer.subscription.trial_will_end" {
2556            return parse_and_box(data).map(Self::CustomerSubscriptionTrialWillEnd);
2557        }
2558        if typ == "customer.subscription.updated" {
2559            return parse_and_box(data).map(Self::CustomerSubscriptionUpdated);
2560        }
2561        if typ == "customer.tax_id.created" {
2562            return parse_and_box(data).map(Self::CustomerTaxIdCreated);
2563        }
2564        if typ == "customer.tax_id.deleted" {
2565            return parse_and_box(data).map(Self::CustomerTaxIdDeleted);
2566        }
2567        if typ == "customer.tax_id.updated" {
2568            return parse_and_box(data).map(Self::CustomerTaxIdUpdated);
2569        }
2570        if typ == "customer.updated" {
2571            return parse_and_box(data).map(Self::CustomerUpdated);
2572        }
2573        if typ == "customer_cash_balance_transaction.created" {
2574            return parse_and_box(data).map(Self::CustomerCashBalanceTransactionCreated);
2575        }
2576        #[cfg(feature = "async-stripe-misc")]
2577        if typ == "entitlements.active_entitlement_summary.updated" {
2578            return parse_and_box(data).map(Self::EntitlementsActiveEntitlementSummaryUpdated);
2579        }
2580        if typ == "file.created" {
2581            return parse_and_box(data).map(Self::FileCreated);
2582        }
2583        #[cfg(feature = "async-stripe-misc")]
2584        if typ == "financial_connections.account.account_numbers_updated" {
2585            return parse_and_box(data).map(Self::FinancialConnectionsAccountAccountNumbersUpdated);
2586        }
2587        #[cfg(feature = "async-stripe-misc")]
2588        if typ == "financial_connections.account.created" {
2589            return parse_and_box(data).map(Self::FinancialConnectionsAccountCreated);
2590        }
2591        #[cfg(feature = "async-stripe-misc")]
2592        if typ == "financial_connections.account.deactivated" {
2593            return parse_and_box(data).map(Self::FinancialConnectionsAccountDeactivated);
2594        }
2595        #[cfg(feature = "async-stripe-misc")]
2596        if typ == "financial_connections.account.disconnected" {
2597            return parse_and_box(data).map(Self::FinancialConnectionsAccountDisconnected);
2598        }
2599        #[cfg(feature = "async-stripe-misc")]
2600        if typ == "financial_connections.account.reactivated" {
2601            return parse_and_box(data).map(Self::FinancialConnectionsAccountReactivated);
2602        }
2603        #[cfg(feature = "async-stripe-misc")]
2604        if typ == "financial_connections.account.refreshed_balance" {
2605            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedBalance);
2606        }
2607        #[cfg(feature = "async-stripe-misc")]
2608        if typ == "financial_connections.account.refreshed_ownership" {
2609            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedOwnership);
2610        }
2611        #[cfg(feature = "async-stripe-misc")]
2612        if typ == "financial_connections.account.refreshed_transactions" {
2613            return parse_and_box(data).map(Self::FinancialConnectionsAccountRefreshedTransactions);
2614        }
2615        #[cfg(feature = "async-stripe-misc")]
2616        if typ == "financial_connections.account.upcoming_account_number_expiry" {
2617            return parse_and_box(data)
2618                .map(Self::FinancialConnectionsAccountUpcomingAccountNumberExpiry);
2619        }
2620        #[cfg(feature = "async-stripe-misc")]
2621        if typ == "identity.verification_session.canceled" {
2622            return parse_and_box(data).map(Self::IdentityVerificationSessionCanceled);
2623        }
2624        #[cfg(feature = "async-stripe-misc")]
2625        if typ == "identity.verification_session.created" {
2626            return parse_and_box(data).map(Self::IdentityVerificationSessionCreated);
2627        }
2628        #[cfg(feature = "async-stripe-misc")]
2629        if typ == "identity.verification_session.processing" {
2630            return parse_and_box(data).map(Self::IdentityVerificationSessionProcessing);
2631        }
2632        #[cfg(feature = "async-stripe-misc")]
2633        if typ == "identity.verification_session.redacted" {
2634            return parse_and_box(data).map(Self::IdentityVerificationSessionRedacted);
2635        }
2636        #[cfg(feature = "async-stripe-misc")]
2637        if typ == "identity.verification_session.requires_input" {
2638            return parse_and_box(data).map(Self::IdentityVerificationSessionRequiresInput);
2639        }
2640        #[cfg(feature = "async-stripe-misc")]
2641        if typ == "identity.verification_session.verified" {
2642            return parse_and_box(data).map(Self::IdentityVerificationSessionVerified);
2643        }
2644        if typ == "invoice.created" {
2645            return parse_and_box(data).map(Self::InvoiceCreated);
2646        }
2647        if typ == "invoice.deleted" {
2648            return parse_and_box(data).map(Self::InvoiceDeleted);
2649        }
2650        if typ == "invoice.finalization_failed" {
2651            return parse_and_box(data).map(Self::InvoiceFinalizationFailed);
2652        }
2653        if typ == "invoice.finalized" {
2654            return parse_and_box(data).map(Self::InvoiceFinalized);
2655        }
2656        if typ == "invoice.marked_uncollectible" {
2657            return parse_and_box(data).map(Self::InvoiceMarkedUncollectible);
2658        }
2659        if typ == "invoice.overdue" {
2660            return parse_and_box(data).map(Self::InvoiceOverdue);
2661        }
2662        if typ == "invoice.overpaid" {
2663            return parse_and_box(data).map(Self::InvoiceOverpaid);
2664        }
2665        if typ == "invoice.paid" {
2666            return parse_and_box(data).map(Self::InvoicePaid);
2667        }
2668        if typ == "invoice.payment_action_required" {
2669            return parse_and_box(data).map(Self::InvoicePaymentActionRequired);
2670        }
2671        if typ == "invoice.payment_attempt_required" {
2672            return parse_and_box(data).map(Self::InvoicePaymentAttemptRequired);
2673        }
2674        if typ == "invoice.payment_failed" {
2675            return parse_and_box(data).map(Self::InvoicePaymentFailed);
2676        }
2677        if typ == "invoice.payment_succeeded" {
2678            return parse_and_box(data).map(Self::InvoicePaymentSucceeded);
2679        }
2680        if typ == "invoice.sent" {
2681            return parse_and_box(data).map(Self::InvoiceSent);
2682        }
2683        if typ == "invoice.upcoming" {
2684            return parse_and_box(data).map(Self::InvoiceUpcoming);
2685        }
2686        if typ == "invoice.updated" {
2687            return parse_and_box(data).map(Self::InvoiceUpdated);
2688        }
2689        if typ == "invoice.voided" {
2690            return parse_and_box(data).map(Self::InvoiceVoided);
2691        }
2692        if typ == "invoice.will_be_due" {
2693            return parse_and_box(data).map(Self::InvoiceWillBeDue);
2694        }
2695        if typ == "invoice_payment.paid" {
2696            return parse_and_box(data).map(Self::InvoicePaymentPaid);
2697        }
2698        #[cfg(feature = "async-stripe-billing")]
2699        if typ == "invoiceitem.created" {
2700            return parse_and_box(data).map(Self::InvoiceitemCreated);
2701        }
2702        #[cfg(feature = "async-stripe-billing")]
2703        if typ == "invoiceitem.deleted" {
2704            return parse_and_box(data).map(Self::InvoiceitemDeleted);
2705        }
2706        if typ == "issuing_authorization.created" {
2707            return parse_and_box(data).map(Self::IssuingAuthorizationCreated);
2708        }
2709        if typ == "issuing_authorization.request" {
2710            return parse_and_box(data).map(Self::IssuingAuthorizationRequest);
2711        }
2712        if typ == "issuing_authorization.updated" {
2713            return parse_and_box(data).map(Self::IssuingAuthorizationUpdated);
2714        }
2715        if typ == "issuing_card.created" {
2716            return parse_and_box(data).map(Self::IssuingCardCreated);
2717        }
2718        if typ == "issuing_card.updated" {
2719            return parse_and_box(data).map(Self::IssuingCardUpdated);
2720        }
2721        if typ == "issuing_cardholder.created" {
2722            return parse_and_box(data).map(Self::IssuingCardholderCreated);
2723        }
2724        if typ == "issuing_cardholder.updated" {
2725            return parse_and_box(data).map(Self::IssuingCardholderUpdated);
2726        }
2727        if typ == "issuing_dispute.closed" {
2728            return parse_and_box(data).map(Self::IssuingDisputeClosed);
2729        }
2730        if typ == "issuing_dispute.created" {
2731            return parse_and_box(data).map(Self::IssuingDisputeCreated);
2732        }
2733        if typ == "issuing_dispute.funds_reinstated" {
2734            return parse_and_box(data).map(Self::IssuingDisputeFundsReinstated);
2735        }
2736        if typ == "issuing_dispute.funds_rescinded" {
2737            return parse_and_box(data).map(Self::IssuingDisputeFundsRescinded);
2738        }
2739        if typ == "issuing_dispute.submitted" {
2740            return parse_and_box(data).map(Self::IssuingDisputeSubmitted);
2741        }
2742        if typ == "issuing_dispute.updated" {
2743            return parse_and_box(data).map(Self::IssuingDisputeUpdated);
2744        }
2745        if typ == "issuing_personalization_design.activated" {
2746            return parse_and_box(data).map(Self::IssuingPersonalizationDesignActivated);
2747        }
2748        if typ == "issuing_personalization_design.deactivated" {
2749            return parse_and_box(data).map(Self::IssuingPersonalizationDesignDeactivated);
2750        }
2751        if typ == "issuing_personalization_design.rejected" {
2752            return parse_and_box(data).map(Self::IssuingPersonalizationDesignRejected);
2753        }
2754        if typ == "issuing_personalization_design.updated" {
2755            return parse_and_box(data).map(Self::IssuingPersonalizationDesignUpdated);
2756        }
2757        if typ == "issuing_token.created" {
2758            return parse_and_box(data).map(Self::IssuingTokenCreated);
2759        }
2760        if typ == "issuing_token.updated" {
2761            return parse_and_box(data).map(Self::IssuingTokenUpdated);
2762        }
2763        if typ == "issuing_transaction.created" {
2764            return parse_and_box(data).map(Self::IssuingTransactionCreated);
2765        }
2766        if typ == "issuing_transaction.purchase_details_receipt_updated" {
2767            return parse_and_box(data).map(Self::IssuingTransactionPurchaseDetailsReceiptUpdated);
2768        }
2769        if typ == "issuing_transaction.updated" {
2770            return parse_and_box(data).map(Self::IssuingTransactionUpdated);
2771        }
2772        if typ == "mandate.updated" {
2773            return parse_and_box(data).map(Self::MandateUpdated);
2774        }
2775        if typ == "payment_intent.amount_capturable_updated" {
2776            return parse_and_box(data).map(Self::PaymentIntentAmountCapturableUpdated);
2777        }
2778        if typ == "payment_intent.canceled" {
2779            return parse_and_box(data).map(Self::PaymentIntentCanceled);
2780        }
2781        if typ == "payment_intent.created" {
2782            return parse_and_box(data).map(Self::PaymentIntentCreated);
2783        }
2784        if typ == "payment_intent.partially_funded" {
2785            return parse_and_box(data).map(Self::PaymentIntentPartiallyFunded);
2786        }
2787        if typ == "payment_intent.payment_failed" {
2788            return parse_and_box(data).map(Self::PaymentIntentPaymentFailed);
2789        }
2790        if typ == "payment_intent.processing" {
2791            return parse_and_box(data).map(Self::PaymentIntentProcessing);
2792        }
2793        if typ == "payment_intent.requires_action" {
2794            return parse_and_box(data).map(Self::PaymentIntentRequiresAction);
2795        }
2796        if typ == "payment_intent.succeeded" {
2797            return parse_and_box(data).map(Self::PaymentIntentSucceeded);
2798        }
2799        if typ == "payment_link.created" {
2800            return parse_and_box(data).map(Self::PaymentLinkCreated);
2801        }
2802        if typ == "payment_link.updated" {
2803            return parse_and_box(data).map(Self::PaymentLinkUpdated);
2804        }
2805        if typ == "payment_method.attached" {
2806            return parse_and_box(data).map(Self::PaymentMethodAttached);
2807        }
2808        if typ == "payment_method.automatically_updated" {
2809            return parse_and_box(data).map(Self::PaymentMethodAutomaticallyUpdated);
2810        }
2811        if typ == "payment_method.detached" {
2812            return parse_and_box(data).map(Self::PaymentMethodDetached);
2813        }
2814        if typ == "payment_method.updated" {
2815            return parse_and_box(data).map(Self::PaymentMethodUpdated);
2816        }
2817        if typ == "payout.canceled" {
2818            return parse_and_box(data).map(Self::PayoutCanceled);
2819        }
2820        if typ == "payout.created" {
2821            return parse_and_box(data).map(Self::PayoutCreated);
2822        }
2823        if typ == "payout.failed" {
2824            return parse_and_box(data).map(Self::PayoutFailed);
2825        }
2826        if typ == "payout.paid" {
2827            return parse_and_box(data).map(Self::PayoutPaid);
2828        }
2829        if typ == "payout.reconciliation_completed" {
2830            return parse_and_box(data).map(Self::PayoutReconciliationCompleted);
2831        }
2832        if typ == "payout.updated" {
2833            return parse_and_box(data).map(Self::PayoutUpdated);
2834        }
2835        if typ == "person.created" {
2836            return parse_and_box(data).map(Self::PersonCreated);
2837        }
2838        if typ == "person.deleted" {
2839            return parse_and_box(data).map(Self::PersonDeleted);
2840        }
2841        if typ == "person.updated" {
2842            return parse_and_box(data).map(Self::PersonUpdated);
2843        }
2844        if typ == "plan.created" {
2845            return parse_and_box(data).map(Self::PlanCreated);
2846        }
2847        if typ == "plan.deleted" {
2848            return parse_and_box(data).map(Self::PlanDeleted);
2849        }
2850        if typ == "plan.updated" {
2851            return parse_and_box(data).map(Self::PlanUpdated);
2852        }
2853        if typ == "price.created" {
2854            return parse_and_box(data).map(Self::PriceCreated);
2855        }
2856        if typ == "price.deleted" {
2857            return parse_and_box(data).map(Self::PriceDeleted);
2858        }
2859        if typ == "price.updated" {
2860            return parse_and_box(data).map(Self::PriceUpdated);
2861        }
2862        if typ == "product.created" {
2863            return parse_and_box(data).map(Self::ProductCreated);
2864        }
2865        if typ == "product.deleted" {
2866            return parse_and_box(data).map(Self::ProductDeleted);
2867        }
2868        if typ == "product.updated" {
2869            return parse_and_box(data).map(Self::ProductUpdated);
2870        }
2871        if typ == "promotion_code.created" {
2872            return parse_and_box(data).map(Self::PromotionCodeCreated);
2873        }
2874        if typ == "promotion_code.updated" {
2875            return parse_and_box(data).map(Self::PromotionCodeUpdated);
2876        }
2877        #[cfg(feature = "async-stripe-billing")]
2878        if typ == "quote.accepted" {
2879            return parse_and_box(data).map(Self::QuoteAccepted);
2880        }
2881        #[cfg(feature = "async-stripe-billing")]
2882        if typ == "quote.canceled" {
2883            return parse_and_box(data).map(Self::QuoteCanceled);
2884        }
2885        #[cfg(feature = "async-stripe-billing")]
2886        if typ == "quote.created" {
2887            return parse_and_box(data).map(Self::QuoteCreated);
2888        }
2889        #[cfg(feature = "async-stripe-billing")]
2890        if typ == "quote.finalized" {
2891            return parse_and_box(data).map(Self::QuoteFinalized);
2892        }
2893        #[cfg(feature = "async-stripe-fraud")]
2894        if typ == "radar.early_fraud_warning.created" {
2895            return parse_and_box(data).map(Self::RadarEarlyFraudWarningCreated);
2896        }
2897        #[cfg(feature = "async-stripe-fraud")]
2898        if typ == "radar.early_fraud_warning.updated" {
2899            return parse_and_box(data).map(Self::RadarEarlyFraudWarningUpdated);
2900        }
2901        if typ == "refund.created" {
2902            return parse_and_box(data).map(Self::RefundCreated);
2903        }
2904        if typ == "refund.failed" {
2905            return parse_and_box(data).map(Self::RefundFailed);
2906        }
2907        if typ == "refund.updated" {
2908            return parse_and_box(data).map(Self::RefundUpdated);
2909        }
2910        #[cfg(feature = "async-stripe-misc")]
2911        if typ == "reporting.report_run.failed" {
2912            return parse_and_box(data).map(Self::ReportingReportRunFailed);
2913        }
2914        #[cfg(feature = "async-stripe-misc")]
2915        if typ == "reporting.report_run.succeeded" {
2916            return parse_and_box(data).map(Self::ReportingReportRunSucceeded);
2917        }
2918        #[cfg(feature = "async-stripe-misc")]
2919        if typ == "reporting.report_type.updated" {
2920            return parse_and_box(data).map(Self::ReportingReportTypeUpdated);
2921        }
2922        #[cfg(feature = "async-stripe-reserve")]
2923        if typ == "reserve.hold.created" {
2924            return parse_and_box(data).map(Self::ReserveHoldCreated);
2925        }
2926        #[cfg(feature = "async-stripe-reserve")]
2927        if typ == "reserve.hold.updated" {
2928            return parse_and_box(data).map(Self::ReserveHoldUpdated);
2929        }
2930        #[cfg(feature = "async-stripe-reserve")]
2931        if typ == "reserve.plan.created" {
2932            return parse_and_box(data).map(Self::ReservePlanCreated);
2933        }
2934        #[cfg(feature = "async-stripe-reserve")]
2935        if typ == "reserve.plan.disabled" {
2936            return parse_and_box(data).map(Self::ReservePlanDisabled);
2937        }
2938        #[cfg(feature = "async-stripe-reserve")]
2939        if typ == "reserve.plan.expired" {
2940            return parse_and_box(data).map(Self::ReservePlanExpired);
2941        }
2942        #[cfg(feature = "async-stripe-reserve")]
2943        if typ == "reserve.plan.updated" {
2944            return parse_and_box(data).map(Self::ReservePlanUpdated);
2945        }
2946        #[cfg(feature = "async-stripe-reserve")]
2947        if typ == "reserve.release.created" {
2948            return parse_and_box(data).map(Self::ReserveReleaseCreated);
2949        }
2950        if typ == "review.closed" {
2951            return parse_and_box(data).map(Self::ReviewClosed);
2952        }
2953        if typ == "review.opened" {
2954            return parse_and_box(data).map(Self::ReviewOpened);
2955        }
2956        if typ == "setup_intent.canceled" {
2957            return parse_and_box(data).map(Self::SetupIntentCanceled);
2958        }
2959        if typ == "setup_intent.created" {
2960            return parse_and_box(data).map(Self::SetupIntentCreated);
2961        }
2962        if typ == "setup_intent.requires_action" {
2963            return parse_and_box(data).map(Self::SetupIntentRequiresAction);
2964        }
2965        if typ == "setup_intent.setup_failed" {
2966            return parse_and_box(data).map(Self::SetupIntentSetupFailed);
2967        }
2968        if typ == "setup_intent.succeeded" {
2969            return parse_and_box(data).map(Self::SetupIntentSucceeded);
2970        }
2971        #[cfg(feature = "async-stripe-misc")]
2972        if typ == "sigma.scheduled_query_run.created" {
2973            return parse_and_box(data).map(Self::SigmaScheduledQueryRunCreated);
2974        }
2975        if typ == "source.canceled" {
2976            return parse_and_box(data).map(Self::SourceCanceled);
2977        }
2978        if typ == "source.chargeable" {
2979            return parse_and_box(data).map(Self::SourceChargeable);
2980        }
2981        if typ == "source.failed" {
2982            return parse_and_box(data).map(Self::SourceFailed);
2983        }
2984        #[cfg(feature = "async-stripe-payment")]
2985        if typ == "source.mandate_notification" {
2986            return parse_and_box(data).map(Self::SourceMandateNotification);
2987        }
2988        if typ == "source.refund_attributes_required" {
2989            return parse_and_box(data).map(Self::SourceRefundAttributesRequired);
2990        }
2991        if typ == "source.transaction.created" {
2992            return parse_and_box(data).map(Self::SourceTransactionCreated);
2993        }
2994        if typ == "source.transaction.updated" {
2995            return parse_and_box(data).map(Self::SourceTransactionUpdated);
2996        }
2997        if typ == "subscription_schedule.aborted" {
2998            return parse_and_box(data).map(Self::SubscriptionScheduleAborted);
2999        }
3000        if typ == "subscription_schedule.canceled" {
3001            return parse_and_box(data).map(Self::SubscriptionScheduleCanceled);
3002        }
3003        if typ == "subscription_schedule.completed" {
3004            return parse_and_box(data).map(Self::SubscriptionScheduleCompleted);
3005        }
3006        if typ == "subscription_schedule.created" {
3007            return parse_and_box(data).map(Self::SubscriptionScheduleCreated);
3008        }
3009        if typ == "subscription_schedule.expiring" {
3010            return parse_and_box(data).map(Self::SubscriptionScheduleExpiring);
3011        }
3012        if typ == "subscription_schedule.released" {
3013            return parse_and_box(data).map(Self::SubscriptionScheduleReleased);
3014        }
3015        if typ == "subscription_schedule.updated" {
3016            return parse_and_box(data).map(Self::SubscriptionScheduleUpdated);
3017        }
3018        #[cfg(feature = "async-stripe-misc")]
3019        if typ == "tax.settings.updated" {
3020            return parse_and_box(data).map(Self::TaxSettingsUpdated);
3021        }
3022        if typ == "tax_rate.created" {
3023            return parse_and_box(data).map(Self::TaxRateCreated);
3024        }
3025        if typ == "tax_rate.updated" {
3026            return parse_and_box(data).map(Self::TaxRateUpdated);
3027        }
3028        #[cfg(feature = "async-stripe-terminal")]
3029        if typ == "terminal.reader.action_failed" {
3030            return parse_and_box(data).map(Self::TerminalReaderActionFailed);
3031        }
3032        #[cfg(feature = "async-stripe-terminal")]
3033        if typ == "terminal.reader.action_succeeded" {
3034            return parse_and_box(data).map(Self::TerminalReaderActionSucceeded);
3035        }
3036        #[cfg(feature = "async-stripe-terminal")]
3037        if typ == "terminal.reader.action_updated" {
3038            return parse_and_box(data).map(Self::TerminalReaderActionUpdated);
3039        }
3040        if typ == "test_helpers.test_clock.advancing" {
3041            return parse_and_box(data).map(Self::TestHelpersTestClockAdvancing);
3042        }
3043        if typ == "test_helpers.test_clock.created" {
3044            return parse_and_box(data).map(Self::TestHelpersTestClockCreated);
3045        }
3046        if typ == "test_helpers.test_clock.deleted" {
3047            return parse_and_box(data).map(Self::TestHelpersTestClockDeleted);
3048        }
3049        if typ == "test_helpers.test_clock.internal_failure" {
3050            return parse_and_box(data).map(Self::TestHelpersTestClockInternalFailure);
3051        }
3052        if typ == "test_helpers.test_clock.ready" {
3053            return parse_and_box(data).map(Self::TestHelpersTestClockReady);
3054        }
3055        if typ == "topup.canceled" {
3056            return parse_and_box(data).map(Self::TopupCanceled);
3057        }
3058        if typ == "topup.created" {
3059            return parse_and_box(data).map(Self::TopupCreated);
3060        }
3061        if typ == "topup.failed" {
3062            return parse_and_box(data).map(Self::TopupFailed);
3063        }
3064        if typ == "topup.reversed" {
3065            return parse_and_box(data).map(Self::TopupReversed);
3066        }
3067        if typ == "topup.succeeded" {
3068            return parse_and_box(data).map(Self::TopupSucceeded);
3069        }
3070        if typ == "transfer.created" {
3071            return parse_and_box(data).map(Self::TransferCreated);
3072        }
3073        if typ == "transfer.reversed" {
3074            return parse_and_box(data).map(Self::TransferReversed);
3075        }
3076        if typ == "transfer.updated" {
3077            return parse_and_box(data).map(Self::TransferUpdated);
3078        }
3079        #[cfg(feature = "async-stripe-treasury")]
3080        if typ == "treasury.credit_reversal.created" {
3081            return parse_and_box(data).map(Self::TreasuryCreditReversalCreated);
3082        }
3083        #[cfg(feature = "async-stripe-treasury")]
3084        if typ == "treasury.credit_reversal.posted" {
3085            return parse_and_box(data).map(Self::TreasuryCreditReversalPosted);
3086        }
3087        #[cfg(feature = "async-stripe-treasury")]
3088        if typ == "treasury.debit_reversal.completed" {
3089            return parse_and_box(data).map(Self::TreasuryDebitReversalCompleted);
3090        }
3091        #[cfg(feature = "async-stripe-treasury")]
3092        if typ == "treasury.debit_reversal.created" {
3093            return parse_and_box(data).map(Self::TreasuryDebitReversalCreated);
3094        }
3095        #[cfg(feature = "async-stripe-treasury")]
3096        if typ == "treasury.debit_reversal.initial_credit_granted" {
3097            return parse_and_box(data).map(Self::TreasuryDebitReversalInitialCreditGranted);
3098        }
3099        #[cfg(feature = "async-stripe-treasury")]
3100        if typ == "treasury.financial_account.closed" {
3101            return parse_and_box(data).map(Self::TreasuryFinancialAccountClosed);
3102        }
3103        #[cfg(feature = "async-stripe-treasury")]
3104        if typ == "treasury.financial_account.created" {
3105            return parse_and_box(data).map(Self::TreasuryFinancialAccountCreated);
3106        }
3107        #[cfg(feature = "async-stripe-treasury")]
3108        if typ == "treasury.financial_account.features_status_updated" {
3109            return parse_and_box(data).map(Self::TreasuryFinancialAccountFeaturesStatusUpdated);
3110        }
3111        #[cfg(feature = "async-stripe-treasury")]
3112        if typ == "treasury.inbound_transfer.canceled" {
3113            return parse_and_box(data).map(Self::TreasuryInboundTransferCanceled);
3114        }
3115        #[cfg(feature = "async-stripe-treasury")]
3116        if typ == "treasury.inbound_transfer.created" {
3117            return parse_and_box(data).map(Self::TreasuryInboundTransferCreated);
3118        }
3119        #[cfg(feature = "async-stripe-treasury")]
3120        if typ == "treasury.inbound_transfer.failed" {
3121            return parse_and_box(data).map(Self::TreasuryInboundTransferFailed);
3122        }
3123        #[cfg(feature = "async-stripe-treasury")]
3124        if typ == "treasury.inbound_transfer.succeeded" {
3125            return parse_and_box(data).map(Self::TreasuryInboundTransferSucceeded);
3126        }
3127        #[cfg(feature = "async-stripe-treasury")]
3128        if typ == "treasury.outbound_payment.canceled" {
3129            return parse_and_box(data).map(Self::TreasuryOutboundPaymentCanceled);
3130        }
3131        #[cfg(feature = "async-stripe-treasury")]
3132        if typ == "treasury.outbound_payment.created" {
3133            return parse_and_box(data).map(Self::TreasuryOutboundPaymentCreated);
3134        }
3135        #[cfg(feature = "async-stripe-treasury")]
3136        if typ == "treasury.outbound_payment.expected_arrival_date_updated" {
3137            return parse_and_box(data)
3138                .map(Self::TreasuryOutboundPaymentExpectedArrivalDateUpdated);
3139        }
3140        #[cfg(feature = "async-stripe-treasury")]
3141        if typ == "treasury.outbound_payment.failed" {
3142            return parse_and_box(data).map(Self::TreasuryOutboundPaymentFailed);
3143        }
3144        #[cfg(feature = "async-stripe-treasury")]
3145        if typ == "treasury.outbound_payment.posted" {
3146            return parse_and_box(data).map(Self::TreasuryOutboundPaymentPosted);
3147        }
3148        #[cfg(feature = "async-stripe-treasury")]
3149        if typ == "treasury.outbound_payment.returned" {
3150            return parse_and_box(data).map(Self::TreasuryOutboundPaymentReturned);
3151        }
3152        #[cfg(feature = "async-stripe-treasury")]
3153        if typ == "treasury.outbound_payment.tracking_details_updated" {
3154            return parse_and_box(data).map(Self::TreasuryOutboundPaymentTrackingDetailsUpdated);
3155        }
3156        #[cfg(feature = "async-stripe-treasury")]
3157        if typ == "treasury.outbound_transfer.canceled" {
3158            return parse_and_box(data).map(Self::TreasuryOutboundTransferCanceled);
3159        }
3160        #[cfg(feature = "async-stripe-treasury")]
3161        if typ == "treasury.outbound_transfer.created" {
3162            return parse_and_box(data).map(Self::TreasuryOutboundTransferCreated);
3163        }
3164        #[cfg(feature = "async-stripe-treasury")]
3165        if typ == "treasury.outbound_transfer.expected_arrival_date_updated" {
3166            return parse_and_box(data)
3167                .map(Self::TreasuryOutboundTransferExpectedArrivalDateUpdated);
3168        }
3169        #[cfg(feature = "async-stripe-treasury")]
3170        if typ == "treasury.outbound_transfer.failed" {
3171            return parse_and_box(data).map(Self::TreasuryOutboundTransferFailed);
3172        }
3173        #[cfg(feature = "async-stripe-treasury")]
3174        if typ == "treasury.outbound_transfer.posted" {
3175            return parse_and_box(data).map(Self::TreasuryOutboundTransferPosted);
3176        }
3177        #[cfg(feature = "async-stripe-treasury")]
3178        if typ == "treasury.outbound_transfer.returned" {
3179            return parse_and_box(data).map(Self::TreasuryOutboundTransferReturned);
3180        }
3181        #[cfg(feature = "async-stripe-treasury")]
3182        if typ == "treasury.outbound_transfer.tracking_details_updated" {
3183            return parse_and_box(data).map(Self::TreasuryOutboundTransferTrackingDetailsUpdated);
3184        }
3185        #[cfg(feature = "async-stripe-treasury")]
3186        if typ == "treasury.received_credit.created" {
3187            return parse_and_box(data).map(Self::TreasuryReceivedCreditCreated);
3188        }
3189        #[cfg(feature = "async-stripe-treasury")]
3190        if typ == "treasury.received_credit.failed" {
3191            return parse_and_box(data).map(Self::TreasuryReceivedCreditFailed);
3192        }
3193        #[cfg(feature = "async-stripe-treasury")]
3194        if typ == "treasury.received_credit.succeeded" {
3195            return parse_and_box(data).map(Self::TreasuryReceivedCreditSucceeded);
3196        }
3197        #[cfg(feature = "async-stripe-treasury")]
3198        if typ == "treasury.received_debit.created" {
3199            return parse_and_box(data).map(Self::TreasuryReceivedDebitCreated);
3200        }
3201
3202        // Unknown event type - error instead of silently accepting
3203        Err(format!("unknown event type '{typ}'"))
3204    }
3205}