paddle-rust-sdk-types 0.2.0

Paddle Rust SDK Types (Unofficial)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
//! This module contains enums used in the Paddle API.

#![allow(clippy::upper_case_acronyms, clippy::enum_variant_names)]

use serde::{Deserialize, Serialize};
#[cfg(feature = "strum")]
use strum::{Display, EnumString};

use crate::reports::ReportType;

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum CountryCodeSupported {
    /// Andorra
    AD,
    /// United Arab Emirates
    AE,
    /// Antigua and Barbuda
    AG,
    /// Anguilla
    AI,
    /// Albania
    AL,
    /// Armenia
    AM,
    /// Angola
    AO,
    /// Argentina
    AR,
    /// American Samoa
    AS,
    /// Austria
    AT,
    /// Australia
    AU,
    /// Aruba
    AW,
    /// Ã…land Islands
    AX,
    /// Azerbaijan
    AZ,
    /// Bosnia and Herzegovina
    BA,
    /// Barbados
    BB,
    /// Bangladesh
    BD,
    /// Belgium
    BE,
    /// Burkina Faso
    BF,
    /// Bulgaria
    BG,
    /// Bahrain
    BH,
    /// Burundi
    BI,
    /// Benin
    BJ,
    /// Saint Barthélemy
    BL,
    /// Bermuda
    BM,
    /// Brunei
    BN,
    /// Bolivia
    BO,
    /// Caribbean Netherlands (Bonaire, Sint Eustatius, and Saba)
    BQ,
    /// Brazil
    BR,
    /// Bahamas
    BS,
    /// Bhutan
    BT,
    /// Bouvet Island
    BV,
    /// Botswana
    BW,
    /// Belize
    BZ,
    /// Canada
    CA,
    /// Cocos Islands
    CC,
    /// Republic of Congo
    CG,
    /// Switzerland
    CH,
    /// Côte d'Ivoire (Ivory Coast)
    CI,
    /// Cook Islands
    CK,
    /// Chile
    CL,
    /// Cameroon
    CM,
    /// China
    CN,
    /// Colombia
    CO,
    /// Costa Rica
    CR,
    /// Cape Verde
    CV,
    /// Curaçao
    CW,
    /// Christmas Island
    CX,
    /// Cyprus
    CY,
    /// Czechia (Czech Republic)
    CZ,
    /// Germany
    DE,
    /// Djibouti
    DJ,
    /// Denmark
    DK,
    /// Dominica
    DM,
    /// Dominican Republic
    DO,
    /// Algeria
    DZ,
    /// Ecuador
    EC,
    /// Estonia
    EE,
    /// Egypt
    EG,
    /// Western Sahara
    EH,
    /// Eritrea
    ER,
    /// Spain
    ES,
    /// Ethiopia
    ET,
    /// Finland
    FI,
    /// Fiji
    FJ,
    /// Falkland Islands
    FK,
    /// Micronesia
    FM,
    /// Faroe Islands
    FO,
    /// France
    FR,
    /// Gabon
    GA,
    /// United Kingdom
    GB,
    /// Grenada
    GD,
    /// Georgia
    GE,
    /// French Guiana
    GF,
    /// Guernsey
    GG,
    /// Ghana
    GH,
    /// Gibraltar
    GI,
    /// Greenland
    GL,
    /// Gambia
    GM,
    /// Guinea
    GN,
    /// Guadeloupe
    GP,
    /// Equatorial Guinea
    GQ,
    /// Greece
    GR,
    /// South Georgia and the South Sandwich Islands
    GS,
    /// Guatemala
    GT,
    /// Guam
    GU,
    /// Guinea-Bissau
    GW,
    /// Guyana
    GY,
    /// Hong Kong
    HK,
    /// Heard Island and McDonald Islands
    HM,
    /// Honduras
    HN,
    /// Croatia
    HR,
    /// Hungary
    HU,
    /// Indonesia
    ID,
    /// Ireland
    IE,
    /// Israel
    IL,
    /// Isle of Man
    IM,
    /// India
    IN,
    /// British Indian Ocean Territory
    IO,
    /// Iraq
    IQ,
    /// Iceland
    IS,
    /// Italy
    IT,
    /// Jersey
    JE,
    /// Jamaica
    JM,
    /// Jordan
    JO,
    /// Japan
    JP,
    /// Kenya
    KE,
    /// Kyrgyzstan
    KG,
    /// Cambodia
    KH,
    /// Kiribati
    KI,
    /// Comoros
    KM,
    /// Saint Kitts and Nevis
    KN,
    /// South Korea
    KR,
    /// Kuwait
    KW,
    /// Cayman Islands
    KY,
    /// Kazakhstan
    KZ,
    /// Lao People's Democratic Republic (Laos)
    LA,
    /// Lebanon
    LB,
    /// Saint Lucia
    LC,
    /// Liechtenstein
    LI,
    /// Sri Lanka
    LK,
    /// Liberia
    LR,
    /// Lesotho
    LS,
    /// Lithuania
    LT,
    /// Luxembourg
    LU,
    /// Latvia
    LV,
    /// Morocco
    MA,
    /// Monaco
    MC,
    /// Moldova
    MD,
    /// Montenegro
    ME,
    /// Saint Martin
    MF,
    /// Madagascar
    MG,
    /// Marshall Islands
    MH,
    /// Macedonia
    MK,
    /// Mongolia
    MN,
    /// Macao
    MO,
    /// Northern Mariana Islands
    MP,
    /// Martinique
    MQ,
    /// Mauritania
    MR,
    /// Montserrat
    MS,
    /// Malta
    MT,
    /// Mauritius
    MU,
    /// Maldives
    MV,
    /// Malawi
    MW,
    /// Mexico
    MX,
    /// Malaysia
    MY,
    /// Mozambique
    MZ,
    /// Namibia
    NA,
    /// New Caledonia
    NC,
    /// Niger
    NE,
    /// Norfolk Island
    NF,
    /// Nigeria
    NG,
    /// Netherlands
    NL,
    /// Norway
    NO,
    /// Nepal
    NP,
    /// Nauru
    NR,
    /// Niue
    NU,
    /// New Zealand
    NZ,
    /// Oman
    OM,
    /// Panama
    PA,
    /// Peru
    PE,
    /// French Polynesia
    PF,
    /// Papua New Guinea
    PG,
    /// Philippines
    PH,
    /// Pakistan
    PK,
    /// Poland
    PL,
    /// Saint Pierre and Miquelon
    PM,
    /// Pitcairn
    PN,
    /// Puerto Rico
    PR,
    /// Palestinian territories
    PS,
    /// Portugal
    PT,
    /// Palau
    PW,
    /// Paraguay
    PY,
    /// Qatar
    QA,
    /// Reunion
    RE,
    /// Romania
    RO,
    /// Republic of Serbia
    RS,
    /// Rwanda
    RW,
    /// Saudi Arabia
    SA,
    /// Solomon Islands
    SB,
    /// Seychelles
    SC,
    /// Sweden
    SE,
    /// Singapore
    SG,
    /// Saint Helena
    SH,
    /// Slovenia
    SI,
    /// Svalbard and Jan Mayen
    SJ,
    /// Slovakia
    SK,
    /// Sierra Leone
    SL,
    /// San Marino
    SM,
    /// Senegal
    SN,
    /// Suriname
    SR,
    /// São Tomé and Príncipe
    ST,
    /// El Salvador
    SV,
    /// Sint Maarten
    SX,
    /// Swaziland
    SZ,
    /// Turks and Caicos Islands
    TC,
    /// Chad
    TD,
    /// French Southern and Antarctic Lands
    TF,
    /// Togo
    TG,
    /// Thailand
    TH,
    /// Tajikistan
    TJ,
    /// Tokelau
    TK,
    /// Timor-Leste
    TL,
    /// Turkmenistan
    TM,
    /// Tunisia
    TN,
    /// Tonga
    TO,
    /// Turkey
    TR,
    /// Trinidad and Tobago
    TT,
    /// Tuvalu
    TV,
    /// Taiwan
    TW,
    /// Tanzania
    TZ,
    /// Ukraine
    UA,
    /// Uganda
    UG,
    /// United States Minor Outlying Islands
    UM,
    /// United States
    US,
    /// Uruguay
    UY,
    /// Uzbekistan
    UZ,
    /// Holy See (Vatican City)
    VA,
    /// Saint Vincent and the Grenadines
    VC,
    /// British Virgin Islands
    VG,
    /// U.S. Virgin Islands
    VI,
    /// Vietnam
    VN,
    /// Vanuatu
    VU,
    /// Wallis and Futuna
    WF,
    /// Samoa
    WS,
    /// Kosovo
    XK,
    /// Mayotte
    YT,
    /// South Africa
    ZA,
    /// Zambia
    ZM,
    /// Other country code
    #[serde(untagged)]
    #[cfg_attr(feature = "strum", strum(default))]
    Other(String),
}

