paddle_rust_sdk/
enums.rs

1//! This module contains enums used in the Paddle API.
2
3#![allow(clippy::upper_case_acronyms, clippy::enum_variant_names)]
4
5use serde::{Deserialize, Serialize};
6
7use crate::reports::ReportType;
8
9#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[non_exhaustive]
11pub enum CountryCodeSupported {
12    /// Andorra
13    AD,
14    /// United Arab Emirates
15    AE,
16    /// Antigua and Barbuda
17    AG,
18    /// Anguilla
19    AI,
20    /// Albania
21    AL,
22    /// Armenia
23    AM,
24    /// Angola
25    AO,
26    /// Argentina
27    AR,
28    /// American Samoa
29    AS,
30    /// Austria
31    AT,
32    /// Australia
33    AU,
34    /// Aruba
35    AW,
36    /// Åland Islands
37    AX,
38    /// Azerbaijan
39    AZ,
40    /// Bosnia and Herzegovina
41    BA,
42    /// Barbados
43    BB,
44    /// Bangladesh
45    BD,
46    /// Belgium
47    BE,
48    /// Burkina Faso
49    BF,
50    /// Bulgaria
51    BG,
52    /// Bahrain
53    BH,
54    /// Burundi
55    BI,
56    /// Benin
57    BJ,
58    /// Saint Barthélemy
59    BL,
60    /// Bermuda
61    BM,
62    /// Brunei
63    BN,
64    /// Bolivia
65    BO,
66    /// Caribbean Netherlands (Bonaire, Sint Eustatius, and Saba)
67    BQ,
68    /// Brazil
69    BR,
70    /// Bahamas
71    BS,
72    /// Bhutan
73    BT,
74    /// Bouvet Island
75    BV,
76    /// Botswana
77    BW,
78    /// Belize
79    BZ,
80    /// Canada
81    CA,
82    /// Cocos Islands
83    CC,
84    /// Republic of Congo
85    CG,
86    /// Switzerland
87    CH,
88    /// Côte d'Ivoire (Ivory Coast)
89    CI,
90    /// Cook Islands
91    CK,
92    /// Chile
93    CL,
94    /// Cameroon
95    CM,
96    /// China
97    CN,
98    /// Colombia
99    CO,
100    /// Costa Rica
101    CR,
102    /// Cape Verde
103    CV,
104    /// Curaçao
105    CW,
106    /// Christmas Island
107    CX,
108    /// Cyprus
109    CY,
110    /// Czechia (Czech Republic)
111    CZ,
112    /// Germany
113    DE,
114    /// Djibouti
115    DJ,
116    /// Denmark
117    DK,
118    /// Dominica
119    DM,
120    /// Dominican Republic
121    DO,
122    /// Algeria
123    DZ,
124    /// Ecuador
125    EC,
126    /// Estonia
127    EE,
128    /// Egypt
129    EG,
130    /// Western Sahara
131    EH,
132    /// Eritrea
133    ER,
134    /// Spain
135    ES,
136    /// Ethiopia
137    ET,
138    /// Finland
139    FI,
140    /// Fiji
141    FJ,
142    /// Falkland Islands
143    FK,
144    /// Micronesia
145    FM,
146    /// Faroe Islands
147    FO,
148    /// France
149    FR,
150    /// Gabon
151    GA,
152    /// United Kingdom
153    GB,
154    /// Grenada
155    GD,
156    /// Georgia
157    GE,
158    /// French Guiana
159    GF,
160    /// Guernsey
161    GG,
162    /// Ghana
163    GH,
164    /// Gibraltar
165    GI,
166    /// Greenland
167    GL,
168    /// Gambia
169    GM,
170    /// Guinea
171    GN,
172    /// Guadeloupe
173    GP,
174    /// Equatorial Guinea
175    GQ,
176    /// Greece
177    GR,
178    /// South Georgia and the South Sandwich Islands
179    GS,
180    /// Guatemala
181    GT,
182    /// Guam
183    GU,
184    /// Guinea-Bissau
185    GW,
186    /// Guyana
187    GY,
188    /// Hong Kong
189    HK,
190    /// Heard Island and McDonald Islands
191    HM,
192    /// Honduras
193    HN,
194    /// Croatia
195    HR,
196    /// Hungary
197    HU,
198    /// Indonesia
199    ID,
200    /// Ireland
201    IE,
202    /// Israel
203    IL,
204    /// Isle of Man
205    IM,
206    /// India
207    IN,
208    /// British Indian Ocean Territory
209    IO,
210    /// Iraq
211    IQ,
212    /// Iceland
213    IS,
214    /// Italy
215    IT,
216    /// Jersey
217    JE,
218    /// Jamaica
219    JM,
220    /// Jordan
221    JO,
222    /// Japan
223    JP,
224    /// Kenya
225    KE,
226    /// Kyrgyzstan
227    KG,
228    /// Cambodia
229    KH,
230    /// Kiribati
231    KI,
232    /// Comoros
233    KM,
234    /// Saint Kitts and Nevis
235    KN,
236    /// South Korea
237    KR,
238    /// Kuwait
239    KW,
240    /// Cayman Islands
241    KY,
242    /// Kazakhstan
243    KZ,
244    /// Lao People's Democratic Republic (Laos)
245    LA,
246    /// Lebanon
247    LB,
248    /// Saint Lucia
249    LC,
250    /// Liechtenstein
251    LI,
252    /// Sri Lanka
253    LK,
254    /// Liberia
255    LR,
256    /// Lesotho
257    LS,
258    /// Lithuania
259    LT,
260    /// Luxembourg
261    LU,
262    /// Latvia
263    LV,
264    /// Morocco
265    MA,
266    /// Monaco
267    MC,
268    /// Moldova
269    MD,
270    /// Montenegro
271    ME,
272    /// Saint Martin
273    MF,
274    /// Madagascar
275    MG,
276    /// Marshall Islands
277    MH,
278    /// Macedonia
279    MK,
280    /// Mongolia
281    MN,
282    /// Macao
283    MO,
284    /// Northern Mariana Islands
285    MP,
286    /// Martinique
287    MQ,
288    /// Mauritania
289    MR,
290    /// Montserrat
291    MS,
292    /// Malta
293    MT,
294    /// Mauritius
295    MU,
296    /// Maldives
297    MV,
298    /// Malawi
299    MW,
300    /// Mexico
301    MX,
302    /// Malaysia
303    MY,
304    /// Mozambique
305    MZ,
306    /// Namibia
307    NA,
308    /// New Caledonia
309    NC,
310    /// Niger
311    NE,
312    /// Norfolk Island
313    NF,
314    /// Nigeria
315    NG,
316    /// Netherlands
317    NL,
318    /// Norway
319    NO,
320    /// Nepal
321    NP,
322    /// Nauru
323    NR,
324    /// Niue
325    NU,
326    /// New Zealand
327    NZ,
328    /// Oman
329    OM,
330    /// Panama
331    PA,
332    /// Peru
333    PE,
334    /// French Polynesia
335    PF,
336    /// Papua New Guinea
337    PG,
338    /// Philippines
339    PH,
340    /// Pakistan
341    PK,
342    /// Poland
343    PL,
344    /// Saint Pierre and Miquelon
345    PM,
346    /// Pitcairn
347    PN,
348    /// Puerto Rico
349    PR,
350    /// Palestinian territories
351    PS,
352    /// Portugal
353    PT,
354    /// Palau
355    PW,
356    /// Paraguay
357    PY,
358    /// Qatar
359    QA,
360    /// Reunion
361    RE,
362    /// Romania
363    RO,
364    /// Republic of Serbia
365    RS,
366    /// Rwanda
367    RW,
368    /// Saudi Arabia
369    SA,
370    /// Solomon Islands
371    SB,
372    /// Seychelles
373    SC,
374    /// Sweden
375    SE,
376    /// Singapore
377    SG,
378    /// Saint Helena
379    SH,
380    /// Slovenia
381    SI,
382    /// Svalbard and Jan Mayen
383    SJ,
384    /// Slovakia
385    SK,
386    /// Sierra Leone
387    SL,
388    /// San Marino
389    SM,
390    /// Senegal
391    SN,
392    /// Suriname
393    SR,
394    /// São Tomé and Príncipe
395    ST,
396    /// El Salvador
397    SV,
398    /// Sint Maarten
399    SX,
400    /// Swaziland
401    SZ,
402    /// Turks and Caicos Islands
403    TC,
404    /// Chad
405    TD,
406    /// French Southern and Antarctic Lands
407    TF,
408    /// Togo
409    TG,
410    /// Thailand
411    TH,
412    /// Tajikistan
413    TJ,
414    /// Tokelau
415    TK,
416    /// Timor-Leste
417    TL,
418    /// Turkmenistan
419    TM,
420    /// Tunisia
421    TN,
422    /// Tonga
423    TO,
424    /// Turkey
425    TR,
426    /// Trinidad and Tobago
427    TT,
428    /// Tuvalu
429    TV,
430    /// Taiwan
431    TW,
432    /// Tanzania
433    TZ,
434    /// Ukraine
435    UA,
436    /// Uganda
437    UG,
438    /// United States Minor Outlying Islands
439    UM,
440    /// United States
441    US,
442    /// Uruguay
443    UY,
444    /// Uzbekistan
445    UZ,
446    /// Holy See (Vatican City)
447    VA,
448    /// Saint Vincent and the Grenadines
449    VC,
450    /// British Virgin Islands
451    VG,
452    /// U.S. Virgin Islands
453    VI,
454    /// Vietnam
455    VN,
456    /// Vanuatu
457    VU,
458    /// Wallis and Futuna
459    WF,
460    /// Samoa
461    WS,
462    /// Kosovo
463    XK,
464    /// Mayotte
465    YT,
466    /// South Africa
467    ZA,
468    /// Zambia
469    ZM,
470}
471
472/// Whether this entity can be used in Paddle.
473#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
474#[non_exhaustive]
475#[serde(rename_all = "kebab-case")]
476pub enum Status {
477    /// Entity is active and can be used.
478    Active,
479    /// Entity is archived, so can't be used.
480    Archived,
481}
482
483/// How this adjustment impacts the related transaction.
484#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
485#[non_exhaustive]
486#[serde(rename_all = "snake_case")]
487pub enum AdjustmentAction {
488    /// Credits some or all the related transaction.
489    Credit,
490    /// Refunds some or all the related transaction. Must be approved by Paddle in most cases.
491    Refund,
492    /// Chargeback for the related transaction. Automatically created by Paddle when a customer successfully disputes a charge.
493    Chargeback,
494    /// Reversal of a chargeback for the related transaction. Automatically created by Paddle when Paddle contests a chargeback successfully.
495    ChargebackReverse,
496    /// Warning of an upcoming chargeback for the related transaction. Automatically created by Paddle.
497    ChargebackWarning,
498    /// Reversal of a credit for the related transaction. Automatically created by Paddle.
499    CreditReverse,
500}
501
502/// Type of adjustment. Use `full` to adjust the grand total for the related transaction. Include an `items` array when creating a `partial` adjustment. If omitted, defaults to `partial`.
503#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
504#[non_exhaustive]
505#[serde(rename_all = "lowercase")]
506pub enum AdjustmentType {
507    /// The grand total for the related transaction is adjusted.
508    Full,
509    /// Some line items for the related transaction are adjusted. Requires `items`.
510    Partial,
511}
512
513/// Supported three-letter ISO 4217 currency code.
514#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
515#[non_exhaustive]
516pub enum CurrencyCode {
517    /// United States Dollar
518    USD,
519    /// Euro
520    EUR,
521    /// Pound Sterling
522    GBP,
523    /// Japanese Yen
524    JPY,
525    /// Australian Dollar
526    AUD,
527    /// Canadian Dollar
528    CAD,
529    /// Swiss Franc
530    CHF,
531    /// Hong Kong Dollar
532    HKD,
533    /// Singapore Dollar
534    SGD,
535    /// Swedish Krona
536    SEK,
537    /// Argentine Peso
538    ARS,
539    /// Brazilian Real
540    BRL,
541    /// Chinese Yuan
542    CNY,
543    /// Colombian Peso
544    COP,
545    /// Czech Koruna
546    CZK,
547    /// Danish Krone
548    DKK,
549    /// Hungarian Forint
550    HUF,
551    /// Israeli Shekel
552    ILS,
553    /// Indian Rupee
554    INR,
555    /// South Korean Won
556    KRW,
557    /// Mexican Peso
558    MXN,
559    /// Norwegian Krone
560    NOK,
561    /// New Zealand Dollar
562    NZD,
563    /// Polish Zloty
564    PLN,
565    /// Russian Ruble
566    RUB,
567    /// Thai Baht
568    THB,
569    /// Turkish Lira
570    TRY,
571    /// New Taiwan Dollar
572    TWD,
573    /// Ukrainian Hryvnia
574    UAH,
575    /// Vietnamese Dong
576    VND,
577    /// South African Rand
578    ZAR,
579}
580
581/// Status of this adjustment. Set automatically by Paddle.
582///
583/// Most refunds for live accounts are created with the status of `pending_approval` until reviewed by Paddle, but some are automatically approved. For sandbox accounts, Paddle automatically approves refunds every ten minutes.
584///
585/// Credit adjustments don't require approval from Paddle, so they're created as `approved`.
586#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
587#[non_exhaustive]
588#[serde(rename_all = "snake_case")]
589pub enum AdjustmentStatus {
590    /// Adjustment is pending approval by Paddle. Most refunds for live accounts must be approved by Paddle.
591    PendingApproval,
592    /// Adjustment is approved. Default for credits. Set when Paddle approves a refund that was `pending_approval`.
593    Approved,
594    /// Adjustment has been rejected. Set when Paddle rejects a refund that was `pending_approval`.
595    Rejected,
596    /// Adjustment has been reversed. Set by Paddle when a `chargeback_reversal` or `credit_reversal` adjustment is created for this adjustment.
597    Reversed,
598}
599
600/// Three-letter ISO 4217 currency code for chargeback fees.
601#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
602#[non_exhaustive]
603pub enum CurrencyCodeChargebacks {
604    /// Australian Dollar
605    AUD,
606    /// Canadian Dollar
607    CAD,
608    /// Euro
609    EUR,
610    /// Pound Sterling
611    GBP,
612    /// United States Dollar
613    USD,
614}
615
616/// Supported three-letter ISO 4217 currency code for payouts from Paddle.
617#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
618#[non_exhaustive]
619pub enum CurrencyCodePayouts {
620    /// Australian Dollar
621    AUD,
622    /// Canadian Dollar
623    CAD,
624    /// Swiss Franc
625    CHF,
626    /// Chinese Yuan
627    CNY,
628    /// Czech Koruna
629    CZK,
630    /// Danish Krone
631    DKK,
632    /// Euro
633    EUR,
634    /// Pound Sterling
635    GBP,
636    /// Hungarian Forint
637    HUF,
638    /// Polish Zloty
639    PLN,
640    /// Swedish Krona
641    SEK,
642    /// United States Dollar
643    USD,
644    /// South African Rand
645    ZAR,
646}
647
648/// Type of adjustment for this transaction item. `tax` adjustments are automatically created by Paddle.
649/// Include `amount` when creating a `partial` adjustment.
650#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
651#[non_exhaustive]
652#[serde(rename_all = "lowercase")]
653pub enum AdjustmentItemType {
654    /// Full total for this transaction item is adjusted.
655    Full,
656    /// Part of this transaction item is adjusted. Include `amount` to specify the partial amount adjusted.
657    Partial,
658    /// Tax for this transaction item is adjusted. Created automatically by Paddle.
659    Tax,
660    /// A prorated amount for this transaction item is adjusted. Created automatically by Paddle in some cases when making changes to a subscription.
661    Proration,
662}
663
664/// Unit of time.
665#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
666#[non_exhaustive]
667#[serde(rename_all = "kebab-case")]
668pub enum Interval {
669    Day,
670    Week,
671    Month,
672    Year,
673}
674
675/// Type of credit or debit card used to pay.
676#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
677#[non_exhaustive]
678#[serde(rename_all = "snake_case")]
679pub enum CardType {
680    /// American Express
681    AmericanExpress,
682    /// Diners Club
683    DinersClub,
684    /// Discover Card
685    Discover,
686    /// JCB Card, popular in Japan
687    Jcb,
688    /// Mada Card, popular in Saudi Arabia
689    Mada,
690    /// Maestro (debit card)
691    Maestro,
692    /// Mastercard
693    Mastercard,
694    /// UnionPay, popular in China
695    UnionPay,
696    /// Card type unknown
697    Unknown,
698    /// Visa
699    Visa,
700}
701
702/// Type of item. Standard items are considered part of your catalog and are shown on the Paddle dashboard.
703#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
704#[non_exhaustive]
705#[serde(rename_all = "kebab-case")]
706pub enum CatalogType {
707    /// Non-catalog item. Typically created for a specific transaction or subscription. Not returned when listing or shown in the Paddle dashboard.
708    Custom,
709    /// Standard item. Can be considered part of your catalog and reused across transactions and subscriptions easily.
710    Standard,
711}
712
713/// How payment is collected. `automatic` for checkout, `manual` for invoices.
714#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
715#[non_exhaustive]
716#[serde(rename_all = "snake_case")]
717pub enum CollectionMode {
718    /// Payment is collected automatically using a checkout initially, then using a payment method on file.
719    Automatic,
720    /// Payment is collected manually. Customers are sent an invoice with payment terms and can make a payment offline or using a checkout. Requires `billing_details`.
721    Manual,
722}
723
724/// Type of payment method saved.
725#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
726#[non_exhaustive]
727#[serde(rename_all = "snake_case")]
728pub enum SavedPaymentMethodType {
729    /// Alipay, popular in China.
730    Alipay,
731    /// Apple Pay on a supported Apple device.
732    ApplePay,
733    /// Credit or debit card.
734    Card,
735    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
736    GooglePay,
737    /// PayPal.
738    Paypal,
739}
740
741/// Describes how this payment method was saved.
742#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
743#[non_exhaustive]
744#[serde(rename_all = "snake_case")]
745pub enum PaymentMethodOrigin {
746    /// The customer chose to save this payment method while purchasing a one-time item.
747    SavedDuringPurchase,
748    /// The customer purchased a subscription, so this payment method was saved for future purchases.
749    Subscription,
750}
751
752/// Whether this entity can be used in Paddle.
753#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
754#[non_exhaustive]
755#[serde(rename_all = "kebab-case")]
756pub enum DiscountStatus {
757    /// Entity is active and can be used.
758    Active,
759    /// Entity is archived, so can't be used.
760    Archived,
761}
762
763/// Type of discount. Determines how this discount impacts the checkout or transaction total.
764#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
765#[non_exhaustive]
766#[serde(rename_all = "snake_case")]
767pub enum DiscountType {
768    /// Discounts a checkout or transaction by a flat amount, for example -$100. Requires `currency_code`.
769    Flat,
770    /// Discounts a checkout or transaction by a flat amount per unit, for example -$100 per user. Requires `currency_code`.
771    FlatPerSeat,
772    /// Discounts a checkout or transaction by a percentage of the total, for example -10%. Maximum 100%.
773    Percentage,
774}
775
776/// When this subscription change should take effect from. Defaults to `next_billing_period`, which creates a
777/// `scheduled_change` to apply the subscription change at the end of the billing period.
778#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
779#[non_exhaustive]
780#[serde(rename_all = "snake_case")]
781pub enum EffectiveFrom {
782    /// Takes effect on the next billing period.
783    NextBillingPeriod,
784    /// Takes effect immediately.
785    Immediately,
786}
787
788/// Type of error encountered.
789#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
790#[non_exhaustive]
791pub enum Type {
792    /// Typically means there's a problem with the request that you made.
793    RequestError,
794    /// Typically means there's a problem with the Paddle API.
795    ApiError,
796}
797
798/// Reason why a payment attempt failed. Returns `null` if payment captured successfully.
799#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
800#[non_exhaustive]
801#[serde(rename_all = "snake_case")]
802pub enum ErrorCode {
803    /// Cancellation not possible because the amount has already been canceled. Not typically returned for payments.
804    AlreadyCanceled,
805    /// Refund is not possible because the amount has already been refunded. Not typically returned for payments.
806    AlreadyRefunded,
807    /// Payment required a 3DS2 authentication challenge. The customer completed the challenge but was not successful.
808    AuthenticationFailed,
809    /// Payment method issuer has indicated that the card cannot be used as it is frozen, lost, damaged, or stolen.
810    BlockedCard,
811    /// Customer has requested that the mandate for recurring payments be canceled.
812    Canceled,
813    /// Payment method has been declined, with no other information returned.
814    Declined,
815    /// Payment method has been declined, and the issuer has indicated that it should not be retried. This could mean the account is closed or the customer revoked authorization to charge the payment method.
816    DeclinedNotRetryable,
817    /// Payment method issuer has indicated that this card is expired. Expired cards may also return `invalid_payment_details`, depending on how a payment is routed.
818    ExpiredCard,
819    /// Payment method issuer or payment service provider flagged this payment as potentially fraudulent.
820    Fraud,
821    /// Payment method issuer or payment service provider cannot process a payment that is this high or low.
822    InvalidAmount,
823    /// Payment service provider has indicated the payment method isn't valid. This typically means that it's expired. `expired_card` is returned by the payment method issuer, rather than the payment service provider.
824    InvalidPaymentDetails,
825    /// Payment service provider couldn't reach the payment method issuer.
826    IssuerUnavailable,
827    /// Payment method declined because of insufficient funds, or fund limits being reached.
828    NotEnoughBalance,
829    /// Payment method has been declined because the network scheme that the customer selected isn't supported by the payment service provider.
830    PreferredNetworkNotSupported,
831    /// Something went wrong with the payment service provider, with no other information returned.
832    PspError,
833    /// Payment service provider didn't receive payment method information as they've been redacted.
834    RedactedPaymentMethod,
835    /// Something went wrong with the Paddle platform. Try again later, or check status.paddle.com.
836    SystemError,
837    /// Payment method issuer doesn't allow this kind of payment because of limits on the account, or legal or compliance reasons.
838    TransactionNotPermitted,
839    /// Payment attempt unsuccessful, with no other information returned.
840    Unknown,
841}
842
843/// Type of event sent by Paddle, in the format `entity.event_type`.
844#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
845#[non_exhaustive]
846pub enum EventTypeName {
847    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
848    AddressCreated,
849    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
850    AddressImported,
851    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
852    AddressUpdated,
853    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
854    AdjustmentCreated,
855    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
856    AdjustmentUpdated,
857    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
858    BusinessCreated,
859    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
860    BusinessImported,
861    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
862    BusinessUpdated,
863    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
864    CustomerCreated,
865    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
866    CustomerImported,
867    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
868    CustomerUpdated,
869    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
870    DiscountCreated,
871    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
872    DiscountImported,
873    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
874    DiscountUpdated,
875    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
876    PayoutCreated,
877    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
878    PayoutPaid,
879    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
880    PriceCreated,
881    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
882    PriceImported,
883    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
884    PriceUpdated,
885    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
886    ProductCreated,
887    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
888    ProductImported,
889    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-updated) event.
890    ProductUpdated,
891    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
892    ReportCreated,
893    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
894    ReportUpdated,
895    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
896    SubscriptionActivated,
897    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
898    SubscriptionCanceled,
899    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
900    SubscriptionCreated,
901    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
902    SubscriptionImported,
903    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
904    SubscriptionPastDue,
905    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
906    SubscriptionPaused,
907    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
908    SubscriptionResumed,
909    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
910    SubscriptionTrialing,
911    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
912    SubscriptionUpdated,
913    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
914    TransactionBilled,
915    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
916    TransactionCanceled,
917    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
918    TransactionCompleted,
919    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
920    TransactionCreated,
921    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
922    TransactionPaid,
923    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
924    TransactionPastDue,
925    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
926    TransactionPaymentFailed,
927    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
928    TransactionReady,
929    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
930    TransactionUpdated,
931}
932
933/// Type of event sent by Paddle along with it's corresponding entity data
934#[allow(clippy::large_enum_variant)]
935#[derive(Clone, Debug, Serialize, Deserialize)]
936#[serde(tag = "event_type", content = "data")]
937pub enum EventData {
938    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
939    #[serde(rename = "address.created")]
940    AddressCreated(crate::entities::Address),
941    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
942    #[serde(rename = "address.imported")]
943    AddressImported(crate::entities::Address),
944    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
945    #[serde(rename = "address.updated")]
946    AddressUpdated(crate::entities::Address),
947    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
948    #[serde(rename = "adjustment.created")]
949    AdjustmentCreated(crate::entities::Adjustment),
950    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
951    #[serde(rename = "adjustment.updated")]
952    AdjustmentUpdated(crate::entities::Adjustment),
953    /// A [`api_key.created`](https://developer.paddle.com/webhooks/api-keys/api-key-created) event.
954    #[serde(rename = "api_key.created")]
955    ApiKeyCreated(crate::entities::ApiKey),
956    /// A [`api_key.updated`](https://developer.paddle.com/webhooks/api-keys/api-key-updated) event.
957    #[serde(rename = "api_key.updated")]
958    ApiKeyUpdated(crate::entities::ApiKey),
959    /// A [`api_key.expiring`](https://developer.paddle.com/webhooks/api-keys/api-key-expiring) event.
960    #[serde(rename = "api_key.expiring")]
961    ApiKeyExpiring(crate::entities::ApiKey),
962    /// A [`api_key.expired`](https://developer.paddle.com/webhooks/api-keys/api-key-expired) event.
963    #[serde(rename = "api_key.expired")]
964    ApiKeyExpired(crate::entities::ApiKey),
965    /// A [`api_key.revoked`](https://developer.paddle.com/webhooks/api-keys/api-key-revoked) event.
966    #[serde(rename = "api_key.revoked")]
967    ApiKeyRevoked(crate::entities::ApiKey),
968    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
969    #[serde(rename = "business.created")]
970    BusinessCreated(crate::entities::Business),
971    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
972    #[serde(rename = "business.imported")]
973    BusinessImported(crate::entities::Business),
974    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
975    #[serde(rename = "business.updated")]
976    BusinessUpdated(crate::entities::Business),
977    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
978    #[serde(rename = "customer.created")]
979    CustomerCreated(crate::entities::Customer),
980    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
981    #[serde(rename = "customer.imported")]
982    CustomerImported(crate::entities::Customer),
983    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
984    #[serde(rename = "customer.updated")]
985    CustomerUpdated(crate::entities::Customer),
986    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
987    #[serde(rename = "discount.created")]
988    DiscountCreated(crate::entities::Discount),
989    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
990    #[serde(rename = "discount.imported")]
991    DiscountImported(crate::entities::Discount),
992    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
993    #[serde(rename = "discount.updated")]
994    DiscountUpdated(crate::entities::Discount),
995    /// A [`payment_method.saved`](https://developer.paddle.com/webhooks/payment-methods/payment-method-saved) event.
996    #[serde(rename = "payment_method.saved")]
997    PaymentMethodSaved(crate::entities::PaymentMethod),
998    /// A [`payment_method.deleted`](https://developer.paddle.com/webhooks/payment-methods/payment-method-deleted) event.
999    #[serde(rename = "payment_method.deleted")]
1000    PaymentMethodDeleted(crate::entities::PaymentMethod),
1001    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
1002    #[serde(rename = "payout.created")]
1003    PayoutCreated(crate::entities::Payout),
1004    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
1005    #[serde(rename = "payout.paid")]
1006    PayoutPaid(crate::entities::Payout),
1007    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
1008    #[serde(rename = "price.created")]
1009    PriceCreated(crate::entities::Price),
1010    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
1011    #[serde(rename = "price.imported")]
1012    PriceImported(crate::entities::Price),
1013    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
1014    #[serde(rename = "price.updated")]
1015    PriceUpdated(crate::entities::Price),
1016    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
1017    #[serde(rename = "product.created")]
1018    ProductCreated(crate::entities::Product),
1019    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
1020    #[serde(rename = "product.imported")]
1021    ProductImported(crate::entities::Product),
1022    /// A [`product.updated`](https://developer.paddle.com/webhooks/products/product-updated) event.
1023    #[serde(rename = "product.updated")]
1024    ProductUpdated(crate::entities::Product),
1025    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
1026    #[serde(rename = "report.created")]
1027    ReportCreated(crate::entities::ReportBase),
1028    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
1029    #[serde(rename = "report.updated")]
1030    ReportUpdated(crate::entities::ReportBase),
1031    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
1032    #[serde(rename = "subscription.activated")]
1033    SubscriptionActivated(crate::entities::Subscription),
1034    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
1035    #[serde(rename = "subscription.canceled")]
1036    SubscriptionCanceled(crate::entities::Subscription),
1037    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
1038    #[serde(rename = "subscription.created")]
1039    SubscriptionCreated(crate::entities::Subscription),
1040    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
1041    #[serde(rename = "subscription.imported")]
1042    SubscriptionImported(crate::entities::Subscription),
1043    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
1044    #[serde(rename = "subscription.past_due")]
1045    SubscriptionPastDue(crate::entities::Subscription),
1046    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
1047    #[serde(rename = "subscription.paused")]
1048    SubscriptionPaused(crate::entities::Subscription),
1049    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
1050    #[serde(rename = "subscription.resumed")]
1051    SubscriptionResumed(crate::entities::Subscription),
1052    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
1053    #[serde(rename = "subscription.trialing")]
1054    SubscriptionTrialing(crate::entities::Subscription),
1055    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
1056    #[serde(rename = "subscription.updated")]
1057    SubscriptionUpdated(crate::entities::Subscription),
1058    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
1059    #[serde(rename = "transaction.billed")]
1060    TransactionBilled(crate::entities::Transaction),
1061    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
1062    #[serde(rename = "transaction.canceled")]
1063    TransactionCanceled(crate::entities::Transaction),
1064    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
1065    #[serde(rename = "transaction.completed")]
1066    TransactionCompleted(crate::entities::Transaction),
1067    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
1068    #[serde(rename = "transaction.created")]
1069    TransactionCreated(crate::entities::Transaction),
1070    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
1071    #[serde(rename = "transaction.paid")]
1072    TransactionPaid(crate::entities::Transaction),
1073    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
1074    #[serde(rename = "transaction.past_due")]
1075    TransactionPastDue(crate::entities::Transaction),
1076    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
1077    #[serde(rename = "transaction.payment_failed")]
1078    TransactionPaymentFailed(crate::entities::Transaction),
1079    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
1080    #[serde(rename = "transaction.ready")]
1081    TransactionReady(crate::entities::Transaction),
1082    /// A [`transaction.revised`](https://developer.paddle.com/webhooks/transactions/transaction-revised) event.
1083    #[serde(rename = "transaction.revised")]
1084    TransactionRevised(crate::entities::Transaction),
1085    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
1086    #[serde(rename = "transaction.updated")]
1087    TransactionUpdated(crate::entities::Transaction),
1088}
1089
1090/// Status of this subscription item. Set automatically by Paddle.
1091#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1092#[non_exhaustive]
1093#[serde(rename_all = "lowercase")]
1094pub enum SubscriptionItemStatus {
1095    /// This item is active. It is not in trial and Paddle bills for it.
1096    Active,
1097    /// This item is not active. Set when the related subscription is paused.
1098    Inactive,
1099    /// This item is in trial. Paddle has not billed for it.
1100    Trialing,
1101}
1102
1103/// How tax is calculated for this price.
1104#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1105#[non_exhaustive]
1106#[serde(rename_all = "snake_case")]
1107pub enum TaxMode {
1108    /// Prices use the setting from your account.
1109    AccountSetting,
1110    /// Prices are exclusive of tax.
1111    External,
1112    /// Prices are inclusive of tax.
1113    Internal,
1114}
1115
1116/// Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
1117#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1118#[non_exhaustive]
1119#[serde(rename_all = "kebab-case")]
1120pub enum TaxCategory {
1121    /// Non-customizable digital files or media (not software) acquired with an up front payment that can be accessed without any physical product being delivered.
1122    DigitalGoods,
1123    /// Digital books and educational material which is sold with permanent rights for use by the customer.
1124    Ebooks,
1125    /// Remote configuration, set-up, and integrating software on behalf of a customer.
1126    ImplementationServices,
1127    /// Services that involve the application of your expertise and specialized knowledge of a software product.
1128    ProfessionalServices,
1129    /// Products that allow users to connect to and use online or cloud-based applications over the Internet.
1130    Saas,
1131    /// Services that can be used to customize and white label software products.
1132    SoftwareProgrammingServices,
1133    /// Software products that are pre-written and can be downloaded and installed onto a local device.
1134    Standard,
1135    /// Training and education services related to software products.
1136    TrainingServices,
1137    /// Cloud storage service for personal or corporate information, assets, or intellectual property.
1138    WebsiteHosting,
1139}
1140
1141impl AsRef<str> for TaxCategory {
1142    fn as_ref(&self) -> &str {
1143        match self {
1144            Self::DigitalGoods => "digital-goods",
1145            Self::Ebooks => "ebooks",
1146            Self::ImplementationServices => "implementation-services",
1147            Self::ProfessionalServices => "professional-services",
1148            Self::Saas => "saas",
1149            Self::SoftwareProgrammingServices => "software-programming-services",
1150            Self::Standard => "standard",
1151            Self::TrainingServices => "training-services",
1152            Self::WebsiteHosting => "website-hosting",
1153        }
1154    }
1155}
1156
1157/// Type of payment method used for this payment attempt.
1158#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1159#[non_exhaustive]
1160#[serde(rename_all = "snake_case")]
1161pub enum PaymentMethodType {
1162    /// Alipay, popular in China.
1163    Alipay,
1164    /// Apple Pay on a supported Apple device.
1165    ApplePay,
1166    /// Bancontact, popular in Belgium.
1167    Bancontact,
1168    /// Credit or debit card.
1169    Card,
1170    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
1171    GooglePay,
1172    /// iDEAL, popular in the Netherlands.
1173    Ideal,
1174    /// Payment recorded offline.
1175    Offline,
1176    /// PayPal.
1177    Paypal,
1178    /// Payment method not known.
1179    Unknown,
1180    /// Wire transfer, sometimes called bank transfer.
1181    WireTransfer,
1182}
1183
1184/// Status of this notification.
1185#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1186#[non_exhaustive]
1187pub enum NotificationStatus {
1188    /// Paddle hasn't yet tried to deliver this notification.
1189    NotAttempted,
1190    /// Paddle tried to deliver this notification, but it failed. It's scheduled to be retried.
1191    NeedsRetry,
1192    /// Paddle delivered this notification successfully.
1193    Delivered,
1194    /// Paddle tried to deliver this notification, but all attempts failed. It's not scheduled to be retried.
1195    Failed,
1196}
1197
1198/// Describes how this notification was created.
1199#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1200#[non_exhaustive]
1201pub enum NotificationOrigin {
1202    /// Notification created when a subscribed event occurred.
1203    Event,
1204    /// Notification created when a notification with the origin `event` was replayed.
1205    Replay,
1206}
1207
1208/// Where notifications should be sent for this destination.
1209#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1210#[non_exhaustive]
1211pub enum NotificationSettingType {
1212    /// Deliver to an email address.
1213    Email,
1214    /// Deliver to a webhook endpoint.
1215    Url,
1216}
1217
1218/// Whether Paddle should deliver real platform events, simulation events or both to this notification destination.
1219#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1220#[non_exhaustive]
1221pub enum TrafficSource {
1222    /// Deliver real platform events to this notification destination.
1223    Platform,
1224    /// Deliver simulation events to this notification destination.
1225    Simulation,
1226    /// Deliver platform and simulation events to this notification destination.
1227    All,
1228}
1229
1230/// Operator to use when filtering.
1231#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1232#[non_exhaustive]
1233#[serde(rename_all = "lowercase")]
1234pub enum FilterOperator {
1235    /// Less than.
1236    Lt,
1237    /// Greater than or equal to.
1238    Gte,
1239}
1240
1241#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1242#[non_exhaustive]
1243#[serde(rename_all = "snake_case")]
1244pub enum TransactionOrigin {
1245    /// Transaction created via the Paddle API.
1246    Api,
1247    /// Transaction created automatically by Paddle as a result of a one-time charge for a subscription.
1248    SubscriptionCharge,
1249    /// Transaction created automatically as part of updating a payment method. May be a zero value transaction.
1250    SubscriptionPaymentMethodChange,
1251    /// Transaction created automatically by Paddle as a result of a subscription renewal.
1252    SubscriptionRecurring,
1253    /// Transaction created automatically by Paddle as a result of an update to a subscription.
1254    SubscriptionUpdate,
1255    /// Transaction created automatically by Paddle.js for a checkout.
1256    Web,
1257}
1258
1259/// Status of this report. Set automatically by Paddle.
1260///
1261/// Reports are created as `pending` initially, then move to `ready` when they're available to download.
1262#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1263#[non_exhaustive]
1264#[serde(rename_all = "snake_case")]
1265pub enum ReportStatus {
1266    /// Report created, but Paddle is processing it. It's not yet ready for download.
1267    Pending,
1268    /// Report fully processed by Paddle and ready for download.
1269    Ready,
1270    /// There was a problem processing this report.
1271    Failed,
1272    /// Report has expired and is no longer accessible.
1273    Expired,
1274}
1275
1276/// Field name to filter by.
1277#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1278#[non_exhaustive]
1279#[serde(rename_all = "snake_case")]
1280pub enum AdjustmentsReportFilterName {
1281    /// Filter by adjustment action. Pass an array of strings containing any valid value for the `action` field against an adjustment.
1282    Action,
1283    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1284    CurrencyCode,
1285    /// Filter by transaction or adjustment status. Pass an array of strings containing any valid value for the `status` field against a transaction or an adjustment.
1286    Status,
1287    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1288    UpdatedAt,
1289}
1290
1291/// Field name to filter by.
1292#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1293#[non_exhaustive]
1294#[serde(rename_all = "snake_case")]
1295pub enum DiscountsReportFilterName {
1296    /// Filter by discount type. Pass an array of strings containing any valid value for the `type` field against a discount.
1297    Type,
1298    /// Filter by discount status. Pass an array of strings containing any valid value for the `status` field against a discount.
1299    Status,
1300    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
1301    UpdatedAt,
1302}
1303
1304/// Field name to filter by.
1305#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1306#[non_exhaustive]
1307#[serde(rename_all = "snake_case")]
1308pub enum BalanceReportFilterName {
1309    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
1310    UpdatedAt,
1311}
1312
1313/// Field name to filter by.
1314#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1315#[non_exhaustive]
1316#[serde(rename_all = "snake_case")]
1317pub enum ProductPricesReportFilterName {
1318    /// Filter by product status. Pass an array of strings containing any valid value for the `status` field against a product.
1319    ProductStatus,
1320    /// Filter by price status. Pass an array of strings containing any valid value for the `status` field against a price.
1321    PriceStatus,
1322    /// Filter by product type. Pass an array of strings containing any valid value for the `type` field against a product.
1323    ProductType,
1324    /// Filter by price type. Pass an array of strings containing any valid value for the `type` field against a price.
1325    PriceType,
1326    /// Filter by product `updated_at` date. Pass an RFC 3339 datetime string.
1327    ProductUpdatedAt,
1328    /// Filter by price `updated_at` date. Pass an RFC 3339 datetime string.
1329    PriceUpdatedAt,
1330}
1331
1332/// Field name to filter by.
1333#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1334#[non_exhaustive]
1335#[serde(rename_all = "snake_case")]
1336pub enum TransactionsReportFilterName {
1337    /// Filter by collection mode. Pass an array of strings containing any valid value for the `collection_mode` field against a transaction.
1338    CollectionMode,
1339    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1340    CurrencyCode,
1341    /// Filter by transaction origin. Pass an array of strings containing any valid value for the origin field against a transaction.
1342    Origin,
1343    /// Filter by transaction or adjustment status. Pass an array of strings containing any valid value for the `status` field against a transaction or an adjustment.
1344    Status,
1345    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1346    UpdatedAt,
1347}
1348
1349/// Type of report.
1350#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1351#[non_exhaustive]
1352#[serde(rename_all = "snake_case")]
1353pub enum AdjustmentsReportType {
1354    /// Adjustments reports contain information about refunds, credits, and chargebacks.
1355    Adjustments,
1356    /// Adjustments reports contain information about refunds, credits, and chargebacks. The report is broken down by line item level.
1357    AdjustmentLineItems,
1358}
1359
1360impl ReportType for AdjustmentsReportType {
1361    type FilterName = AdjustmentsReportFilterName;
1362}
1363
1364/// Type of report.
1365#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1366#[non_exhaustive]
1367#[serde(rename_all = "snake_case")]
1368pub enum TransactionsReportType {
1369    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions.
1370    Transactions,
1371    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions. The report is broken down by line item level.
1372    TransactionLineItems,
1373}
1374
1375impl ReportType for TransactionsReportType {
1376    type FilterName = TransactionsReportFilterName;
1377}
1378
1379/// Type of report.
1380#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1381#[non_exhaustive]
1382#[serde(rename_all = "snake_case")]
1383pub enum ProductsAndPricesReportType {
1384    /// Products and prices reports contain information about your products and prices. May include non-catalog products and prices.
1385    ProductsPrices,
1386}
1387
1388impl ReportType for ProductsAndPricesReportType {
1389    type FilterName = ProductPricesReportFilterName;
1390}
1391
1392/// Type of report.
1393#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1394#[non_exhaustive]
1395#[serde(rename_all = "snake_case")]
1396pub enum DiscountsReportType {
1397    /// Discounts reports contain information about your product and checkout discounts.
1398    Discounts,
1399}
1400
1401impl ReportType for DiscountsReportType {
1402    type FilterName = DiscountsReportFilterName;
1403}
1404
1405/// Type of report.
1406#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1407#[non_exhaustive]
1408#[serde(rename_all = "snake_case")]
1409pub enum BalanceReportType {
1410    /// Balance reports contain information about your account balance activity, including all movements of funds in and out of your balance.
1411    Balance,
1412}
1413
1414impl ReportType for BalanceReportType {
1415    type FilterName = BalanceReportFilterName;
1416}
1417
1418/// Status of this simulation run log.
1419#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1420#[non_exhaustive]
1421pub enum SimulationEventStatus {
1422    /// Simulation run log is pending. Paddle hasn't yet tried to deliver the simulated event.
1423    Pending,
1424    /// Simulation run log was successful. Paddle delivered the simulated event successfully.
1425    Success,
1426    /// Simulation run log failed. Paddle tried to deliver the simulated event, but it failed. If `response` object is `null`, no response received from your server. Check your notification setting endpoint configuration.
1427    Failed,
1428    /// Simulation run log aborted. Paddle could not attempt delivery of the simulated event.
1429    Aborted,
1430}
1431
1432/// Status of this simulation run.
1433#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1434#[non_exhaustive]
1435pub enum SimulationRunStatus {
1436    /// Simulation run is pending. Paddle is sending events that are part of this simulation.
1437    Pending,
1438    /// Simulation run is completed. Paddle attempted to send events that are part of this simulation.
1439    Completed,
1440    /// Simulation run is canceled. Simulation run was canceled before all events were sent.
1441    Canceled,
1442}
1443
1444/// Scenario for a simulation.
1445#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1446#[non_exhaustive]
1447pub enum SimulationScenarioType {
1448    /// Simulates all events sent when a subscription is created.
1449    SubscriptionCreation,
1450    /// Simulates all events sent when a subscription is renewed.
1451    SubscriptionRenewal,
1452    /// Simulates all events sent when a subscription is paused.
1453    SubscriptionPause,
1454    /// Simulates all events sent when a subscription is resumed.
1455    SubscriptionResume,
1456    /// Simulates all events sent when a subscription is canceled.
1457    SubscriptionCancellation,
1458}
1459
1460/// Type of simulation.
1461#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1462#[non_exhaustive]
1463pub enum SimulationKind {
1464    /// Paddle simulates a single event.
1465    SingleEvent,
1466    /// Paddle simulates a predefined series of events for a scenario, like all events created when a subscription renews.
1467    Scenario,
1468}
1469
1470/// Status of this payment attempt.
1471#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1472#[non_exhaustive]
1473#[serde(rename_all = "snake_case")]
1474pub enum PaymentAttemptStatus {
1475    /// Authorized but not captured. Payment attempt is incomplete.
1476    Authorized,
1477    /// Authorized but not captured because it has been flagged as potentially fraudulent. Payment attempt is incomplete.
1478    AuthorizedFlagged,
1479    /// Previously authorized payment attempt has been canceled. Typically when `authorized_flagged` payment attempts are rejected.
1480    Canceled,
1481    /// Payment captured successfully. Payment attempt is complete.
1482    Captured,
1483    /// Something went wrong and the payment attempt was unsuccessful. Check the `error_code` for more information.
1484    Error,
1485    /// Customer must complete an action for this payment attempt to proceed. Typically means that the payment attempt requires 3DS.
1486    ActionRequired,
1487    /// Response required from the bank or payment provider. Transaction is pending.
1488    PendingNoActionRequired,
1489    /// New payment attempt created.
1490    Created,
1491    /// Payment attempt status not known.
1492    Unknown,
1493    /// Payment attempt dropped by Paddle.
1494    Dropped,
1495}
1496
1497/// Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
1498#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1499#[non_exhaustive]
1500#[serde(rename_all = "snake_case")]
1501pub enum SubscriptionStatus {
1502    /// Subscription is active. Paddle is billing for this subscription and related transactions aren't past due.
1503    Active,
1504    /// Subscription is canceled. Automatically set by Paddle when a subscription is canceled. When a subscription is set to cancel on the next billing period, a scheduled change for the cancellation is created. The subscription status moves to canceled when the scheduled change takes effect.
1505    Canceled,
1506    /// Subscription has an overdue payment. Automatically set by Paddle when payment fails for an automatically-collected transaction, or when payment terms have elapsed for a manually-collected transaction (an invoice).
1507    PastDue,
1508    /// Subscription is paused. Automatically set by Paddle when a subscription is paused. When a subscription is set to pause on the next billing period, a scheduled change for the pause is created. The subscription status moves to `paused` when the scheduled change takes effect.
1509    Paused,
1510    /// Subscription is in trial.
1511    Trialing,
1512}
1513
1514/// Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed.
1515#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1516#[non_exhaustive]
1517#[serde(rename_all = "snake_case")]
1518pub enum TransactionStatus {
1519    /// Transaction is missing required fields. Typically the first stage of a checkout before customer details are captured.
1520    Draft,
1521    /// Transaction has all of the required fields to be marked as `billed` or `completed`.
1522    Ready,
1523    /// Transaction has been updated to `billed`. Billed transactions get an invoice number and are considered a legal record. They cannot be changed. Typically used as part of an invoice workflow.
1524    Billed,
1525    /// Transaction is fully paid, but has not yet been processed internally.
1526    Paid,
1527    /// Transaction is fully paid and processed.
1528    Completed,
1529    /// Transaction has been updated to `canceled`. If an invoice, it's no longer due.
1530    Canceled,
1531    /// Transaction is past due. Occurs for automatically-collected transactions when the related subscription is in dunning, and for manually-collected transactions when payment terms have elapsed.
1532    PastDue,
1533}
1534
1535/// Kind of change that's scheduled to be applied to this subscription.
1536#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1537#[non_exhaustive]
1538#[serde(rename_all = "lowercase")]
1539pub enum ScheduledChangeAction {
1540    /// Subscription is scheduled to cancel. Its status changes to `canceled` on the `effective_at` date.
1541    Cancel,
1542    /// Subscription is scheduled to pause. Its status changes to `pause` on the `effective_at` date.
1543    Pause,
1544    /// Subscription is scheduled to resume. Its status changes to `active` on the `resume_at` date.
1545    Resume,
1546}
1547
1548/// How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
1549#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1550#[non_exhaustive]
1551#[serde(rename_all = "snake_case")]
1552pub enum SubscriptionOnPaymentFailure {
1553    /// In case of payment failure, prevent the change to the subscription from applying.
1554    PreventChange,
1555    /// In case of payment failure, apply the change and update the subscription.
1556    ApplyChange,
1557}
1558
1559/// Whether the subscription change results in a prorated credit or a charge.
1560#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1561#[non_exhaustive]
1562#[serde(rename_all = "lowercase")]
1563pub enum UpdateSummaryResultAction {
1564    /// Changes to the subscription results in a prorated credit.
1565    Credit,
1566    /// Changes to the subscription results in a prorated charge.
1567    Charge,
1568}
1569
1570/// How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
1571/// changes that impact billing.
1572///
1573/// For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
1574/// collects for payment immediately is used.
1575#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1576#[non_exhaustive]
1577#[serde(rename_all = "snake_case")]
1578pub enum ProrationBillingMode {
1579    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1580    /// creates a transaction to collect immediately.
1581    ProratedImmediately,
1582    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1583    /// schedules them to be billed on the next renewal.
1584    ProratedNextBillingPeriod,
1585    /// Paddle does not calculate proration for the subscription changes, creating a transaction to collect for the full
1586    /// amount immediately.
1587    FullImmediately,
1588    /// Paddle does not calculate proration for the subscription changes, scheduling for the full amount for the changes
1589    /// to be billed on the next renewal.
1590    FullNextBillingPeriod,
1591    /// Paddle does not bill for the subscription changes.
1592    DoNotBill,
1593}
1594
1595/// How Paddle should set the billing period for the subscription when resuming. If omitted, defaults to `start_new_billing_period`.
1596#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1597#[non_exhaustive]
1598#[serde(rename_all = "snake_case")]
1599pub enum SubscriptionOnResume {
1600    /// When resuming, continue the existing billing period. If the customer resumes before the end date of the existing billing period, there's no immediate charge. If after, an error is returned.
1601    ContinueExistingBillingPeriod,
1602    /// When resuming, start a new billing period. The `current_billing_period.starts_at` date is set to the resume date, and Paddle immediately charges the full amount for the new billing period.
1603    StartNewBillingPeriod,
1604}
1605
1606/// Determine whether the generated URL should download the PDF as an attachment saved locally, or open it inline in the browser.
1607#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1608#[non_exhaustive]
1609#[serde(rename_all = "lowercase")]
1610pub enum Disposition {
1611    /// Generated URL downloads the PDF as an attachment. Browsers typically automatically save the PDF.
1612    Attachment,
1613    /// Generated URL displays the PDF inline in the browser. Browsers typically open the PDF in the current tab.
1614    Inline,
1615}
1616
1617#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1618#[non_exhaustive]
1619#[serde(rename_all = "lowercase")]
1620pub enum PayoutStatus {
1621    /// Payout is paid.
1622    Paid,
1623    /// Payout is unpaid. Typically means it has been created, but is not yet completed.
1624    Unpaid,
1625}
1626
1627#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
1628#[non_exhaustive]
1629#[serde(rename_all = "lowercase")]
1630pub enum ApiKeyStatus {
1631    Active,
1632    Expired,
1633    Revoked,
1634}