/// Whether this entity can be used in Paddle.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "kebab-case"))]
pub enum Status {
    /// Entity is active and can be used.
    Active,
    /// Entity is archived, so can't be used.
    Archived,
}

/// How this adjustment impacts the related transaction.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum AdjustmentAction {
    /// Credits some or all the related transaction.
    Credit,
    /// Refunds some or all the related transaction. Must be approved by Paddle in most cases.
    Refund,
    /// Chargeback for the related transaction. Automatically created by Paddle when a customer successfully disputes a charge.
    Chargeback,
    /// Reversal of a chargeback for the related transaction. Automatically created by Paddle when Paddle contests a chargeback successfully.
    ChargebackReverse,
    /// Warning of an upcoming chargeback for the related transaction. Automatically created by Paddle.
    ChargebackWarning,
    /// Reversal of a credit for the related transaction. Automatically created by Paddle.
    CreditReverse,
}

/// 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`.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum AdjustmentType {
    /// The grand total for the related transaction is adjusted.
    Full,
    /// Some line items for the related transaction are adjusted. Requires `items`.
    Partial,
}

/// Supported three-letter ISO 4217 currency code.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum CurrencyCode {
    /// United States Dollar
    USD,
    /// Euro
    EUR,
    /// Pound Sterling
    GBP,
    /// Japanese Yen
    JPY,
    /// Australian Dollar
    AUD,
    /// Canadian Dollar
    CAD,
    /// Swiss Franc
    CHF,
    /// Hong Kong Dollar
    HKD,
    /// Singapore Dollar
    SGD,
    /// Swedish Krona
    SEK,
    /// Argentine Peso
    ARS,
    /// Brazilian Real
    BRL,
    /// Chinese Yuan
    CNY,
    /// Colombian Peso
    COP,
    /// Czech Koruna
    CZK,
    /// Danish Krone
    DKK,
    /// Hungarian Forint
    HUF,
    /// Israeli Shekel
    ILS,
    /// Indian Rupee
    INR,
    /// South Korean Won
    KRW,
    /// Mexican Peso
    MXN,
    /// Norwegian Krone
    NOK,
    /// New Zealand Dollar
    NZD,
    /// Polish Zloty
    PLN,
    /// Russian Ruble
    RUB,
    /// Thai Baht
    THB,
    /// Turkish Lira
    TRY,
    /// New Taiwan Dollar
    TWD,
    /// Ukrainian Hryvnia
    UAH,
    /// Vietnamese Dong
    VND,
    /// South African Rand
    ZAR,
}

/// Status of this adjustment. Set automatically by Paddle.
///
/// 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.
///
/// Credit adjustments don't require approval from Paddle, so they're created as `approved`.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum AdjustmentStatus {
    /// Adjustment is pending approval by Paddle. Most refunds for live accounts must be approved by Paddle.
    PendingApproval,
    /// Adjustment is approved. Default for credits. Set when Paddle approves a refund that was `pending_approval`.
    Approved,
    /// Adjustment has been rejected. Set when Paddle rejects a refund that was `pending_approval`.
    Rejected,
    /// Adjustment has been reversed. Set by Paddle when a `chargeback_reversal` or `credit_reversal` adjustment is created for this adjustment.
    Reversed,
}

/// Three-letter ISO 4217 currency code for chargeback fees.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum CurrencyCodeChargebacks {
    /// Australian Dollar
    AUD,
    /// Canadian Dollar
    CAD,
    /// Euro
    EUR,
    /// Pound Sterling
    GBP,
    /// United States Dollar
    USD,
}

/// Supported three-letter ISO 4217 currency code for payouts from Paddle.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum CurrencyCodePayouts {
    /// Australian Dollar
    AUD,
    /// Canadian Dollar
    CAD,
    /// Swiss Franc
    CHF,
    /// Chinese Yuan
    CNY,
    /// Czech Koruna
    CZK,
    /// Danish Krone
    DKK,
    /// Euro
    EUR,
    /// Pound Sterling
    GBP,
    /// Hungarian Forint
    HUF,
    /// Polish Zloty
    PLN,
    /// Swedish Krona
    SEK,
    /// United States Dollar
    USD,
    /// South African Rand
    ZAR,
}

/// Type of adjustment for this transaction item. `tax` adjustments are automatically created by Paddle.
/// Include `amount` when creating a `partial` adjustment.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum AdjustmentItemType {
    /// Full total for this transaction item is adjusted.
    Full,
    /// Part of this transaction item is adjusted. Include `amount` to specify the partial amount adjusted.
    Partial,
    /// Tax for this transaction item is adjusted. Created automatically by Paddle.
    Tax,
    /// A prorated amount for this transaction item is adjusted. Created automatically by Paddle in some cases when making changes to a subscription.
    Proration,
}

/// Unit of time.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "kebab-case"))]
pub enum Interval {
    Day,
    Week,
    Month,
    Year,
}

/// Type of credit or debit card used to pay.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum CardType {
    /// American Express
    AmericanExpress,
    /// Diners Club
    DinersClub,
    /// Discover Card
    Discover,
    /// JCB Card, popular in Japan
    Jcb,
    /// Mada Card, popular in Saudi Arabia
    Mada,
    /// Maestro (debit card)
    Maestro,
    /// Mastercard
    Mastercard,
    /// UnionPay, popular in China
    UnionPay,
    /// Card type unknown
    Unknown,
    /// Visa
    Visa,
}

/// Type of item. Standard items are considered part of your catalog and are shown on the Paddle dashboard.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "kebab-case"))]
pub enum CatalogType {
    /// Non-catalog item. Typically created for a specific transaction or subscription. Not returned when listing or shown in the Paddle dashboard.
    Custom,
    /// Standard item. Can be considered part of your catalog and reused across transactions and subscriptions easily.
    Standard,
}

/// How payment is collected. `automatic` for checkout, `manual` for invoices.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum CollectionMode {
    /// Payment is collected automatically using a checkout initially, then using a payment method on file.
    Automatic,
    /// 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`.
    Manual,
}

/// Type of payment method saved.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum SavedPaymentMethodType {
    /// Alipay, popular in China.
    Alipay,
    /// Apple Pay on a supported Apple device.
    ApplePay,
    /// Credit or debit card.
    Card,
    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
    GooglePay,
    /// PayPal.
    Paypal,
}

/// Describes how this payment method was saved.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum PaymentMethodOrigin {
    /// The customer chose to save this payment method while purchasing a one-time item.
    SavedDuringPurchase,
    /// The customer purchased a subscription, so this payment method was saved for future purchases.
    Subscription,
}

/// Whether this entity can be used in Paddle.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "kebab-case"))]
pub enum DiscountStatus {
    /// Entity is active and can be used.
    Active,
    /// Entity is archived, so can't be used.
    Archived,
}

/// Type of discount. Determines how this discount impacts the checkout or transaction total.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum DiscountType {
    /// Discounts a checkout or transaction by a flat amount, for example -$100. Requires `currency_code`.
    Flat,
    /// Discounts a checkout or transaction by a flat amount per unit, for example -$100 per user. Requires `currency_code`.
    FlatPerSeat,
    /// Discounts a checkout or transaction by a percentage of the total, for example -10%. Maximum 100%.
    Percentage,
}

/// When this subscription change should take effect from. Defaults to `next_billing_period`, which creates a
/// `scheduled_change` to apply the subscription change at the end of the billing period.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum EffectiveFrom {
    /// Takes effect on the next billing period.
    NextBillingPeriod,
    /// Takes effect immediately.
    Immediately,
}

/// Type of error encountered.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum Type {
    /// Typically means there's a problem with the request that you made.
    RequestError,
    /// Typically means there's a problem with the Paddle API.
    ApiError,
}

/// Reason why a payment attempt failed. Returns `null` if payment captured successfully.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum ErrorCode {
    /// Cancellation not possible because the amount has already been canceled. Not typically returned for payments.
    AlreadyCanceled,
    /// Refund is not possible because the amount has already been refunded. Not typically returned for payments.
    AlreadyRefunded,
    /// Payment required a 3DS2 authentication challenge. The customer completed the challenge but was not successful.
    AuthenticationFailed,
    /// Payment method issuer has indicated that the card cannot be used as it is frozen, lost, damaged, or stolen.
    BlockedCard,
    /// Customer has requested that the mandate for recurring payments be canceled.
    Canceled,
    /// Payment method has been declined, with no other information returned.
    Declined,
    /// 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.
    DeclinedNotRetryable,
    /// 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.
    ExpiredCard,
    /// Payment method issuer or payment service provider flagged this payment as potentially fraudulent.
    Fraud,
    /// Payment method issuer or payment service provider cannot process a payment that is this high or low.
    InvalidAmount,
    /// 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.
    InvalidPaymentDetails,
    /// Payment service provider couldn't reach the payment method issuer.
    IssuerUnavailable,
    /// Payment method declined because of insufficient funds, or fund limits being reached.
    NotEnoughBalance,
    /// Payment method has been declined because the network scheme that the customer selected isn't supported by the payment service provider.
    PreferredNetworkNotSupported,
    /// Something went wrong with the payment service provider, with no other information returned.
    PspError,
    /// Payment service provider didn't receive payment method information as they've been redacted.
    RedactedPaymentMethod,
    /// Something went wrong with the Paddle platform. Try again later, or check status.paddle.com.
    SystemError,
    /// Payment method issuer doesn't allow this kind of payment because of limits on the account, or legal or compliance reasons.
    TransactionNotPermitted,
    /// Payment attempt unsuccessful, with no other information returned.
    Unknown,
}

/// Type of event sent by Paddle, in the format `entity.event_type`.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum EventTypeName {
    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
    AddressCreated,
    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
    AddressImported,
    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
    AddressUpdated,
    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
    AdjustmentCreated,
    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
    AdjustmentUpdated,
    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
    BusinessCreated,
    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
    BusinessImported,
    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
    BusinessUpdated,
    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
    CustomerCreated,
    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
    CustomerImported,
    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
    CustomerUpdated,
    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
    DiscountCreated,
    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
    DiscountImported,
    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
    DiscountUpdated,
    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
    PayoutCreated,
    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
    PayoutPaid,
    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
    PriceCreated,
    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
    PriceImported,
    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
    PriceUpdated,
    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
    ProductCreated,
    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
    ProductImported,
    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-updated) event.
    ProductUpdated,
    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
    ReportCreated,
    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
    ReportUpdated,
    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
    SubscriptionActivated,
    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
    SubscriptionCanceled,
    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
    SubscriptionCreated,
    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
    SubscriptionImported,
    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
    SubscriptionPastDue,
    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
    SubscriptionPaused,
    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
    SubscriptionResumed,
    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
    SubscriptionTrialing,
    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
    SubscriptionUpdated,
    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
    TransactionBilled,
    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
    TransactionCanceled,
    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
    TransactionCompleted,
    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
    TransactionCreated,
    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
    TransactionPaid,
    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
    TransactionPastDue,
    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
    TransactionPaymentFailed,
    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
    TransactionReady,
    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
    TransactionUpdated,
}

/// Type of event sent by Paddle along with it's corresponding entity data
#[allow(clippy::large_enum_variant)]
#[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(tag = "event_type", content = "data")]
pub enum EventData {
    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
    #[serde(rename = "address.created")]
    AddressCreated(crate::entities::Address),
    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
    #[serde(rename = "address.imported")]
    AddressImported(crate::entities::Address),
    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
    #[serde(rename = "address.updated")]
    AddressUpdated(crate::entities::Address),
    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
    #[serde(rename = "adjustment.created")]
    AdjustmentCreated(crate::entities::Adjustment),
    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
    #[serde(rename = "adjustment.updated")]
    AdjustmentUpdated(crate::entities::Adjustment),
    /// A [`api_key.created`](https://developer.paddle.com/webhooks/api-keys/api-key-created) event.
    #[serde(rename = "api_key.created")]
    ApiKeyCreated(crate::entities::ApiKey),
    /// A [`api_key.updated`](https://developer.paddle.com/webhooks/api-keys/api-key-updated) event.
    #[serde(rename = "api_key.updated")]
    ApiKeyUpdated(crate::entities::ApiKey),
    /// A [`api_key.expiring`](https://developer.paddle.com/webhooks/api-keys/api-key-expiring) event.
    #[serde(rename = "api_key.expiring")]
    ApiKeyExpiring(crate::entities::ApiKey),
    /// A [`api_key.expired`](https://developer.paddle.com/webhooks/api-keys/api-key-expired) event.
    #[serde(rename = "api_key.expired")]
    ApiKeyExpired(crate::entities::ApiKey),
    /// A [`api_key.revoked`](https://developer.paddle.com/webhooks/api-keys/api-key-revoked) event.
    #[serde(rename = "api_key.revoked")]
    ApiKeyRevoked(crate::entities::ApiKey),
    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
    #[serde(rename = "business.created")]
    BusinessCreated(crate::entities::Business),
    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
    #[serde(rename = "business.imported")]
    BusinessImported(crate::entities::Business),
    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
    #[serde(rename = "business.updated")]
    BusinessUpdated(crate::entities::Business),
    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
    #[serde(rename = "customer.created")]
    CustomerCreated(crate::entities::Customer),
    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
    #[serde(rename = "customer.imported")]
    CustomerImported(crate::entities::Customer),
    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
    #[serde(rename = "customer.updated")]
    CustomerUpdated(crate::entities::Customer),
    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
    #[serde(rename = "discount.created")]
    DiscountCreated(crate::entities::Discount),
    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
    #[serde(rename = "discount.imported")]
    DiscountImported(crate::entities::Discount),
    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
    #[serde(rename = "discount.updated")]
    DiscountUpdated(crate::entities::Discount),
    /// A [`payment_method.saved`](https://developer.paddle.com/webhooks/payment-methods/payment-method-saved) event.
    #[serde(rename = "payment_method.saved")]
    PaymentMethodSaved(crate::entities::PaymentMethod),
    /// A [`payment_method.deleted`](https://developer.paddle.com/webhooks/payment-methods/payment-method-deleted) event.
    #[serde(rename = "payment_method.deleted")]
    PaymentMethodDeleted(crate::entities::PaymentMethod),
    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
    #[serde(rename = "payout.created")]
    PayoutCreated(crate::entities::Payout),
    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
    #[serde(rename = "payout.paid")]
    PayoutPaid(crate::entities::Payout),
    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
    #[serde(rename = "price.created")]
    PriceCreated(crate::entities::Price),
    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
    #[serde(rename = "price.imported")]
    PriceImported(crate::entities::Price),
    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
    #[serde(rename = "price.updated")]
    PriceUpdated(crate::entities::Price),
    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
    #[serde(rename = "product.created")]
    ProductCreated(crate::entities::Product),
    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
    #[serde(rename = "product.imported")]
    ProductImported(crate::entities::Product),
    /// A [`product.updated`](https://developer.paddle.com/webhooks/products/product-updated) event.
    #[serde(rename = "product.updated")]
    ProductUpdated(crate::entities::Product),
    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
    #[serde(rename = "report.created")]
    ReportCreated(crate::entities::ReportBase),
    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
    #[serde(rename = "report.updated")]
    ReportUpdated(crate::entities::ReportBase),
    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
    #[serde(rename = "subscription.activated")]
    SubscriptionActivated(crate::entities::Subscription),
    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
    #[serde(rename = "subscription.canceled")]
    SubscriptionCanceled(crate::entities::Subscription),
    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
    #[serde(rename = "subscription.created")]
    SubscriptionCreated(crate::entities::Subscription),
    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
    #[serde(rename = "subscription.imported")]
    SubscriptionImported(crate::entities::Subscription),
    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
    #[serde(rename = "subscription.past_due")]
    SubscriptionPastDue(crate::entities::Subscription),
    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
    #[serde(rename = "subscription.paused")]
    SubscriptionPaused(crate::entities::Subscription),
    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
    #[serde(rename = "subscription.resumed")]
    SubscriptionResumed(crate::entities::Subscription),
    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
    #[serde(rename = "subscription.trialing")]
    SubscriptionTrialing(crate::entities::Subscription),
    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
    #[serde(rename = "subscription.updated")]
    SubscriptionUpdated(crate::entities::Subscription),
    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
    #[serde(rename = "transaction.billed")]
    TransactionBilled(crate::entities::Transaction),
    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
    #[serde(rename = "transaction.canceled")]
    TransactionCanceled(crate::entities::Transaction),
    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
    #[serde(rename = "transaction.completed")]
    TransactionCompleted(crate::entities::Transaction),
    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
    #[serde(rename = "transaction.created")]
    TransactionCreated(crate::entities::Transaction),
    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
    #[serde(rename = "transaction.paid")]
    TransactionPaid(crate::entities::Transaction),
    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
    #[serde(rename = "transaction.past_due")]
    TransactionPastDue(crate::entities::Transaction),
    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
    #[serde(rename = "transaction.payment_failed")]
    TransactionPaymentFailed(crate::entities::Transaction),
    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
    #[serde(rename = "transaction.ready")]
    TransactionReady(crate::entities::Transaction),
    /// A [`transaction.revised`](https://developer.paddle.com/webhooks/transactions/transaction-revised) event.
    #[serde(rename = "transaction.revised")]
    TransactionRevised(crate::entities::Transaction),
    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
    #[serde(rename = "transaction.updated")]
    TransactionUpdated(crate::entities::Transaction),
}

/// Status of this subscription item. Set automatically by Paddle.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum SubscriptionItemStatus {
    /// This item is active. It is not in trial and Paddle bills for it.
    Active,
    /// This item is not active. Set when the related subscription is paused.
    Inactive,
    /// This item is in trial. Paddle has not billed for it.
    Trialing,
}

/// How tax is calculated for this price.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum TaxMode {
    /// Prices use the setting from your account.
    AccountSetting,
    /// Prices are exclusive of tax.
    External,
    /// Prices are inclusive of tax.
    Internal,
    /// Prices are inclusive or exclusive of tax, depending on the country of the transaction.
    Location,
}

/// Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "kebab-case"))]
pub enum TaxCategory {
    /// Non-customizable digital files or media (not software) acquired with an up front payment that can be accessed without any physical product being delivered.
    DigitalGoods,
    /// Digital books and educational material which is sold with permanent rights for use by the customer.
    Ebooks,
    /// Remote configuration, set-up, and integrating software on behalf of a customer.
    ImplementationServices,
    /// Services that involve the application of your expertise and specialized knowledge of a software product.
    ProfessionalServices,
    /// Products that allow users to connect to and use online or cloud-based applications over the Internet.
    Saas,
    /// Services that can be used to customize and white label software products.
    SoftwareProgrammingServices,
    /// Software products that are pre-written and can be downloaded and installed onto a local device.
    Standard,
    /// Training and education services related to software products.
    TrainingServices,
    /// Cloud storage service for personal or corporate information, assets, or intellectual property.
    WebsiteHosting,
}

impl AsRef<str> for TaxCategory {
    fn as_ref(&self) -> &str {
        match self {
            Self::DigitalGoods => "digital-goods",
            Self::Ebooks => "ebooks",
            Self::ImplementationServices => "implementation-services",
            Self::ProfessionalServices => "professional-services",
            Self::Saas => "saas",
            Self::SoftwareProgrammingServices => "software-programming-services",
            Self::Standard => "standard",
            Self::TrainingServices => "training-services",
            Self::WebsiteHosting => "website-hosting",
        }
    }
}

/// Type of payment method used for this payment attempt.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum PaymentMethodType {
    /// Alipay, popular in China.
    Alipay,
    /// Apple Pay on a supported Apple device.
    ApplePay,
    /// Bancontact, popular in Belgium.
    Bancontact,
    /// Credit or debit card.
    Card,
    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
    GooglePay,
    /// iDEAL, popular in the Netherlands.
    Ideal,
    /// Payment recorded offline.
    Offline,
    /// PayPal.
    Paypal,
    /// Payment method not known.
    Unknown,
    /// Wire transfer, sometimes called bank transfer.
    WireTransfer,
}

/// Status of this notification.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum NotificationStatus {
    /// Paddle hasn't yet tried to deliver this notification.
    NotAttempted,
    /// Paddle tried to deliver this notification, but it failed. It's scheduled to be retried.
    NeedsRetry,
    /// Paddle delivered this notification successfully.
    Delivered,
    /// Paddle tried to deliver this notification, but all attempts failed. It's not scheduled to be retried.
    Failed,
}

/// Describes how this notification was created.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum NotificationOrigin {
    /// Notification created when a subscribed event occurred.
    Event,
    /// Notification created when a notification with the origin `event` was replayed.
    Replay,
}

/// Where notifications should be sent for this destination.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum NotificationSettingType {
    /// Deliver to an email address.
    Email,
    /// Deliver to a webhook endpoint.
    Url,
}

/// Whether Paddle should deliver real platform events, simulation events or both to this notification destination.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum TrafficSource {
    /// Deliver real platform events to this notification destination.
    Platform,
    /// Deliver simulation events to this notification destination.
    Simulation,
    /// Deliver platform and simulation events to this notification destination.
    All,
}

/// Operator to use when filtering.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum FilterOperator {
    /// Less than.
    Lt,
    /// Greater than or equal to.
    Gte,
}

#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum TransactionOrigin {
    /// Transaction created via the Paddle API.
    Api,
    /// Transaction created automatically by Paddle as a result of a one-time charge for a subscription.
    SubscriptionCharge,
    /// Transaction created automatically as part of updating a payment method. May be a zero value transaction.
    SubscriptionPaymentMethodChange,
    /// Transaction created automatically by Paddle as a result of a subscription renewal.
    SubscriptionRecurring,
    /// Transaction created automatically by Paddle as a result of an update to a subscription.
    SubscriptionUpdate,
    /// Transaction created automatically by Paddle.js for a checkout.
    Web,
}

/// Status of this report. Set automatically by Paddle.
///
/// Reports are created as `pending` initially, then move to `ready` when they're available to download.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum ReportStatus {
    /// Report created, but Paddle is processing it. It's not yet ready for download.
    Pending,
    /// Report fully processed by Paddle and ready for download.
    Ready,
    /// There was a problem processing this report.
    Failed,
    /// Report has expired and is no longer accessible.
    Expired,
}

/// Field name to filter by.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum AdjustmentsReportFilterName {
    /// Filter by adjustment action. Pass an array of strings containing any valid value for the `action` field against an adjustment.
    Action,
    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
    CurrencyCode,
    /// 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.
    Status,
    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
    UpdatedAt,
}

/// Field name to filter by.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum DiscountsReportFilterName {
    /// Filter by discount type. Pass an array of strings containing any valid value for the `type` field against a discount.
    Type,
    /// Filter by discount status. Pass an array of strings containing any valid value for the `status` field against a discount.
    Status,
    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
    UpdatedAt,
}

/// Field name to filter by.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum BalanceReportFilterName {
    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
    UpdatedAt,
}

/// Field name to filter by.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum ProductPricesReportFilterName {
    /// Filter by product status. Pass an array of strings containing any valid value for the `status` field against a product.
    ProductStatus,
    /// Filter by price status. Pass an array of strings containing any valid value for the `status` field against a price.
    PriceStatus,
    /// Filter by product type. Pass an array of strings containing any valid value for the `type` field against a product.
    ProductType,
    /// Filter by price type. Pass an array of strings containing any valid value for the `type` field against a price.
    PriceType,
    /// Filter by product `updated_at` date. Pass an RFC 3339 datetime string.
    ProductUpdatedAt,
    /// Filter by price `updated_at` date. Pass an RFC 3339 datetime string.
    PriceUpdatedAt,
}

/// Field name to filter by.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum TransactionsReportFilterName {
    /// Filter by collection mode. Pass an array of strings containing any valid value for the `collection_mode` field against a transaction.
    CollectionMode,
    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
    CurrencyCode,
    /// Filter by transaction origin. Pass an array of strings containing any valid value for the origin field against a transaction.
    Origin,
    /// 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.
    Status,
    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
    UpdatedAt,
}

/// Type of report.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum AdjustmentsReportType {
    /// Adjustments reports contain information about refunds, credits, and chargebacks.
    Adjustments,
    /// Adjustments reports contain information about refunds, credits, and chargebacks. The report is broken down by line item level.
    AdjustmentLineItems,
}

impl ReportType for AdjustmentsReportType {
    type FilterName = AdjustmentsReportFilterName;
}

/// Type of report.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum TransactionsReportType {
    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions.
    Transactions,
    /// 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.
    TransactionLineItems,
}

impl ReportType for TransactionsReportType {
    type FilterName = TransactionsReportFilterName;
}

/// Type of report.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum ProductsAndPricesReportType {
    /// Products and prices reports contain information about your products and prices. May include non-catalog products and prices.
    ProductsPrices,
}

impl ReportType for ProductsAndPricesReportType {
    type FilterName = ProductPricesReportFilterName;
}

/// Type of report.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum DiscountsReportType {
    /// Discounts reports contain information about your product and checkout discounts.
    Discounts,
}

impl ReportType for DiscountsReportType {
    type FilterName = DiscountsReportFilterName;
}

/// Type of report.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum BalanceReportType {
    /// Balance reports contain information about your account balance activity, including all movements of funds in and out of your balance.
    Balance,
}

impl ReportType for BalanceReportType {
    type FilterName = BalanceReportFilterName;
}

/// Status of this simulation run log.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum SimulationEventStatus {
    /// Simulation run log is pending. Paddle hasn't yet tried to deliver the simulated event.
    Pending,
    /// Simulation run log was successful. Paddle delivered the simulated event successfully.
    Success,
    /// 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.
    Failed,
    /// Simulation run log aborted. Paddle could not attempt delivery of the simulated event.
    Aborted,
}

/// Status of this simulation run.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum SimulationRunStatus {
    /// Simulation run is pending. Paddle is sending events that are part of this simulation.
    Pending,
    /// Simulation run is completed. Paddle attempted to send events that are part of this simulation.
    Completed,
    /// Simulation run is canceled. Simulation run was canceled before all events were sent.
    Canceled,
}

/// Scenario for a simulation.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum SimulationScenarioType {
    /// Simulates all events sent when a subscription is created.
    SubscriptionCreation,
    /// Simulates all events sent when a subscription is renewed.
    SubscriptionRenewal,
    /// Simulates all events sent when a subscription is paused.
    SubscriptionPause,
    /// Simulates all events sent when a subscription is resumed.
    SubscriptionResume,
    /// Simulates all events sent when a subscription is canceled.
    SubscriptionCancellation,
}

/// Type of simulation.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
pub enum SimulationKind {
    /// Paddle simulates a single event.
    SingleEvent,
    /// Paddle simulates a predefined series of events for a scenario, like all events created when a subscription renews.
    Scenario,
}

/// Status of this payment attempt.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum PaymentAttemptStatus {
    /// Authorized but not captured. Payment attempt is incomplete.
    Authorized,
    /// Authorized but not captured because it has been flagged as potentially fraudulent. Payment attempt is incomplete.
    AuthorizedFlagged,
    /// Previously authorized payment attempt has been canceled. Typically when `authorized_flagged` payment attempts are rejected.
    Canceled,
    /// Payment captured successfully. Payment attempt is complete.
    Captured,
    /// Something went wrong and the payment attempt was unsuccessful. Check the `error_code` for more information.
    Error,
    /// Customer must complete an action for this payment attempt to proceed. Typically means that the payment attempt requires 3DS.
    ActionRequired,
    /// Response required from the bank or payment provider. Transaction is pending.
    PendingNoActionRequired,
    /// New payment attempt created.
    Created,
    /// Payment attempt status not known.
    Unknown,
    /// Payment attempt dropped by Paddle.
    Dropped,
}

/// Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum SubscriptionStatus {
    /// Subscription is active. Paddle is billing for this subscription and related transactions aren't past due.
    Active,
    /// 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.
    Canceled,
    /// 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).
    PastDue,
    /// 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.
    Paused,
    /// Subscription is in trial.
    Trialing,
}

/// 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.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum TransactionStatus {
    /// Transaction is missing required fields. Typically the first stage of a checkout before customer details are captured.
    Draft,
    /// Transaction has all of the required fields to be marked as `billed` or `completed`.
    Ready,
    /// 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.
    Billed,
    /// Transaction is fully paid, but has not yet been processed internally.
    Paid,
    /// Transaction is fully paid and processed.
    Completed,
    /// Transaction has been updated to `canceled`. If an invoice, it's no longer due.
    Canceled,
    /// 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.
    PastDue,
}

/// Kind of change that's scheduled to be applied to this subscription.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum ScheduledChangeAction {
    /// Subscription is scheduled to cancel. Its status changes to `canceled` on the `effective_at` date.
    Cancel,
    /// Subscription is scheduled to pause. Its status changes to `pause` on the `effective_at` date.
    Pause,
    /// Subscription is scheduled to resume. Its status changes to `active` on the `resume_at` date.
    Resume,
}

/// How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum SubscriptionOnPaymentFailure {
    /// In case of payment failure, prevent the change to the subscription from applying.
    PreventChange,
    /// In case of payment failure, apply the change and update the subscription.
    ApplyChange,
}

/// Whether the subscription change results in a prorated credit or a charge.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum UpdateSummaryResultAction {
    /// Changes to the subscription results in a prorated credit.
    Credit,
    /// Changes to the subscription results in a prorated charge.
    Charge,
}

/// How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
/// changes that impact billing.
///
/// For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
/// collects for payment immediately is used.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum ProrationBillingMode {
    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
    /// creates a transaction to collect immediately.
    ProratedImmediately,
    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
    /// schedules them to be billed on the next renewal.
    ProratedNextBillingPeriod,
    /// Paddle does not calculate proration for the subscription changes, creating a transaction to collect for the full
    /// amount immediately.
    FullImmediately,
    /// Paddle does not calculate proration for the subscription changes, scheduling for the full amount for the changes
    /// to be billed on the next renewal.
    FullNextBillingPeriod,
    /// Paddle does not bill for the subscription changes.
    DoNotBill,
}

/// How Paddle should set the billing period for the subscription when resuming. If omitted, defaults to `start_new_billing_period`.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum SubscriptionOnResume {
    /// 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.
    ContinueExistingBillingPeriod,
    /// 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.
    StartNewBillingPeriod,
}

/// Determine whether the generated URL should download the PDF as an attachment saved locally, or open it inline in the browser.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum Disposition {
    /// Generated URL downloads the PDF as an attachment. Browsers typically automatically save the PDF.
    Attachment,
    /// Generated URL displays the PDF inline in the browser. Browsers typically open the PDF in the current tab.
    Inline,
}

#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum PayoutStatus {
    /// Payout is paid.
    Paid,
    /// Payout is unpaid. Typically means it has been created, but is not yet completed.
    Unpaid,
}

#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "strum", strum(serialize_all = "lowercase"))]
pub enum ApiKeyStatus {
    Active,
    Expired,
    Revoked,
}

/// Include related entities in the response.
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "strum", derive(EnumString, Display))]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "strum", strum(serialize_all = "snake_case"))]
pub enum SubscriptionInclude {
    /// Include an object with a preview of the next transaction for this subscription. May include prorated charges that aren't yet billed and one-time charges.
    NextTransaction,
    /// Include an object with a preview of the recurring transaction for this subscription. This is what the customer can expect to be billed when there are no prorated or one-time charges.
    RecurringTransactionDetails,
}