recurly 48.0.0

Recurly client, generated from the OpenAPI spec.
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
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
use serde::{Serialize, Deserialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Account {
    #[serde(rename = "AccountReadOnly")]
    pub account_read_only: AccountReadOnly,
    #[serde(rename = "AccountResponse")]
    pub account_response: AccountResponse,
}
impl std::fmt::Display for Account {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountAcquisition {
    #[serde(rename = "AccountAcquisitionReadOnly")]
    pub account_acquisition_read_only: AccountAcquisitionReadOnly,
    #[serde(rename = "AccountAcquisitionUpdate")]
    pub account_acquisition_update: AccountAcquisitionUpdate,
}
impl std::fmt::Display for AccountAcquisition {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountAcquisitionList {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    pub data: Option<Vec<AccountAcquisition>>,
}
impl std::fmt::Display for AccountAcquisitionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountAcquisitionReadOnly {
    ///When the account acquisition data was created.
    pub created_at: Option<String>,
    pub id: Option<String>,
    pub object: Option<String>,
    pub account: Option<AccountMini>,
    ///When the account acquisition data was last changed.
    pub updated_at: Option<String>,
}
impl std::fmt::Display for AccountAcquisitionReadOnly {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountAcquisitionUpdate {
    pub cost: Option<serde_json::Value>,
    ///The channel through which the account was acquired.
    pub channel: Option<String>,
    ///An arbitrary identifier for the marketing campaign that led to the acquisition of this account.
    pub campaign: Option<String>,
    ///An arbitrary subchannel string representing a distinction/subcategory within a broader channel.
    pub subchannel: Option<String>,
}
impl std::fmt::Display for AccountAcquisitionUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountBalance {
    pub past_due: Option<bool>,
    pub balances: Option<Vec<AccountBalanceAmount>>,
    pub object: Option<String>,
    pub account: Option<AccountMini>,
}
impl std::fmt::Display for AccountBalance {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountBalanceAmount {
    ///Total amount for the prepayment credit invoices in a `processing` state on the account.
    pub processing_prepayment_amount: Option<f64>,
    ///Total amount of the open balances on credit invoices for the account.
    pub available_credit_amount: Option<f64>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///Total amount the account is past due.
    pub amount: Option<f64>,
}
impl std::fmt::Display for AccountBalanceAmount {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountCreate {
    pub acquisition: AccountAcquisitionUpdate,
    pub shipping_addresses: Vec<ShippingAddressCreate>,
    ///The unique identifier of the account. This cannot be changed once the account is created.
    pub code: String,
    #[serde(rename = "AccountUpdate")]
    pub account_update: AccountUpdate,
}
impl std::fmt::Display for AccountCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<Account>>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for AccountList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountMini {
    pub parent_account_id: Option<String>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    pub company: Option<String>,
    pub bill_to: Option<String>,
    pub first_name: Option<String>,
    pub object: Option<String>,
    pub id: Option<String>,
    ///The unique identifier of the account.
    pub code: Option<String>,
    ///The email address used for communicating with this customer.
    pub email: Option<String>,
    pub last_name: Option<String>,
}
impl std::fmt::Display for AccountMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountNote {
    pub account_id: Option<String>,
    pub object: Option<String>,
    pub user: Option<User>,
    pub message: String,
    pub created_at: Option<String>,
    pub id: Option<String>,
}
impl std::fmt::Display for AccountNote {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountNoteList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<AccountNote>>,
}
impl std::fmt::Display for AccountNoteList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountPurchase {
    #[serde(rename = "AccountUpdate")]
    pub account_update: AccountUpdate,
    ///Optional, but if present allows an existing account to be used and updated as part of the purchase.
    pub id: String,
    pub acquisition: AccountAcquisitionUpdate,
    ///The unique identifier of the account. This cannot be changed once the account is created.
    pub code: String,
}
impl std::fmt::Display for AccountPurchase {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AccountReadOnly {
    ///When the account was created.
    pub created_at: Option<String>,
    ///Indicates if the account has a canceled subscription.
    pub has_canceled_subscription: Option<bool>,
    ///Indicates if the account has a subscription that is either active, canceled, future, or paused.
    pub has_live_subscription: Option<bool>,
    ///Indicates if the account has an active subscription.
    pub has_active_subscription: Option<bool>,
    ///When the account was last changed.
    pub updated_at: Option<String>,
    ///If present, when the account was last marked inactive.
    pub deleted_at: Option<String>,
    ///The shipping addresses on the account.
    pub shipping_addresses: Option<Vec<ShippingAddress>>,
    ///The unique token for automatically logging the account in to the hosted management pages. You may automatically log the user into their hosted management pages by directing the user to: `https://{subdomain}.recurly.com/account/{hosted_login_token}`.
    pub hosted_login_token: Option<String>,
    ///Indicates if the account has a paused subscription.
    pub has_paused_subscription: Option<bool>,
    pub object: Option<String>,
    ///Accounts can be either active or inactive.
    pub state: Option<String>,
    ///Indicates if the account has a past due invoice.
    pub has_past_due_invoice: Option<bool>,
    ///Indicates if the account has a future subscription.
    pub has_future_subscription: Option<bool>,
    pub id: Option<String>,
}
impl std::fmt::Display for AccountReadOnly {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountResponse {
    pub last_name: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    pub company: Option<String>,
    pub address: Option<Address>,
    ///The UUID of the parent account associated with this account.
    pub parent_account_id: Option<String>,
    pub billing_info: Option<BillingInfo>,
    ///Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
    pub cc_emails: Option<String>,
    pub first_name: Option<String>,
    ///The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
    pub tax_exempt: Option<bool>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    ///The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
    pub exemption_certificate: Option<String>,
    ///The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
    pub email: Option<String>,
    ///Unique ID to identify an invoice template. Available when the site is on a Pro or Enterprise plan. Used to specify if a non-default invoice template will be used to generate invoices for the account. For sites without multiple invoice templates enabled, the default template will always be used.
    pub invoice_template_id: Option<String>,
    ///An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
    pub bill_to: Option<String>,
    ///The unique identifier of the account. This cannot be changed once the account is created.
    pub code: Option<String>,
    ///A secondary value for the account.
    pub username: Option<String>,
    ///Used to determine the language and locale of emails sent on behalf of the merchant to the customer.
    pub preferred_locale: Option<String>,
    ///The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
    pub vat_number: Option<String>,
}
impl std::fmt::Display for AccountResponse {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AccountUpdate {
    pub last_name: Option<String>,
    ///An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
    pub bill_to: Option<String>,
    ///Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
    pub preferred_locale: Option<String>,
    ///A secondary value for the account.
    pub username: Option<String>,
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    pub address: Option<Address>,
    ///The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
    pub exemption_certificate: Option<String>,
    pub first_name: Option<String>,
    ///The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
    pub email: Option<String>,
    ///Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the `email` field also receives.
    pub cc_emails: Option<String>,
    ///The tax status of the account. `true` exempts tax on the account, `false` applies tax on the account.
    pub tax_exempt: Option<bool>,
    ///The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
    pub vat_number: Option<String>,
    ///The account code of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
    pub parent_account_code: Option<String>,
    ///Unique ID to identify an invoice template.  Available when the site is on a Pro or Enterprise plan.  Used to specify which invoice template, if any, should be used to generate invoices for the account.
    pub invoice_template_id: Option<String>,
    pub billing_info: Option<BillingInfoCreate>,
    ///The UUID of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both `parent_account_code` and `parent_account_id` are passed, the non-blank value in `parent_account_id` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
    pub parent_account_id: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    pub company: Option<String>,
}
impl std::fmt::Display for AccountUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AddOn {
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///The time at which usage totals are reset for billing purposes.
    pub usage_timeframe: Option<String>,
    pub deleted_at: Option<String>,
    pub created_at: Option<String>,
    ///Determines if the quantity field is displayed on the hosted pages for the add-on.
    pub display_quantity: Option<bool>,
    ///Add-ons can be either active or inactive.
    pub state: Option<String>,
    pub object: Option<String>,
    ///Optional, stock keeping unit to link the item to other inventory systems.
    pub external_sku: Option<String>,
    ///Just the important parts.
    pub item: Option<ItemMini>,
    pub plan_id: Option<String>,
    pub updated_at: Option<String>,
    pub id: Option<String>,
    ///Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
    pub optional: Option<bool>,
    ///Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
    pub accounting_code: Option<String>,
    pub percentage_tiers: Option<Vec<PercentageTiersByCurrency>>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///Type of usage, returns usage type if `add_on_type` is `usage`.
    pub usage_type: Option<String>,
    ///Default quantity for the hosted pages.
    pub default_quantity: Option<i64>,
    ///The unique identifier for the add-on within its plan.
    pub code: String,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
    pub usage_percentage: Option<f64>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    /**The pricing model for the add-on.  For more information,
[click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our
[Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
*/
    pub tier_type: Option<String>,
    ///Describes your add-on and will appear in subscribers' invoices.
    pub name: String,
    ///System-generated unique identifier for an measured unit associated with the add-on.
    pub measured_unit_id: Option<String>,
    ///When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
    pub revenue_schedule_type: Option<String>,
    pub tiers: Option<Vec<Tier>>,
    ///The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
    pub usage_calculation_type: Option<String>,
    ///Whether the add-on type is fixed, or usage-based.
    pub add_on_type: Option<String>,
    pub currencies: Option<Vec<AddOnPricing>>,
}
impl std::fmt::Display for AddOn {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddOnCreate {
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_service_type` must be absent.
    pub avalara_service_type: Option<i64>,
    ///Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If `item_code`/`item_id` is part of the request then `tax_code` must be absent.
    pub tax_code: Option<String>,
    ///The unique identifier for the add-on within its plan. If `item_code`/`item_id` is part of the request then `code` must be absent. If `item_code`/`item_id` is not present `code` is required.
    pub code: String,
    /**Type of usage, required if `add_on_type` is `usage`. See our
[Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an
overview of how to configure usage add-ons.
*/
    pub usage_type: Option<String>,
    ///Unique code to identify an item. Available when the `Credit Invoices` feature are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
    pub item_code: Option<String>,
    ///The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
    pub usage_calculation_type: Option<String>,
    ///Determines if the quantity field is displayed on the hosted pages for the add-on.
    pub display_quantity: Option<bool>,
    /**The time at which usage totals are reset for billing purposes.
Allows for `tiered` add-ons to accumulate usage over the course of multiple
billing periods.
*/
    pub usage_timeframe: Option<String>,
    ///Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
    pub optional: Option<bool>,
    #[doc = "* If `item_code`/`item_id` is part of the request and the item\nhas a default currency then `currencies` is optional. If the item does\nnot have a default currency, then `currencies` is required. If `item_code`/`item_id`\nis not present `currencies` is required.\n* If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`,\nthen `currencies` must be absent.\n* Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.\n"]
    pub currencies: Option<Vec<AddOnPricing>>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise.
    pub usage_percentage: Option<f64>,
    /**If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount` for
the desired `currencies`. There must be one tier without an `ending_quantity` value
which represents the final tier.
*/
    pub tiers: Option<Vec<Tier>>,
    ///Describes your add-on and will appear in subscribers' invoices. If `item_code`/`item_id` is part of the request then `name` must be absent. If `item_code`/`item_id` is not present `name` is required.
    pub name: String,
    ///When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
    pub revenue_schedule_type: Option<String>,
    ///Name of a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
    pub measured_unit_name: Option<String>,
    ///Whether the add-on type is fixed, or usage-based.
    pub add_on_type: Option<String>,
    pub plan_id: Option<String>,
    ///System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
    pub measured_unit_id: Option<String>,
    ///Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent.
    pub accounting_code: Option<String>,
    /**The pricing model for the add-on.  For more information,
[click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our
[Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
*/
    pub tier_type: Option<String>,
    ///Default quantity for the hosted pages.
    pub default_quantity: Option<i64>,
    ///System-generated unique identifier for an item. Available when the `Credit Invoices` feature is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
    pub item_id: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_transaction_type` must be absent.
    pub avalara_transaction_type: Option<i64>,
    /**Array of objects which must have at least one set of tiers
per currency and the currency code. The tier_type must be `volume` or `tiered`,
if not, it must be absent. There must be one tier without an `ending_amount` value
which represents the final tier.
*/
    pub percentage_tiers: Option<Vec<PercentageTiersByCurrency>>,
}
impl std::fmt::Display for AddOnCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddOnList {
    pub data: Option<Vec<AddOn>>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for AddOnList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddOnMini {
    ///Optional, stock keeping unit to link the item to other inventory systems.
    pub external_sku: Option<String>,
    ///Whether the add-on type is fixed, or usage-based.
    pub add_on_type: Option<String>,
    ///Type of usage, returns usage type if `add_on_type` is `usage`.
    pub usage_type: Option<String>,
    pub item_id: Option<String>,
    ///Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code.
    pub accounting_code: Option<String>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
    pub usage_percentage: Option<f64>,
    ///The unique identifier for the add-on within its plan.
    pub code: Option<String>,
    pub object: Option<String>,
    ///Describes your add-on and will appear in subscribers' invoices.
    pub name: Option<String>,
    ///System-generated unique identifier for an measured unit associated with the add-on.
    pub measured_unit_id: Option<String>,
    pub id: Option<String>,
}
impl std::fmt::Display for AddOnMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddOnPricing {
    ///Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
    pub unit_amount: Option<f64>,
    /**Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
    pub unit_amount_decimal: Option<String>,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
}
impl std::fmt::Display for AddOnPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddOnUpdate {
    ///Name of a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
    pub measured_unit_name: Option<String>,
    ///Describes your add-on and will appear in subscribers' invoices. If an `Item` is associated to the `AddOn` then `name` must be absent.
    pub name: Option<String>,
    ///Default quantity for the hosted pages.
    pub default_quantity: Option<i64>,
    ///The unique identifier for the add-on within its plan. If an `Item` is associated to the `AddOn` then `code` must be absent.
    pub code: Option<String>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage. Must be omitted otherwise.
    pub usage_percentage: Option<f64>,
    /**If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`,
then currencies must be absent. Must also be absent if `add_on_type` is
`usage` and `usage_type` is `percentage`.
*/
    pub currencies: Option<Vec<AddOnPricing>>,
    /**If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount` for
the desired `currencies`. There must be one tier without an `ending_quantity` value
which represents the final tier.
*/
    pub tiers: Option<Vec<Tier>>,
    ///System-generated unique identifier for a measured unit to be associated with the add-on. Either `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If `measured_unit_id` and `measured_unit_name` are both present, `measured_unit_id` will be used.
    pub measured_unit_id: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_service_type` must be absent.
    pub avalara_service_type: Option<i64>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the add-on is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `AddOn`, then the `avalara_transaction_type` must be absent.
    pub avalara_transaction_type: Option<i64>,
    ///Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`. If an `Item` is associated to the `AddOn` then `tax code` must be absent.
    pub tax_code: Option<String>,
    pub id: Option<String>,
    ///Determines if the quantity field is displayed on the hosted pages for the add-on.
    pub display_quantity: Option<bool>,
    ///The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
    pub usage_calculation_type: Option<String>,
    ///Whether the add-on is optional for the customer to include in their purchase on the hosted payment page. If false, the add-on will be included when a subscription is created through the Recurly UI. However, the add-on will not be included when a subscription is created through the API.
    pub optional: Option<bool>,
    ///When this add-on is invoiced, the line item will use this revenue schedule. If `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the request as the value will be set from the item.
    pub revenue_schedule_type: Option<String>,
    ///Accounting code for invoice line items for this add-on. If no value is provided, it defaults to add-on's code. If an `Item` is associated to the `AddOn` then `accounting code` must be absent.
    pub accounting_code: Option<String>,
    /**`percentage_tiers` is an array of objects, which must have the set of tiers
per currency and the currency code. The tier_type must be `volume` or `tiered`,
if not, it must be absent. There must be one tier without an `ending_amount` value
which represents the final tier.
*/
    pub percentage_tiers: Option<Vec<PercentageTiersByCurrency>>,
}
impl std::fmt::Display for AddOnUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Address {
    pub city: Option<String>,
    ///State or province.
    pub region: Option<String>,
    pub phone: Option<String>,
    pub street2: Option<String>,
    ///Zip or postal code.
    pub postal_code: Option<String>,
    ///Country, 2-letter ISO 3166-1 alpha-2 code.
    pub country: Option<String>,
    pub street1: Option<String>,
}
impl std::fmt::Display for Address {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct AddressWithName {
    pub first_name: Option<String>,
    pub last_name: Option<String>,
}
impl std::fmt::Display for AddressWithName {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct BillingInfo {
    pub account_id: Option<String>,
    pub id: Option<String>,
    pub payment_method: Option<PaymentMethod>,
    ///Customer's VAT number (to avoid having the VAT applied). This is only used for automatically collected invoices.
    pub vat_number: Option<String>,
    pub address: Option<Address>,
    ///Most recent fraud result.
    pub fraud: Option<serde_json::Value>,
    ///When the billing information was created.
    pub created_at: Option<String>,
    pub last_name: Option<String>,
    pub valid: Option<bool>,
    ///The `primary_payment_method` field is used to indicate the primary billing info on the account. The first billing info created on an account will always become primary. This payment method will be used
    pub primary_payment_method: Option<bool>,
    pub updated_by: Option<serde_json::Value>,
    pub first_name: Option<String>,
    pub object: Option<String>,
    pub company: Option<String>,
    ///When the billing information was last changed.
    pub updated_at: Option<String>,
    ///The `backup_payment_method` field is used to indicate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined.
    pub backup_payment_method: Option<bool>,
}
impl std::fmt::Display for BillingInfo {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct BillingInfoCreate {
    pub vat_number: Option<String>,
    ///A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
    pub three_d_secure_action_result_token_id: Option<String>,
    pub card_type: Option<String>,
    pub fraud_session_id: Option<String>,
    ///The `primary_payment_method` field is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` with a value of `true`. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided.
    pub primary_payment_method: Option<bool>,
    ///Use for Online Banking billing info. This should only be used as part of a pending purchase request, when the billing info is nested inside an account object.
    pub online_banking_payment_type: Option<String>,
    pub last_name: Option<String>,
    ///The bank account type. (ACH only)
    pub account_type: Option<String>,
    ///The name associated with the bank account (ACH, SEPA, Bacs only)
    pub name_on_account: Option<String>,
    pub gateway_token: Option<String>,
    pub amazon_billing_agreement_id: Option<String>,
    ///This field and a value of `cpf`, `cnpj` or `cuit` are required if adding a billing info that is an elo or hipercard type in Brazil or in Argentina.
    pub tax_identifier_type: Option<String>,
    ///Credit card number, spaces and dashes are accepted.
    pub number: Option<String>,
    pub address: Option<Address>,
    ///*STRONGLY RECOMMENDED* Customer's IP address when updating their billing information.
    pub ip_address: Option<String>,
    ///Tax identifier is required if adding a billing info that is a consumer card in Brazil or in Argentina. This would be the customer's CPF/CNPJ (Brazil) and CUIT (Argentina). CPF, CNPJ and CUIT are tax identifiers for all residents who pay taxes in Brazil and Argentina respectively.
    pub tax_identifier: Option<String>,
    ///The `backup_payment_method` field is used to designate a billing info as a backup on the account that will be tried if the initial billing info used for an invoice is declined. All payment methods, including the billing info marked `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, if a user sets a different payment method as a backup, the existing backup will no longer be marked as such.
    pub backup_payment_method: Option<bool>,
    pub company: Option<String>,
    ///A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token).
    pub token_id: Option<String>,
    pub gateway_code: Option<String>,
    pub paypal_billing_agreement_id: Option<String>,
    ///The bank account number. (ACH, Bacs only)
    pub account_number: Option<String>,
    pub first_name: Option<String>,
    ///Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
    pub sort_code: Option<String>,
    ///*STRONGLY RECOMMENDED*
    pub cvv: Option<String>,
    pub month: Option<String>,
    ///The International Bank Account Number, up to 34 alphanumeric characters comprising a country code; two check digits; and a number that includes the domestic bank account number, branch identifier, and potential routing information
    pub iban: Option<String>,
    ///The bank's rounting number. (ACH only)
    pub routing_number: Option<String>,
    #[serde(rename = "type")]
    ///The payment method type for a non-credit card based billing info. `bacs` and `becs` are the only accepted values.
    pub type_: Option<String>,
    ///Use for Adyen HPP billing info. This should only be used as part of a pending purchase request, when the billing info is nested inside an account object.
    pub external_hpp_type: Option<String>,
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    pub year: Option<String>,
}
impl std::fmt::Display for BillingInfoCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BillingInfoList {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<BillingInfo>>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for BillingInfoList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BillingInfoVerify {
    ///An identifier for a specific payment gateway.
    pub gateway_code: Option<String>,
}
impl std::fmt::Display for BillingInfoVerify {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BillingInfoVerifyCvv {
    ///Unique security code for a credit card.
    pub verification_value: Option<String>,
}
impl std::fmt::Display for BillingInfoVerifyCvv {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct BinaryFile(pub String);
#[derive(Debug, Serialize, Deserialize)]
pub struct Coupon {
    ///Sets the duration of time the `free_trial_unit` is for.
    pub free_trial_amount: Option<i64>,
    /**- "single_use" coupons applies to the first invoice only.
- "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
*/
    pub duration: Option<String>,
    pub object: Option<String>,
    ///On a bulk coupon, the template from which unique coupon codes are generated.
    pub unique_code_template: Option<String>,
    ///Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
    pub max_redemptions_per_account: Option<i64>,
    ///Whether the discount is for all eligible charges on the account, or only a specific subscription.
    pub redemption_resource: Option<String>,
    ///The date and time the coupon was expired early or reached its `max_redemptions`.
    pub expired_at: Option<String>,
    ///If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
    pub temporal_unit: Option<String>,
    ///A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`.
    pub plans: Option<Vec<PlanMini>>,
    ///If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
    pub temporal_amount: Option<i64>,
    /**A list of items for which this coupon applies. This will be
`null` if `applies_to_all_items=true`.
*/
    pub items: Option<Vec<ItemMini>>,
    pub created_at: Option<String>,
    ///This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
    pub hosted_page_description: Option<String>,
    ///The coupon is valid for one-time, non-plan charges if true.
    pub applies_to_non_plan_charges: Option<bool>,
    ///Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
    pub coupon_type: Option<String>,
    pub updated_at: Option<String>,
    ///A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
    pub max_redemptions: Option<i64>,
    ///Description of the coupon on the invoice.
    pub invoice_description: Option<String>,
    ///The internal name for the coupon.
    pub name: Option<String>,
    ///Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.
    pub free_trial_unit: Option<String>,
    pub id: Option<String>,
    ///The coupon is valid for all plans if true. If false then `plans` will list the applicable plans.
    pub applies_to_all_plans: Option<bool>,
    ///Indicates if the coupon is redeemable, and if it is not, why.
    pub state: Option<String>,
    ///The code the customer enters to redeem the coupon.
    pub code: Option<String>,
    ///The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
    pub redeem_by: Option<String>,
    /**Details of the discount a coupon applies. Will contain a `type`
property and one of the following properties: `percent`, `fixed`, `trial`.
*/
    pub discount: Option<CouponDiscount>,
    ///Will be populated when the Coupon being returned is a `UniqueCouponCode`.
    pub unique_coupon_code: Option<serde_json::Value>,
    ///When this number reaches `max_redemptions` the coupon will no longer be redeemable.
    pub unique_coupon_codes_count: Option<i64>,
    /**The coupon is valid for all items if true. If false then `items`
will list the applicable items.
*/
    pub applies_to_all_items: Option<bool>,
}
impl std::fmt::Display for Coupon {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponBulkCreate {
    ///The quantity of unique coupon codes to generate
    pub number_of_unique_codes: Option<i64>,
}
impl std::fmt::Display for CouponBulkCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CouponCreate {
    ///Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
    pub coupon_type: String,
    #[serde(rename = "CouponUpdate")]
    pub coupon_update: CouponUpdate,
    /**To apply coupon to Items in your Catalog, include a list
of `item_codes` in the request that the coupon will apply to. Or set value
to true to apply to all Items in your Catalog. The following values
are not permitted when `applies_to_all_items` is included: `free_trial_amount`
and `free_trial_unit`.
*/
    pub applies_to_all_items: bool,
    ///The percent of the price discounted by the coupon.  Required if `discount_type` is `percent`.
    pub discount_percent: i64,
    ///Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.  Required if `discount_type` is `free_trial`.
    pub free_trial_unit: String,
    ///If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define the duration that the coupon will be applied to invoices for.
    pub temporal_unit: String,
    ///The coupon is valid for all plans if true. If false then `plans` will list the applicable plans.
    pub applies_to_all_plans: bool,
    ///If `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for.
    pub temporal_amount: i64,
    /**On a bulk coupon, the template from which unique coupon codes are generated.
- You must start the template with your coupon_code wrapped in single quotes.
- Outside of single quotes, use a 9 for a character that you want to be a random number.
- Outside of single quotes, use an "x" for a character that you want to be a random letter.
- Outside of single quotes, use an * for a character that you want to be a random number or letter.
- Use single quotes ' ' for characters that you want to remain static. These strings can be alphanumeric and may contain a - _ or +.
For example: "'abc-'****'-def'"
*/
    pub unique_code_template: String,
    ///Sets the duration of time the `free_trial_unit` is for. Required if `discount_type` is `free_trial`.
    pub free_trial_amount: i64,
    /**List of plan codes to which this coupon applies. Required
if `applies_to_all_plans` is false. Overrides `applies_to_all_plans`
when `applies_to_all_plans` is true.
*/
    pub plan_codes: Vec<String>,
    /**List of item codes to which this coupon applies. Sending
`item_codes` is only permitted when `applies_to_all_items` is set to false.
The following values are not permitted when `item_codes` is included:
`free_trial_amount` and `free_trial_unit`.
*/
    pub item_codes: Vec<String>,
    ///The coupon is valid for one-time, non-plan charges if true.
    pub applies_to_non_plan_charges: bool,
    ///The code the customer enters to redeem the coupon.
    pub code: String,
    /**This field does not apply when the discount_type is `free_trial`.
- "single_use" coupons applies to the first invoice only.
- "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
- "forever" coupons will apply to invoices forever.
*/
    pub duration: String,
    ///Whether the discount is for all eligible charges on the account, or only a specific subscription.
    pub redemption_resource: String,
    ///The type of discount provided by the coupon (how the amount discounted is calculated)
    pub discount_type: String,
    ///Fixed discount currencies by currency. Required if the coupon type is `fixed`. This parameter should contain the coupon discount values
    pub currencies: Vec<CouponPricing>,
}
impl std::fmt::Display for CouponCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CouponDiscount {
    #[serde(rename = "type")]
    pub type_: Option<String>,
    ///This is only present when `type=free_trial`.
    pub trial: Option<serde_json::Value>,
    ///This is only present when `type=fixed`.
    pub currencies: Option<Vec<CouponDiscountPricing>>,
    ///This is only present when `type=percent`.
    pub percent: Option<i64>,
}
impl std::fmt::Display for CouponDiscount {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponDiscountPricing {
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///Value of the fixed discount that this coupon applies.
    pub amount: Option<f64>,
}
impl std::fmt::Display for CouponDiscountPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponList {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<Coupon>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for CouponList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CouponMini {
    /**Details of the discount a coupon applies. Will contain a `type`
property and one of the following properties: `percent`, `fixed`, `trial`.
*/
    pub discount: Option<CouponDiscount>,
    ///The code the customer enters to redeem the coupon.
    pub code: Option<String>,
    ///Indicates if the coupon is redeemable, and if it is not, why.
    pub state: Option<String>,
    pub id: Option<String>,
    ///The internal name for the coupon.
    pub name: Option<String>,
    ///Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
    pub coupon_type: Option<String>,
    pub object: Option<String>,
    ///The date and time the coupon was expired early or reached its `max_redemptions`.
    pub expired_at: Option<String>,
}
impl std::fmt::Display for CouponMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponPricing {
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///The fixed discount (in dollars) for the corresponding currency.
    pub discount: Option<f64>,
}
impl std::fmt::Display for CouponPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CouponRedemption {
    pub subscription_id: Option<String>,
    pub account: Option<AccountMini>,
    pub state: Option<String>,
    pub created_at: Option<String>,
    pub updated_at: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///The amount that was discounted upon the application of the coupon, formatted with the currency.
    pub discounted: Option<f64>,
    pub id: Option<String>,
    ///The date and time the redemption was removed from the account (un-redeemed).
    pub removed_at: Option<String>,
    pub coupon: Option<Coupon>,
    ///Will always be `coupon`.
    pub object: Option<String>,
}
impl std::fmt::Display for CouponRedemption {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponRedemptionCreate {
    pub subscription_id: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    pub coupon_id: String,
}
impl std::fmt::Display for CouponRedemptionCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponRedemptionList {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<CouponRedemption>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for CouponRedemptionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CouponRedemptionMini {
    pub id: Option<String>,
    ///The amount that was discounted upon the application of the coupon, formatted with the currency.
    pub discounted: Option<f64>,
    pub created_at: Option<String>,
    pub coupon: Option<CouponMini>,
    ///Will always be `coupon`.
    pub object: Option<String>,
    pub state: Option<String>,
}
impl std::fmt::Display for CouponRedemptionMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CouponUpdate {
    ///This description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
    pub hosted_description: Option<String>,
    ///Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
    pub max_redemptions_per_account: Option<i64>,
    ///A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
    pub max_redemptions: Option<i64>,
    ///The internal name for the coupon.
    pub name: Option<String>,
    ///Description of the coupon on the invoice.
    pub invoice_description: Option<String>,
    ///The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
    pub redeem_by_date: Option<String>,
}
impl std::fmt::Display for CouponUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CreditPayment {
    pub applied_to_invoice: Option<InvoiceMini>,
    pub original_invoice: Option<InvoiceMini>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    pub object: Option<String>,
    ///For credit payments with action `refund`, this is the credit payment that was refunded.
    pub original_credit_payment_id: Option<String>,
    pub created_at: Option<String>,
    pub voided_at: Option<String>,
    pub refund_transaction: Option<Transaction>,
    pub updated_at: Option<String>,
    ///Total credit payment amount applied to the charge invoice.
    pub amount: Option<f64>,
    ///The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
    pub uuid: Option<String>,
    ///The action for which the credit was created.
    pub action: Option<String>,
    pub id: Option<String>,
    pub account: Option<AccountMini>,
}
impl std::fmt::Display for CreditPayment {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CreditPaymentList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<CreditPayment>>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for CreditPaymentList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CustomField {
    ///Fields must be created in the UI before values can be assigned to them.
    pub name: String,
    ///Any values that resemble a credit card number or security code (CVV/CVC) will be rejected.
    pub value: String,
}
impl std::fmt::Display for CustomField {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CustomFieldDefinition {
    pub updated_at: Option<String>,
    ///Displayed as a tooltip when editing the field in the Recurly admin UI.
    pub tooltip: Option<String>,
    ///Used to label the field when viewing and editing the field in Recurly's admin UI.
    pub display_name: Option<String>,
    pub created_at: Option<String>,
    pub id: Option<String>,
    pub object: Option<String>,
    pub related_type: Option<String>,
    ///Used by the API to identify the field or reading and writing. The name can only be used once per Recurly object type.
    pub name: Option<String>,
    /**The access control applied inside Recurly's admin UI:
- `api_only` - No one will be able to view or edit this field's data via the admin UI.
- `read_only` - Users with the Customers role will be able to view this field's data via the admin UI, but
  editing will only be available via the API.
- `write` - Users with the Customers role will be able to view and edit this field's data via the admin UI.
*/
    pub user_access: Option<String>,
    ///Definitions are initially soft deleted, and once all the values are removed from the accouts or subscriptions, will be hard deleted an no longer visible.
    pub deleted_at: Option<String>,
}
impl std::fmt::Display for CustomFieldDefinition {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CustomFieldDefinitionList {
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<CustomFieldDefinition>>,
}
impl std::fmt::Display for CustomFieldDefinitionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CustomFields(pub Vec<CustomField>);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CustomerPermission {
    ///Customer permission name.
    pub name: Option<String>,
    ///Description of customer permission.
    pub description: Option<String>,
    ///Customer permission ID.
    pub id: Option<String>,
    ///Customer permission code.
    pub code: Option<String>,
    ///It will always be "customer_permission".
    pub object: Option<String>,
}
impl std::fmt::Display for CustomerPermission {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct DunningCampaign {
    ///Campaign description.
    pub description: Option<String>,
    pub id: Option<String>,
    pub object: Option<String>,
    ///Campaign code.
    pub code: Option<String>,
    ///Whether or not this is the default campaign for accounts or plans without an assigned dunning campaign.
    pub default_campaign: Option<bool>,
    ///Dunning Cycle settings.
    pub dunning_cycles: Option<Vec<DunningCycle>>,
    ///When the current campaign was created in Recurly.
    pub created_at: Option<String>,
    ///When the current campaign was updated in Recurly.
    pub updated_at: Option<String>,
    ///Campaign name.
    pub name: Option<String>,
    ///When the current campaign was deleted in Recurly.
    pub deleted_at: Option<String>,
}
impl std::fmt::Display for DunningCampaign {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct DunningCampaignList {
    pub data: Option<Vec<DunningCampaign>>,
    ///Will always be List.
    pub object: Option<String>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for DunningCampaignList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct DunningCampaignsBulkUpdate(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize)]
pub struct DunningCampaignsBulkUpdateResponse(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct DunningCycle {
    ///Current campaign version.
    pub version: Option<i64>,
    ///When the current settings were updated in Recurly.
    pub updated_at: Option<String>,
    ///The number of days after a transaction failure before the first dunning email is sent.
    pub first_communication_interval: Option<i64>,
    ///When the current settings were created in Recurly.
    pub created_at: Option<String>,
    #[serde(rename = "type")]
    ///The type of invoice this cycle applies to.
    pub type_: Option<String>,
    ///Whether the invoice should be failed at the end of the dunning cycle.
    pub fail_invoice: Option<bool>,
    ///Whether the dunning settings will be applied to manual trials. Only applies to trial cycles.
    pub applies_to_manual_trial: Option<bool>,
    ///Whether or not to send an extra email immediately to customers whose initial payment attempt fails with either a hard decline or invalid billing info.
    pub send_immediately_on_hard_decline: Option<bool>,
    ///The number of days between the first dunning email being sent and the end of the dunning cycle.
    pub total_dunning_days: Option<i64>,
    ///Whether the subscription(s) should be cancelled at the end of the dunning cycle.
    pub expire_subscription: Option<bool>,
    ///Dunning intervals.
    pub intervals: Option<Vec<DunningInterval>>,
    ///The number of days between a transaction failure and the end of the dunning cycle.
    pub total_recycling_days: Option<i64>,
}
impl std::fmt::Display for DunningCycle {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct DunningInterval(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Empty {}
impl std::fmt::Display for Empty {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Entitlement {
    pub customer_permission: Option<CustomerPermission>,
    ///Time object was created.
    pub created_at: Option<String>,
    ///Time the object was last updated
    pub updated_at: Option<String>,
    ///Entitlement
    pub object: Option<String>,
    ///Subscription or item that granted the customer permission.
    pub granted_by: Option<Vec<GrantedBy>>,
}
impl std::fmt::Display for Entitlement {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Entitlements {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<Entitlement>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub object: Option<String>,
}
impl std::fmt::Display for Entitlements {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Error {
    #[serde(rename = "type")]
    pub type_: Option<String>,
    pub params: Option<Vec<serde_json::Value>>,
    pub message: Option<String>,
}
impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ErrorMayHaveTransaction {
    #[serde(rename = "Error")]
    pub error: Error,
    ///This is only included on errors with `type=transaction`.
    pub transaction_error: serde_json::Value,
}
impl std::fmt::Display for ErrorMayHaveTransaction {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExportDates {
    pub dates: Option<Vec<String>>,
    pub object: Option<String>,
}
impl std::fmt::Display for ExportDates {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExportFile {
    #[serde(rename = "md5sum")]
    ///MD5 hash of the export file.
    pub md5_sum: Option<String>,
    ///Name of the export file.
    pub name: Option<String>,
    ///A presigned link to download the export file.
    pub href: Option<String>,
}
impl std::fmt::Display for ExportFile {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExportFiles {
    pub object: Option<String>,
    pub files: Option<Vec<ExportFile>>,
}
impl std::fmt::Display for ExportFiles {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ExternalProduct {
    pub object: Option<String>,
    ///When the external product was updated in Recurly.
    pub updated_at: Option<String>,
    ///System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`.
    pub id: Option<String>,
    ///Name to identify the external product in Recurly.
    pub name: Option<String>,
    ///When the external product was created in Recurly.
    pub created_at: Option<String>,
    ///List of external product references of the external product.
    pub external_product_references: Option<Vec<ExternalProductReferenceMini>>,
    ///Just the important parts.
    pub plan: Option<PlanMini>,
}
impl std::fmt::Display for ExternalProduct {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExternalProductList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<ExternalProduct>>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for ExternalProductList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExternalProductReferenceMini {
    ///Source connection platform.
    pub external_connection_type: Option<String>,
    pub object: Option<String>,
    ///A code which associates the external product to a corresponding object or resource in an external platform like the Apple App Store or Google Play Store.
    pub reference_code: Option<String>,
    ///System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`.
    pub id: Option<String>,
    ///When the external product was created in Recurly.
    pub created_at: Option<String>,
    ///When the external product was updated in Recurly.
    pub updated_at: Option<String>,
}
impl std::fmt::Display for ExternalProductReferenceMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExternalResourceMini {
    ///System-generated unique identifier for an external resource ID, e.g. `e28zov4fw0v2`.
    pub id: Option<String>,
    ///Identifier or URL reference where the resource is canonically available in the external platform.
    pub external_object_reference: Option<String>,
    pub object: Option<String>,
}
impl std::fmt::Display for ExternalResourceMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ExternalSubscription {
    pub object: Option<String>,
    ///An indication of whether or not the external subscription will auto-renew at the expiration date.
    pub auto_renew: Option<bool>,
    ///When a new billing event occurred on the external subscription in conjunction with a recent billing period, reactivation or upgrade/downgrade.
    pub last_purchased: Option<String>,
    ///An indication of the quantity of a subscribed item's quantity.
    pub quantity: Option<i64>,
    ///System-generated unique identifier for an external subscription ID, e.g. `e28zov4fw0v2`.
    pub id: Option<String>,
    ///Identifier of the app that generated the external subscription.
    pub app_identifier: Option<String>,
    ///When the external subscription expires in the external platform.
    pub expires_at: Option<String>,
    ///External Product Reference details
    pub external_product_reference: Option<ExternalProductReferenceMini>,
    ///When the external subscription was created in Recurly.
    pub created_at: Option<String>,
    pub account: Option<AccountMini>,
    ///When the external subscription was updated in Recurly.
    pub updated_at: Option<String>,
    ///When the external subscription was activated in the external platform.
    pub activated_at: Option<String>,
    pub external_resource: Option<ExternalResourceMini>,
}
impl std::fmt::Display for ExternalSubscription {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExternalSubscriptionList {
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<ExternalSubscription>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
}
impl std::fmt::Display for ExternalSubscriptionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ExternalTransaction {
    ///The total amount of the transcaction. Cannot excceed the invoice total.
    pub amount: Option<f64>,
    ///Datetime that the external payment was collected. Defaults to current datetime.
    pub collected_at: Option<String>,
    ///Used as the transaction's description.
    pub description: Option<String>,
    ///Payment method used for external transaction.
    pub payment_method: Option<String>,
}
impl std::fmt::Display for ExternalTransaction {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct GrantedBy {
    pub object: Option<String>,
    ///The ID of the subscription or external subscription that grants the permission to the account.
    pub id: Option<String>,
}
impl std::fmt::Display for GrantedBy {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Invoice {
    pub object: Option<String>,
    pub address: Option<InvoiceAddress>,
    ///The final total on this invoice. The summation of invoice charges, discounts, credits, and tax.
    pub total: Option<f64>,
    ///The total tax on this invoice.
    pub tax: Option<f64>,
    pub tax_info: Option<TaxInfo>,
    ///On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
    pub previous_invoice_id: Option<String>,
    ///The event that created the invoice.
    pub origin: Option<String>,
    ///If the invoice is charging or refunding for one or more subscriptions, these are their IDs.
    pub subscription_ids: Option<Vec<String>>,
    ///This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
    pub terms_and_conditions: Option<String>,
    pub updated_at: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    pub account: Option<AccountMini>,
    pub transactions: Option<Vec<Transaction>>,
    ///The summation of charges and credits, before discounts and taxes.
    pub subtotal: Option<f64>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    ///Last communication attempt.
    pub final_dunning_event: Option<bool>,
    ///Date invoice is due. This is the date the net terms are reached.
    pub due_at: Option<String>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    ///This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes.
    pub customer_notes: Option<String>,
    pub credit_payments: Option<Vec<CreditPayment>>,
    ///The outstanding balance remaining on this invoice.
    pub balance: Option<f64>,
    #[serde(rename = "type")]
    ///Invoices are either charge, credit, or legacy invoices.
    pub type_: Option<String>,
    ///Identifies if the invoice has more line items than are returned in `line_items`. If `has_more_line_items` is `true`, then a request needs to be made to the `list_invoice_line_items` endpoint.
    pub has_more_line_items: Option<bool>,
    pub uuid: Option<String>,
    pub shipping_address: Option<ShippingAddress>,
    pub state: Option<String>,
    ///The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
    pub billing_info_id: Option<String>,
    ///An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
    pub collection_method: Option<String>,
    ///Total discounts applied to this invoice.
    pub discount: Option<f64>,
    pub id: Option<String>,
    ///VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method.
    pub vat_number: Option<String>,
    ///The total amount of successful payments transaction on this invoice.
    pub paid: Option<f64>,
    pub created_at: Option<String>,
    ///Date invoice was marked paid or failed.
    pub closed_at: Option<String>,
    ///If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
    pub number: Option<String>,
    ///The refundable amount on a charge invoice. It will be null for all other invoices.
    pub refundable_amount: Option<f64>,
    ///VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
    pub vat_reverse_charge_notes: Option<String>,
    pub line_items: Option<Vec<LineItem>>,
    ///Unique ID to identify the dunning campaign used when dunning the invoice. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign.
    pub dunning_campaign_id: Option<String>,
    ///Number of times the event was sent.
    pub dunning_events_sent: Option<i64>,
}
impl std::fmt::Display for Invoice {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceAddress {
    pub name_on_account: Option<String>,
    pub company: Option<String>,
}
impl std::fmt::Display for InvoiceAddress {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceCollect {
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    ///A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
    pub three_d_secure_action_result_token_id: Option<String>,
    ///The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
    pub billing_info_id: Option<String>,
}
impl std::fmt::Display for InvoiceCollect {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct InvoiceCollection {
    pub object: Option<String>,
    pub credit_invoices: Option<Vec<Invoice>>,
    pub charge_invoice: Option<Invoice>,
}
impl std::fmt::Display for InvoiceCollection {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceCreate {
    ///VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
    pub vat_reverse_charge_notes: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
    ///An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
    pub collection_method: Option<String>,
    ///This will default to the Customer Notes text specified on the Invoice Settings for credit invoices. Specify customer notes to add or override Customer Notes on credit invoices.
    pub credit_customer_notes: Option<String>,
    ///This will default to the Customer Notes text specified on the Invoice Settings for charge invoices. Specify custom notes to add or override Customer Notes on charge invoices.
    pub charge_customer_notes: Option<String>,
    ///This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
    pub terms_and_conditions: Option<String>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
}
impl std::fmt::Display for InvoiceCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<Invoice>>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for InvoiceList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceMini {
    pub object: Option<String>,
    pub number: Option<String>,
    pub state: Option<String>,
    #[serde(rename = "type")]
    pub type_: Option<String>,
    pub id: Option<String>,
}
impl std::fmt::Display for InvoiceMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct InvoiceRefund {
    ///The line items to be refunded. This is required when `type=line_items`.
    pub line_items: Option<Vec<LineItemRefund>>,
    /**Indicates how the invoice should be refunded when both a credit and transaction are present on the invoice:
- `transaction_first` – Refunds the transaction first, then any amount is issued as credit back to the account. Default value when Credit Invoices feature is enabled.
- `credit_first` – Issues credit back to the account first, then refunds any remaining amount back to the transaction. Default value when Credit Invoices feature is not enabled.
- `all_credit` – Issues credit to the account for the entire amount of the refund. Only available when the Credit Invoices feature is enabled.
- `all_transaction` – Refunds the entire amount back to transactions, using transactions from previous invoices if necessary. Only available when the Credit Invoices feature is enabled.
*/
    pub refund_method: Option<String>,
    /**Used as the Customer Notes on the credit invoice.

This field can only be include when the Credit Invoices feature is enabled.
*/
    pub credit_customer_notes: Option<String>,
    /**The amount to be refunded. The amount will be split between the line items.
If no amount is specified, it will default to refunding the total refundable amount on the invoice.
*/
    pub amount: Option<f64>,
    #[serde(rename = "type")]
    ///The type of refund. Amount and line items cannot both be specified in the request.
    pub type_: String,
    /**Indicates that the refund was settled outside of Recurly, and a manual transaction should be created to track it in Recurly.

Required when:
- refunding a manually collected charge invoice, and `refund_method` is not `all_credit`
- refunding a credit invoice that refunded manually collecting invoices
- refunding a credit invoice for a partial amount

This field can only be included when the Credit Invoices feature is enabled.
*/
    pub external_refund: Option<serde_json::Value>,
}
impl std::fmt::Display for InvoiceRefund {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceTemplate {
    pub id: Option<String>,
    ///When the invoice template was updated in Recurly.
    pub updated_at: Option<String>,
    ///Invoice template name.
    pub name: Option<String>,
    ///Invoice template code.
    pub code: Option<String>,
    ///Invoice template description.
    pub description: Option<String>,
    ///When the invoice template was created in Recurly.
    pub created_at: Option<String>,
}
impl std::fmt::Display for InvoiceTemplate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceTemplateList {
    pub data: Option<Vec<InvoiceTemplate>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for InvoiceTemplateList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct InvoiceUpdate {
    pub address: Option<InvoiceAddress>,
    ///VAT Reverse Charge Notes are editable only if there was a VAT reverse charge applied to the invoice.
    pub vat_reverse_charge_notes: Option<String>,
    ///Customer notes are an optional note field.
    pub customer_notes: Option<String>,
    ///This identifies the PO number associated with the invoice. Not editable for credit invoices.
    pub po_number: Option<String>,
    ///Terms and conditions are an optional note field. Not editable for credit invoices.
    pub terms_and_conditions: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. Changing Net terms changes due_on, and the invoice could move between past due and pending.
    pub net_terms: Option<i64>,
}
impl std::fmt::Display for InvoiceUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Item {
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    pub object: Option<String>,
    ///This name describes your item and will appear on the invoice when it's purchased on a one time basis.
    pub name: Option<String>,
    pub updated_at: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    pub deleted_at: Option<String>,
    pub id: Option<String>,
    ///Optional, description.
    pub description: Option<String>,
    pub created_at: Option<String>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///`true` exempts tax on the item, `false` applies tax on the item.
    pub tax_exempt: Option<bool>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///Unique code to identify the item.
    pub code: Option<String>,
    pub currencies: Option<Vec<Pricing>>,
    ///The current state of the item.
    pub state: Option<String>,
    ///Accounting code for invoice line items.
    pub accounting_code: Option<String>,
    ///Optional, stock keeping unit to link the item to other inventory systems.
    pub external_sku: Option<String>,
}
impl std::fmt::Display for Item {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ItemCreate {
    ///Accounting code for invoice line items.
    pub accounting_code: Option<String>,
    pub currencies: Option<Vec<Pricing>>,
    ///Optional, description.
    pub description: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    ///This name describes your item and will appear on the invoice when it's purchased on a one time basis.
    pub name: String,
    ///Unique code to identify the item.
    pub code: String,
    pub revenue_schedule_type: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///`true` exempts tax on the item, `false` applies tax on the item.
    pub tax_exempt: Option<bool>,
    ///Optional, stock keeping unit to link the item to other inventory systems.
    pub external_sku: Option<String>,
}
impl std::fmt::Display for ItemCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ItemList {
    ///Will always be List.
    pub object: Option<String>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<Item>>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
}
impl std::fmt::Display for ItemList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ItemMini {
    ///Unique code to identify the item.
    pub code: Option<String>,
    pub object: Option<String>,
    ///The current state of the item.
    pub state: Option<String>,
    pub id: Option<String>,
    ///Optional, description.
    pub description: Option<String>,
    ///This name describes your item and will appear on the invoice when it's purchased on a one time basis.
    pub name: Option<String>,
}
impl std::fmt::Display for ItemMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ItemUpdate {
    ///Unique code to identify the item.
    pub code: Option<String>,
    ///Optional, stock keeping unit to link the item to other inventory systems.
    pub external_sku: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    ///Optional, description.
    pub description: Option<String>,
    ///`true` exempts tax on the item, `false` applies tax on the item.
    pub tax_exempt: Option<bool>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///This name describes your item and will appear on the invoice when it's purchased on a one time basis.
    pub name: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///Accounting code for invoice line items.
    pub accounting_code: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    pub currencies: Option<Vec<Pricing>>,
}
impl std::fmt::Display for ItemUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct LineItem {
    ///If the line item is a charge or credit for an add-on, this is its code.
    pub add_on_code: Option<String>,
    ///Once the line item has been invoiced this will be the invoice's ID.
    pub invoice_id: Option<String>,
    ///This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
    pub quantity: Option<i64>,
    ///Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
    pub tax_inclusive: Option<bool>,
    ///System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
    pub item_id: Option<String>,
    ///Positive amount for a charge, negative amount for a credit.
    pub unit_amount_decimal: Option<String>,
    ///For plan-related line items this will be the plan's code, for add-on related line items it will be the add-on's code. For item-related line items it will be the item's `external_sku`.
    pub product_code: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    pub tax_info: Option<TaxInfo>,
    pub shipping_address: Option<ShippingAddress>,
    ///If the line item is a charge or credit for a subscription, this is its ID.
    pub subscription_id: Option<String>,
    ///If the line item is a charge or credit for a plan or add-on, this is the plan's code.
    pub plan_code: Option<String>,
    ///A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.
    pub quantity_decimal: Option<String>,
    #[serde(rename = "type")]
    ///Charges are positive line items that debit the account. Credits are negative line items that credit the account.
    pub type_: Option<String>,
    /**Category to describe the role of a line item on a legacy invoice:
- "charges" refers to charges being billed for on this invoice.
- "credits" refers to refund or proration credits. This portion of the invoice can be considered a credit memo.
- "applied_credits" refers to previous credits applied to this invoice. See their original_line_item_id to determine where the credit first originated.
- "carryforwards" can be ignored. They exist to consume any remaining credit balance. A new credit with the same amount will be created and placed back on the account.
*/
    pub legacy_category: Option<String>,
    ///`true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
    pub tax_exempt: Option<bool>,
    pub refund: Option<bool>,
    ///`quantity * unit_amount`
    pub subtotal: Option<f64>,
    ///If this date is provided, it indicates the end of a time range.
    pub end_date: Option<String>,
    ///The tax amount for the line item.
    pub tax: Option<f64>,
    ///A floating-point alternative to Refunded Quantity. For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds). The Decimal Quantity feature must be enabled to utilize this field.
    pub refunded_quantity_decimal: Option<String>,
    ///The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
    pub uuid: Option<String>,
    pub object: Option<String>,
    ///If the line item is a charge or credit for a plan or add-on, this is the plan's ID.
    pub plan_id: Option<String>,
    ///Internal accounting code to help you reconcile your revenue to the correct ledger. Line items created as part of a subscription invoice will use the plan or add-on's accounting code, otherwise the value will only be present if you define an accounting code when creating the line item.
    pub accounting_code: Option<String>,
    ///The UUID of the account responsible for originating the line item.
    pub bill_for_account_id: Option<String>,
    ///For refund charges, the quantity being refunded. For non-refund charges, the total quantity refunded (possibly over multiple refunds).
    pub refunded_quantity: Option<i64>,
    ///`(quantity * unit_amount) - (discount + tax)`
    pub amount: Option<f64>,
    ///The amount of credit from this line item that was applied to the invoice.
    pub credit_applied: Option<f64>,
    ///If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date.
    pub start_date: Option<String>,
    ///The discount applied to the line item.
    pub discount: Option<f64>,
    ///A credit created from an original charge will have the value of the charge's origin.
    pub origin: Option<String>,
    pub id: Option<String>,
    ///Unique code to identify an item. Available when the Credit Invoices feature is enabled.
    pub item_code: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///Description that appears on the invoice. For subscription related items this will be filled in automatically.
    pub description: Option<String>,
    ///Optional Stock Keeping Unit assigned to an item. Available when the Credit Invoices feature is enabled.
    pub external_sku: Option<String>,
    ///Once the line item has been invoiced this will be the invoice's number. If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
    pub invoice_number: Option<String>,
    ///The invoice where the credit originated. Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.
    pub original_line_item_invoice_id: Option<String>,
    ///Positive amount for a charge, negative amount for a credit.
    pub unit_amount: Option<f64>,
    ///`true` if the line item is taxable, `false` if it is not.
    pub taxable: Option<bool>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///The reason the credit was given when line item is `type=credit`.
    pub credit_reason_code: Option<String>,
    ///When a line item has been prorated, this is the rate of the proration. Proration rates were made available for line items created after March 30, 2017. For line items created prior to that date, the proration rate will be `null`, even if the line item was prorated.
    pub proration_rate: Option<f64>,
    ///Pending line items are charges or credits on an account that have not been applied to an invoice yet. Invoiced line items will always have an `invoice_id` value.
    pub state: Option<String>,
    ///When the line item was created.
    pub created_at: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///Will only have a value if the line item is a credit created from a previous credit, or if the credit was created from a charge refund.
    pub previous_line_item_id: Option<String>,
    ///When the line item was last changed.
    pub updated_at: Option<String>,
    pub account: Option<AccountMini>,
    ///If the line item is a charge or credit for an add-on this is its ID.
    pub add_on_id: Option<String>,
}
impl std::fmt::Display for LineItem {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct LineItemCreate {
    ///If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date. Defaults to the current date-time.
    pub start_date: Option<String>,
    ///Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
    pub tax_inclusive: Option<bool>,
    ///`true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
    pub tax_exempt: Option<bool>,
    ///This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
    pub quantity: Option<i64>,
    ///Unique code to identify an item. Available when the Credit Invoices feature is enabled.
    pub item_code: Option<String>,
    ///The reason the credit was given when line item is `type=credit`. When the Credit Invoices feature is enabled, the value can be set and will default to `general`. When the Credit Invoices feature is not enabled, the value will always be `null`.
    pub credit_reason_code: Option<String>,
    ///Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements.  Origin `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to true.  This origin creates a charge and opposite credit on the account to be used for future invoices.
    pub origin: Option<String>,
    /**A positive or negative amount with `type=charge` will result in a positive `unit_amount`.
A positive or negative amount with `type=credit` will result in a negative `unit_amount`.
If `item_code`/`item_id` is present, `unit_amount` can be passed in, to override the
`Item`'s `unit_amount`. If `item_code`/`item_id` is not present then `unit_amount` is required.
*/
    pub unit_amount: f64,
    pub revenue_schedule_type: Option<String>,
    ///Description that appears on the invoice. If `item_code`/`item_id` is part of the request then `description` must be absent.
    pub description: Option<String>,
    ///Accounting Code for the `LineItem`. If `item_code`/`item_id` is part of the request then `accounting_code` must be absent.
    pub accounting_code: Option<String>,
    ///If this date is provided, it indicates the end of a time range.
    pub end_date: Option<String>,
    ///Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `LineItem`, then the `avalara_service_type` must be absent.
    pub avalara_service_type: Option<i64>,
    #[serde(rename = "type")]
    ///Line item type. If `item_code`/`item_id` is present then `type` should not be present. If `item_code`/`item_id` is not present then `type` is required.
    pub type_: String,
    ///3-letter ISO 4217 currency code. If `item_code`/`item_id` is part of the request then `currency` is optional, if the site has a single default currency. `currency` is required if `item_code`/`item_id` is present, and there are multiple currencies defined on the site. If `item_code`/`item_id` is not present `currency` is required.
    pub currency: String,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types. If an `Item` is associated to the `LineItem`, then the `avalara_transaction_type` must be absent.
    pub avalara_transaction_type: Option<i64>,
    ///Optional field to track a product code or SKU for the line item. This can be used to later reporting on product purchases. For Vertex tax calculations, this field will be used as the Vertex `product` field. If `item_code`/`item_id` is part of the request then `product_code` must be absent.
    pub product_code: Option<String>,
    ///System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
    pub item_id: Option<String>,
}
impl std::fmt::Display for LineItemCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct LineItemList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<LineItem>>,
}
impl std::fmt::Display for LineItemList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct LineItemRefund {
    ///A floating-point alternative to Quantity. If this value is present, it will be used in place of Quantity for calculations, and Quantity will be the rounded integer value of this number. This field supports up to 9 decimal places. The Decimal Quantity feature must be enabled to utilize this field.
    pub quantity_decimal: Option<String>,
    ///Line item quantity to be refunded.
    pub quantity: Option<i64>,
    pub id: Option<String>,
    /**Set to `true` if the line item should be prorated; set to `false` if not.
This can only be used on line items that have a start and end date.
*/
    pub prorate: Option<bool>,
}
impl std::fmt::Display for LineItemRefund {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct MeasuredUnit {
    pub object: Option<String>,
    ///Optional internal description.
    pub description: Option<String>,
    ///Display name for the measured unit. Can only contain spaces, underscores and must be alphanumeric.
    pub display_name: Option<String>,
    pub deleted_at: Option<String>,
    ///The current state of the measured unit.
    pub state: Option<String>,
    pub id: Option<String>,
    ///Unique internal name of the measured unit on your site.
    pub name: Option<String>,
    pub created_at: Option<String>,
    pub updated_at: Option<String>,
}
impl std::fmt::Display for MeasuredUnit {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct MeasuredUnitCreate {
    ///Optional internal description.
    pub description: Option<String>,
    ///Unique internal name of the measured unit on your site.
    pub name: String,
    ///Display name for the measured unit.
    pub display_name: String,
}
impl std::fmt::Display for MeasuredUnitCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct MeasuredUnitList {
    pub data: Option<Vec<MeasuredUnit>>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for MeasuredUnitList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct MeasuredUnitUpdate {
    ///Optional internal description.
    pub description: Option<String>,
    ///Unique internal name of the measured unit on your site.
    pub name: Option<String>,
    ///Display name for the measured unit.
    pub display_name: Option<String>,
}
impl std::fmt::Display for MeasuredUnitUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentMethod(pub serde_json::Value);
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PercentageTier {
    /**The percentage taken of the monetary amount of usage tracked.
This can be up to 4 decimal places represented as a string.
*/
    pub usage_percentage: Option<String>,
    ///Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier.
    pub ending_amount: Option<f64>,
}
impl std::fmt::Display for PercentageTier {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PercentageTiersByCurrency {
    pub tiers: Option<Vec<PercentageTier>>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
}
impl std::fmt::Display for PercentageTiersByCurrency {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Plan {
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    pub setup_fee_revenue_schedule_type: Option<String>,
    pub deleted_at: Option<String>,
    ///Units for the plan's trial period.
    pub trial_unit: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
    pub setup_fee_accounting_code: Option<String>,
    ///`true` exempts tax on the plan, `false` applies tax on the plan.
    pub tax_exempt: Option<bool>,
    ///The current state of the plan.
    pub state: Option<String>,
    ///Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
    pub accounting_code: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    pub currencies: Option<Vec<PlanPricing>>,
    pub hosted_pages: Option<PlanHostedPages>,
    ///Length of the plan's billing interval in `interval_unit`.
    pub interval_length: Option<i64>,
    pub id: Option<String>,
    ///Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically stops renewing, defaults to `null` for continuous, automatic renewal.
    pub total_billing_cycles: Option<i64>,
    ///Length of plan's trial period in `trial_units`. `0` means `no trial`.
    pub trial_length: Option<i64>,
    ///Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
    pub trial_requires_billing_info: Option<bool>,
    ///Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    pub code: String,
    ///Optional description, not displayed.
    pub description: Option<String>,
    pub object: Option<String>,
    ///Unit for the plan's billing interval.
    pub interval_unit: Option<String>,
    ///This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
    pub name: String,
    /**Used to determine whether items can be assigned as add-ons to individual subscriptions.
If `true`, items can be assigned as add-ons to individual subscription add-ons.
If `false`, only plan add-ons can be used.
*/
    pub allow_any_item_on_subscriptions: Option<bool>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    pub ramp_intervals: Option<Vec<PlanRampInterval>>,
    pub created_at: Option<String>,
    pub updated_at: Option<String>,
    ///Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
    pub auto_renew: Option<bool>,
    ///Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    /**A fixed pricing model has the same price for each billing period.
A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
a specified cadence of billing periods. The price change could be an increase or decrease.
*/
    pub pricing_model: Option<String>,
}
impl std::fmt::Display for Plan {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PlanCreate {
    pub add_ons: Option<Vec<AddOnCreate>>,
    ///Optional description, not displayed.
    pub description: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///Units for the plan's trial period.
    pub trial_unit: Option<String>,
    pub hosted_pages: Option<PlanHostedPages>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    pub code: String,
    ///Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
    pub accounting_code: Option<String>,
    ///Unit for the plan's billing interval.
    pub interval_unit: Option<String>,
    ///Length of plan's trial period in `trial_units`. `0` means `no trial`.
    pub trial_length: Option<i64>,
    ///Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
    pub setup_fee_accounting_code: Option<String>,
    ///Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
    pub auto_renew: Option<bool>,
    ///Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
    pub trial_requires_billing_info: Option<bool>,
    ///Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    pub ramp_intervals: Option<Vec<PlanRampInterval>>,
    /**Used to determine whether items can be assigned as add-ons to individual subscriptions.
If `true`, items can be assigned as add-ons to individual subscription add-ons.
If `false`, only plan add-ons can be used.
*/
    pub allow_any_item_on_subscriptions: Option<bool>,
    ///Length of the plan's billing interval in `interval_unit`.
    pub interval_length: Option<i64>,
    ///This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
    pub name: String,
    /**A fixed pricing model has the same price for each billing period.
A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
a specified cadence of billing periods. The price change could be an increase or decrease.
*/
    pub pricing_model: Option<String>,
    ///`true` exempts tax on the plan, `false` applies tax on the plan.
    pub tax_exempt: Option<bool>,
    pub revenue_schedule_type: Option<String>,
    pub currencies: Vec<PlanPricing>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    ///Automatically terminate plans after a defined number of billing cycles.
    pub total_billing_cycles: Option<i64>,
    pub setup_fee_revenue_schedule_type: Option<String>,
}
impl std::fmt::Display for PlanCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanHostedPages {
    ///URL to redirect to on canceled signup on the hosted payment pages.
    pub cancel_url: Option<String>,
    ///If `true`, the customer will be sent directly to your `success_url` after a successful signup, bypassing Recurly's hosted confirmation page.
    pub bypass_confirmation: Option<bool>,
    ///URL to redirect to after signup on the hosted payment pages.
    pub success_url: Option<String>,
    ///Determines if the quantity field is displayed on the hosted pages for the plan.
    pub display_quantity: Option<bool>,
}
impl std::fmt::Display for PlanHostedPages {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanList {
    ///Will always be List.
    pub object: Option<String>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<Plan>>,
}
impl std::fmt::Display for PlanList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanMini {
    ///This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
    pub name: Option<String>,
    pub object: Option<String>,
    pub id: Option<String>,
    ///Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    pub code: Option<String>,
}
impl std::fmt::Display for PlanMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanPricing {
    ///Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
    pub setup_fee: Option<f64>,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///This field should not be sent when the pricing model is 'ramp'.
    pub unit_amount: Option<f64>,
}
impl std::fmt::Display for PlanPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanRampInterval {
    ///Represents the price for the ramp interval.
    pub currencies: Option<Vec<PlanRampPricing>>,
    ///Represents the billing cycle where a ramp interval starts.
    pub starting_billing_cycle: Option<i64>,
}
impl std::fmt::Display for PlanRampInterval {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct PlanRampPricing {
    ///Represents the price for the Ramp Interval.
    pub unit_amount: f64,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
}
impl std::fmt::Display for PlanRampPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PlanUpdate {
    ///Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    pub code: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_transaction_type: Option<i64>,
    ///Automatically terminate plans after a defined number of billing cycles.
    pub total_billing_cycles: Option<i64>,
    pub hosted_pages: Option<PlanHostedPages>,
    ///Units for the plan's trial period.
    pub trial_unit: Option<String>,
    ///This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
    pub name: Option<String>,
    pub ramp_intervals: Option<Vec<PlanRampInterval>>,
    pub id: Option<String>,
    ///`true` exempts tax on the plan, `false` applies tax on the plan.
    pub tax_exempt: Option<bool>,
    ///Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan's code.
    pub accounting_code: Option<String>,
    ///Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    pub dunning_campaign_id: Option<String>,
    ///Length of plan's trial period in `trial_units`. `0` means `no trial`.
    pub trial_length: Option<i64>,
    ///Subscriptions will automatically inherit this value once they are active. If `auto_renew` is `true`, then a subscription will automatically renew its term at renewal. If `auto_renew` is `false`, then a subscription will expire at the end of its term. `auto_renew` can be overridden on the subscription record itself.
    pub auto_renew: Option<bool>,
    ///Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
    pub setup_fee_accounting_code: Option<String>,
    ///Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https://help.avalara.com/AvaTax_for_Communications/Tax_Calculation/AvaTax_for_Communications_Tax_Engine/Mapping_Resources/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t/s types.
    pub avalara_service_type: Option<i64>,
    ///Optional description, not displayed.
    pub description: Option<String>,
    ///Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
    pub trial_requires_billing_info: Option<bool>,
    /**Used to determine whether items can be assigned as add-ons to individual subscriptions.
If `true`, items can be assigned as add-ons to individual subscription add-ons.
If `false`, only plan add-ons can be used.
*/
    pub allow_any_item_on_subscriptions: Option<bool>,
    pub revenue_schedule_type: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///Optional field used by Avalara, Vertex, and Recurly's EU VAT tax feature to determine taxation rules. If you have your own AvaTax or Vertex account configured, use their tax codes to assign specific tax rules. If you are using Recurly's EU VAT feature, you can use values of `unknown`, `physical`, or `digital`.
    pub tax_code: Option<String>,
    ///Optional when the pricing model is 'ramp'.
    pub currencies: Option<Vec<PlanPricing>>,
    pub setup_fee_revenue_schedule_type: Option<String>,
}
impl std::fmt::Display for PlanUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Pricing {
    pub unit_amount: f64,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
}
impl std::fmt::Display for Pricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PurchaseCreate {
    pub shipping: Option<serde_json::Value>,
    ///Notes to be put on the credit invoice resulting from credits in the purchase, if any.
    pub credit_customer_notes: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    ///Must be set to manual in order to preview a purchase for an Account that does not have payment information associated with the Billing Info.
    pub collection_method: Option<String>,
    ///The default payment gateway identifier to be used for the purchase transaction.  This will also be applied as the default for any subscriptions included in the purchase request.
    pub gateway_code: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
    ///A list of coupon_codes to be redeemed on the subscription or account during the purchase.
    pub coupon_codes: Option<Vec<String>>,
    pub customer_notes: Option<String>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    pub account: AccountPurchase,
    ///VAT reverse charge notes for cross border European tax settlement.
    pub vat_reverse_charge_notes: Option<String>,
    ///The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
    pub billing_info_id: Option<String>,
    ///A list of one time charges or credits to be created with the purchase.
    pub line_items: Option<Vec<LineItemCreate>>,
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    ///Terms and conditions to be put on the purchase invoice.
    pub terms_and_conditions: Option<String>,
    ///A list of subscriptions to be created with the purchase.
    pub subscriptions: Option<Vec<SubscriptionPurchase>>,
    ///A gift card redemption code to be redeemed on the purchase invoice.
    pub gift_card_redemption_code: Option<String>,
}
impl std::fmt::Display for PurchaseCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Settings {
    /**- full:      Full Address (Street, City, State, Postal Code and Country)
- streetzip: Street and Postal Code only
- zip:       Postal Code only
- none:      No Address
*/
    pub billing_address_requirement: Option<String>,
    ///The default 3-letter ISO 4217 currency code.
    pub default_currency: Option<String>,
    pub accepted_currencies: Option<Vec<String>>,
}
impl std::fmt::Display for Settings {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingAddress {
    pub street2: Option<String>,
    pub city: Option<String>,
    ///Zip or postal code.
    pub postal_code: Option<String>,
    pub email: Option<String>,
    pub account_id: Option<String>,
    pub object: Option<String>,
    pub nickname: Option<String>,
    pub phone: Option<String>,
    pub updated_at: Option<String>,
    ///State or province.
    pub region: Option<String>,
    pub company: Option<String>,
    pub created_at: Option<String>,
    pub first_name: Option<String>,
    pub id: Option<String>,
    ///Country, 2-letter ISO 3166-1 alpha-2 code.
    pub country: Option<String>,
    pub street1: Option<String>,
    pub vat_number: Option<String>,
    pub last_name: Option<String>,
}
impl std::fmt::Display for ShippingAddress {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingAddressCreate {
    pub company: Option<String>,
    ///State or province.
    pub region: Option<String>,
    ///Zip or postal code.
    pub postal_code: String,
    ///Country, 2-letter ISO 3166-1 alpha-2 code.
    pub country: String,
    pub street2: Option<String>,
    pub email: Option<String>,
    pub nickname: Option<String>,
    pub vat_number: Option<String>,
    pub city: String,
    pub last_name: String,
    pub street1: String,
    pub phone: Option<String>,
    pub first_name: String,
}
impl std::fmt::Display for ShippingAddressCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingAddressList {
    pub data: Option<Vec<ShippingAddress>>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
}
impl std::fmt::Display for ShippingAddressList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingAddressUpdate {
    pub first_name: Option<String>,
    pub last_name: Option<String>,
    pub company: Option<String>,
    pub nickname: Option<String>,
    pub street2: Option<String>,
    pub email: Option<String>,
    ///Zip or postal code.
    pub postal_code: Option<String>,
    pub vat_number: Option<String>,
    ///Country, 2-letter ISO 3166-1 alpha-2 code.
    pub country: Option<String>,
    pub street1: Option<String>,
    pub city: Option<String>,
    pub phone: Option<String>,
    ///State or province.
    pub region: Option<String>,
    pub id: Option<String>,
}
impl std::fmt::Display for ShippingAddressUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingFeeCreate {
    ///The code of the shipping method used to deliver the purchase. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_code: Option<String>,
    ///The id of the shipping method used to deliver the purchase. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_id: Option<String>,
    ///This is priced in the purchase's currency.
    pub amount: Option<f64>,
}
impl std::fmt::Display for ShippingFeeCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingMethod {
    /**Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
code values are specific to each tax system. If you are using Recurly’s
built-in taxes the values are:

- `FR` – Common Carrier FOB Destination
- `FR022000` – Common Carrier FOB Origin
- `FR020400` – Non Common Carrier FOB Destination
- `FR020500` – Non Common Carrier FOB Origin
- `FR010100` – Delivery by Company Vehicle Before Passage of Title
- `FR010200` – Delivery by Company Vehicle After Passage of Title
- `NT` – Non-Taxable
*/
    pub tax_code: Option<String>,
    pub id: Option<String>,
    pub updated_at: Option<String>,
    ///Accounting code for shipping method.
    pub accounting_code: Option<String>,
    ///The internal name used identify the shipping method.
    pub code: Option<String>,
    pub object: Option<String>,
    ///The name of the shipping method displayed to customers.
    pub name: Option<String>,
    pub created_at: Option<String>,
    pub deleted_at: Option<String>,
}
impl std::fmt::Display for ShippingMethod {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingMethodCreate {
    ///The internal name used identify the shipping method.
    pub code: String,
    ///The name of the shipping method displayed to customers.
    pub name: String,
    ///Accounting code for shipping method.
    pub accounting_code: Option<String>,
    /**Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
code values are specific to each tax system. If you are using Recurly’s
built-in taxes the values are:

- `FR` – Common Carrier FOB Destination
- `FR022000` – Common Carrier FOB Origin
- `FR020400` – Non Common Carrier FOB Destination
- `FR020500` – Non Common Carrier FOB Origin
- `FR010100` – Delivery by Company Vehicle Before Passage of Title
- `FR010200` – Delivery by Company Vehicle After Passage of Title
- `NT` – Non-Taxable
*/
    pub tax_code: Option<String>,
}
impl std::fmt::Display for ShippingMethodCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingMethodList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<ShippingMethod>>,
}
impl std::fmt::Display for ShippingMethodList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingMethodMini {
    pub id: Option<String>,
    ///The name of the shipping method displayed to customers.
    pub name: Option<String>,
    ///The internal name used identify the shipping method.
    pub code: Option<String>,
    pub object: Option<String>,
}
impl std::fmt::Display for ShippingMethodMini {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ShippingMethodUpdate {
    /**Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax
code values are specific to each tax system. If you are using Recurly’s
built-in taxes the values are:

- `FR` – Common Carrier FOB Destination
- `FR022000` – Common Carrier FOB Origin
- `FR020400` – Non Common Carrier FOB Destination
- `FR020500` – Non Common Carrier FOB Origin
- `FR010100` – Delivery by Company Vehicle Before Passage of Title
- `FR010200` – Delivery by Company Vehicle After Passage of Title
- `NT` – Non-Taxable
*/
    pub tax_code: Option<String>,
    ///The name of the shipping method displayed to customers.
    pub name: Option<String>,
    ///The internal name used identify the shipping method.
    pub code: Option<String>,
    ///Accounting code for shipping method.
    pub accounting_code: Option<String>,
}
impl std::fmt::Display for ShippingMethodUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Site {
    pub id: Option<String>,
    pub created_at: Option<String>,
    ///A list of features enabled for the site.
    pub features: Option<Vec<String>>,
    pub object: Option<String>,
    pub updated_at: Option<String>,
    pub settings: Option<Settings>,
    pub mode: Option<String>,
    pub address: Option<Address>,
    pub deleted_at: Option<String>,
    ///This value is used to configure RecurlyJS to submit tokenized billing information.
    pub public_api_key: Option<String>,
    pub subdomain: Option<String>,
}
impl std::fmt::Display for Site {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SiteList {
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    pub data: Option<Vec<Site>>,
    ///Will always be List.
    pub object: Option<String>,
}
impl std::fmt::Display for SiteList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Subscription {
    pub account: Option<AccountMini>,
    pub state: Option<String>,
    pub current_period_ends_at: Option<String>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    pub updated_at: Option<String>,
    ///If present, this subscription's transactions will use the payment gateway with this code.
    pub gateway_code: Option<String>,
    ///The remaining billing cycles in the current term.
    pub remaining_billing_cycles: Option<i64>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
    pub tax_inclusive: Option<bool>,
    ///The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
    pub total_billing_cycles: Option<i64>,
    ///Returns subscription level coupon redemptions that are tied to this subscription.
    pub coupon_redemptions: Option<Vec<CouponRedemptionMini>>,
    pub created_at: Option<String>,
    pub activated_at: Option<String>,
    ///When the term ends. This is calculated by a plan's interval and `total_billing_cycles` in a term. Subscription changes with a `timeframe=renewal` will be applied on this date.
    pub current_term_ends_at: Option<String>,
    ///The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.
    pub current_term_started_at: Option<String>,
    ///The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
    pub uuid: Option<String>,
    ///Just the important parts.
    pub plan: Option<PlanMini>,
    ///Null unless subscription is paused or will pause at the end of the current billing period.
    pub paused_at: Option<String>,
    pub id: Option<String>,
    pub terms_and_conditions: Option<String>,
    ///If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
    pub renewal_billing_cycles: Option<i64>,
    pub pending_change: Option<SubscriptionChange>,
    pub total: Option<f64>,
    pub object: Option<String>,
    pub customer_notes: Option<String>,
    pub add_ons_total: Option<f64>,
    pub trial_ends_at: Option<String>,
    pub quantity: Option<i64>,
    pub subtotal: Option<f64>,
    ///The ramp intervals representing the pricing schedule for the subscription.
    pub ramp_intervals: Option<Vec<SubscriptionRampIntervalResponse>>,
    pub expiration_reason: Option<String>,
    pub expires_at: Option<String>,
    pub add_ons: Option<Vec<SubscriptionAddOn>>,
    pub tax_info: Option<TaxInfo>,
    pub tax: Option<f64>,
    pub unit_amount: Option<f64>,
    ///Whether the subscription renews at the end of its term.
    pub auto_renew: Option<bool>,
    pub collection_method: Option<String>,
    pub current_period_started_at: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    pub canceled_at: Option<String>,
    ///Null unless subscription is paused or will pause at the end of the current billing period.
    pub remaining_pause_cycles: Option<i64>,
    ///Billing Info ID.
    pub billing_info_id: Option<String>,
    ///The invoice ID of the latest invoice created for an active subscription.
    pub active_invoice_id: Option<String>,
    pub trial_started_at: Option<String>,
    pub revenue_schedule_type: Option<String>,
    pub shipping: Option<SubscriptionShipping>,
    ///Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.
    pub bank_account_authorized_at: Option<String>,
}
impl std::fmt::Display for Subscription {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionAddOn {
    ///Supports up to 2 decimal places.
    pub unit_amount: Option<f64>,
    /**If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
add_on.usage_type is percentage.
There must be one tier without an `ending_amount` value which represents the final tier.
*/
    pub percentage_tiers: Option<Vec<SubscriptionAddOnPercentageTier>>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
    pub usage_percentage: Option<f64>,
    pub revenue_schedule_type: Option<String>,
    ///Just the important parts.
    pub add_on: Option<AddOnMini>,
    pub created_at: Option<String>,
    /**The pricing model for the add-on.  For more information,
[click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our
[Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
*/
    pub tier_type: Option<String>,
    pub updated_at: Option<String>,
    /**If tiers are provided in the request, all existing tiers on the Subscription Add-on will be
removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and
add_on.usage_type is percentage use percentage_tiers instead.
There must be one tier without an `ending_quantity` value which represents the final tier.
*/
    pub tiers: Option<Vec<SubscriptionAddOnTier>>,
    /**Used to determine where the associated add-on data is pulled from. If this value is set to
`plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
`plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
the associated add-on data will be pulled from the site's item catalog.
*/
    pub add_on_source: Option<String>,
    ///Supports up to 9 decimal places.
    pub unit_amount_decimal: Option<String>,
    ///The time at which usage totals are reset for billing purposes.
    pub usage_timeframe: Option<String>,
    pub expired_at: Option<String>,
    pub subscription_id: Option<String>,
    pub id: Option<String>,
    ///The type of calculation to be employed for an add-on.  Cumulative billing will sum all usage records created in the current billing cycle.  Last-in-period billing will apply only the most recent usage record in the billing period.  If no value is specified, cumulative billing will be used.
    pub usage_calculation_type: Option<String>,
    pub object: Option<String>,
    pub quantity: Option<i64>,
}
impl std::fmt::Display for SubscriptionAddOn {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionAddOnCreate {
    /**If `add_on_source` is set to `plan_add_on` or left blank, then plan's add-on `code` should be used.
If `add_on_source` is set to `item`, then the `code` from the associated item should be used.
*/
    pub code: String,
    /**Used to determine where the associated add-on data is pulled from. If this value is set to
`plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
`plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
the associated add-on data will be pulled from the site's item catalog.
*/
    pub add_on_source: Option<String>,
    /**Allows up to 9 decimal places.  Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided.
Only supported when the plan add-on's `add_on_type` = `usage`.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
    pub unit_amount_decimal: Option<String>,
    /**If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount`.
There must be one tier without an `ending_quantity` value which represents the final tier.
See our [Guide](https://recurly.com/developers/guides/item-addon-guide.html)
for an overview of how to configure quantity-based pricing models.
*/
    pub tiers: Option<Vec<SubscriptionAddOnTier>>,
    /**If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. There must be one tier without ending_amount value which represents the final tier.
Use only if add_on.tier_type is tiered or volume and add_on.usage_type is percentage.
*/
    pub percentage_tiers: Option<Vec<SubscriptionAddOnPercentageTier>>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if `add_on_type` is usage and `usage_type` is percentage. Must be omitted otherwise. `usage_percentage` does not support tiers. See our [Guide](https://recurly.com/developers/guides/usage-based-billing-guide.html) for an overview of how to configure usage add-ons.
    pub usage_percentage: Option<f64>,
    pub quantity: Option<i64>,
    pub revenue_schedule_type: Option<String>,
    /**Allows up to 2 decimal places. Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
*/
    pub unit_amount: Option<f64>,
}
impl std::fmt::Display for SubscriptionAddOnCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionAddOnPercentageTier {
    ///Ending amount for the tier. Allows up to 2 decimal places. Must be left empty if it is the final tier.
    pub ending_amount: Option<f64>,
    /**The percentage taken of the monetary amount of usage tracked.
This can be up to 4 decimal places represented as a string.
*/
    pub usage_percentage: Option<String>,
}
impl std::fmt::Display for SubscriptionAddOnPercentageTier {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionAddOnTier {
    ///Allows up to 2 decimal places. Optionally, override the tiers' default unit amount. If add-on's `add_on_type` is `usage` and `usage_type` is `percentage`, cannot be provided.
    pub unit_amount: Option<f64>,
    ///Ending quantity for the tier.  This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier.
    pub ending_quantity: Option<i64>,
    /**Allows up to 9 decimal places.  Optionally, override tiers' default unit amount.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
If add-on's `add_on_type` is `usage` and `usage_type` is `percentage`, cannot be provided.
*/
    pub unit_amount_decimal: Option<String>,
    ///(deprecated) -- Use the percentage_tiers object instead.
    pub usage_percentage: Option<String>,
}
impl std::fmt::Display for SubscriptionAddOnTier {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionAddOnUpdate {
    /**Allows up to 2 decimal places. Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount` cannot be provided.
*/
    pub unit_amount: Option<f64>,
    /**If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
add_on.usage_type is percentage.
There must be one tier without an `ending_amount` value which represents the final tier.
*/
    pub percentage_tiers: Option<Vec<SubscriptionAddOnPercentageTier>>,
    pub revenue_schedule_type: Option<String>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
    pub usage_percentage: Option<f64>,
    /**Used to determine where the associated add-on data is pulled from. If this value is set to
`plan_add_on` or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
`plan` has `allow_any_item_on_subscriptions` set to `true` and this field is set to `item`, then
the associated add-on data will be pulled from the site's item catalog.
*/
    pub add_on_source: Option<String>,
    /**When an id is provided, the existing subscription add-on attributes will
persist unless overridden in the request.
*/
    pub id: Option<String>,
    /**If a code is provided without an id, the subscription add-on attributes
will be set to the current value for those attributes on the plan add-on
unless provided in the request. If `add_on_source` is set to `plan_add_on`
or left blank, then plan's add-on `code` should be used. If `add_on_source`
is set to `item`, then the `code` from the associated item should be used.
*/
    pub code: Option<String>,
    pub quantity: Option<i64>,
    /**Allows up to 9 decimal places. Optionally, override the add-on's default unit amount.
If the plan add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `unit_amount_decimal` cannot be provided.
Only supported when the plan add-on's `add_on_type` = `usage`.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
    pub unit_amount_decimal: Option<String>,
    /**If the plan add-on's `tier_type` is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount`.
There must be one tier without an `ending_quantity` value which represents the final tier.
*/
    pub tiers: Option<Vec<SubscriptionAddOnTier>>,
}
impl std::fmt::Display for SubscriptionAddOnUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionCancel {
    ///The timeframe parameter controls when the expiration takes place. The `bill_date` timeframe causes the subscription to expire when the subscription is scheduled to bill next. The `term_end` timeframe causes the subscription to continue to bill until the end of the subscription term, then expire.
    pub timeframe: Option<String>,
}
impl std::fmt::Display for SubscriptionCancel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionChange {
    pub quantity: Option<i64>,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
    ///Returns `true` if the subscription change is activated.
    pub activated: Option<bool>,
    ///These add-ons will be used when the subscription renews.
    pub add_ons: Option<Vec<SubscriptionAddOn>>,
    ///Accept nested attributes for three_d_secure_action_result_token_id
    pub billing_info: Option<SubscriptionChangeBillingInfo>,
    pub unit_amount: Option<f64>,
    pub activate_at: Option<String>,
    pub invoice_collection: Option<InvoiceCollection>,
    pub updated_at: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///The ramp intervals representing the pricing schedule for the subscription.
    pub ramp_intervals: Option<Vec<SubscriptionRampIntervalResponse>>,
    pub object: Option<String>,
    ///The ID of the subscription that is going to be changed.
    pub subscription_id: Option<String>,
    ///Just the important parts.
    pub plan: Option<PlanMini>,
    ///The ID of the Subscription Change.
    pub id: Option<String>,
    pub created_at: Option<String>,
    pub deleted_at: Option<String>,
    pub revenue_schedule_type: Option<String>,
    pub shipping: Option<SubscriptionShipping>,
}
impl std::fmt::Display for SubscriptionChange {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionChangeBillingInfo {
    ///A token generated by Recurly.js after completing a 3-D Secure device fingerprinting or authentication challenge.
    pub three_d_secure_action_result_token_id: Option<String>,
}
impl std::fmt::Display for SubscriptionChangeBillingInfo {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionChangeBillingInfoCreate {
    #[serde(rename = "SubscriptionChangeBillingInfo")]
    ///Accept nested attributes for three_d_secure_action_result_token_id
    pub subscription_change_billing_info: SubscriptionChangeBillingInfo,
}
impl std::fmt::Display for SubscriptionChangeBillingInfoCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionChangeCreate {
    ///If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
    pub plan_id: Option<String>,
    ///A list of coupon_codes to be redeemed on the subscription during the change. Only allowed if timeframe is now and you change something about the subscription that creates an invoice.
    pub coupon_codes: Option<Vec<String>>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    ///If you want to change to a new plan, you can provide the plan's code or id. If both are provided the `plan_id` will be used.
    pub plan_code: Option<String>,
    ///The new set of ramp intervals for the subscription.
    pub ramp_intervals: Option<Vec<SubscriptionRampInterval>>,
    pub collection_method: Option<String>,
    ///The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you're performing an upgrade, you will want the change to occur immediately (now). If you're performing a downgrade, you should set the timeframe to `term_end` or `bill_date` so the change takes effect at a scheduled billing date. The `renewal` timeframe option is accepted as an alias for `term_end`.
    pub timeframe: Option<String>,
    ///Optionally override the default quantity of 1.
    pub quantity: Option<i64>,
    ///Optionally, sets custom pricing for the subscription, overriding the plan's default unit amount. The subscription's current currency will be used.
    pub unit_amount: Option<f64>,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
    /**If you provide a value for this field it will replace any
existing add-ons. So, when adding or modifying an add-on, you need to
include the existing subscription add-ons. Unchanged add-ons can be included
just using the subscription add-on''s ID: `{"id": "abc123"}`. If this
value is omitted your existing add-ons will be unaffected. To remove all
existing add-ons, this value should be an empty array.'

If a subscription add-on's `code` is supplied without the `id`,
`{"code": "def456"}`, the subscription add-on attributes will be set to the
current values of the plan add-on unless provided in the request.

- If an `id` is passed, any attributes not passed in will pull from the
  existing subscription add-on
- If a `code` is passed, any attributes not passed in will pull from the
  current values of the plan add-on
- Attributes passed in as part of the request will override either of the
  above scenarios
*/
    pub add_ons: Option<Vec<SubscriptionAddOnUpdate>>,
    ///Shipping addresses are tied to a customer's account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription.
    pub shipping: Option<SubscriptionChangeShippingCreate>,
    pub billing_info: Option<SubscriptionChangeBillingInfoCreate>,
}
impl std::fmt::Display for SubscriptionChangeCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionChangeShippingCreate {
    pub amount: Option<f64>,
    ///The id of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_id: Option<String>,
    ///The code of the shipping method used to deliver the subscription. To remove shipping set this to `null` and the `amount=0`. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_code: Option<String>,
    pub address: Option<ShippingAddressCreate>,
    ///Assign a shipping address from the account's existing shipping addresses. If this and address are both present, address will take precedence.
    pub address_id: Option<String>,
}
impl std::fmt::Display for SubscriptionChangeShippingCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionCreate {
    ///The new set of ramp intervals for the subscription.
    pub ramp_intervals: Option<Vec<SubscriptionRampInterval>>,
    ///If there are pending credits on the account that will be invoiced during the subscription creation, these will be used as the Customer Notes on the credit invoice.
    pub credit_customer_notes: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
    pub total_billing_cycles: Option<i64>,
    ///This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
    pub customer_notes: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
    ///An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
    pub transaction_type: Option<String>,
    ///You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
    pub plan_code: String,
    ///If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
    pub starts_at: Option<String>,
    ///You must provide either a `plan_code` or `plan_id`. If both are provided the `plan_id` will be used.
    pub plan_id: Option<String>,
    ///The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
    pub billing_info_id: Option<String>,
    ///If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.
    pub next_bill_date: Option<String>,
    ///Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
    pub tax_inclusive: Option<bool>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
    pub renewal_billing_cycles: Option<i64>,
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    pub add_ons: Option<Vec<SubscriptionAddOnCreate>>,
    ///This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
    pub terms_and_conditions: Option<String>,
    pub account: AccountCreate,
    ///Optionally override the default quantity of 1.
    pub quantity: Option<i64>,
    ///Whether the subscription renews at the end of its term.
    pub auto_renew: Option<bool>,
    pub collection_method: Option<String>,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
    ///Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
    pub unit_amount: Option<f64>,
    ///A list of coupon_codes to be redeemed on the subscription or account during the purchase.
    pub coupon_codes: Option<Vec<String>>,
    pub shipping: Option<SubscriptionShippingCreate>,
    ///If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
    pub trial_ends_at: Option<String>,
}
impl std::fmt::Display for SubscriptionCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionList {
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<Subscription>>,
}
impl std::fmt::Display for SubscriptionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionPause {
    ///Number of billing cycles to pause the subscriptions. A value of 0 will cancel any pending pauses on the subscription.
    pub remaining_pause_cycles: i64,
}
impl std::fmt::Display for SubscriptionPause {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionPurchase {
    ///Whether the subscription renews at the end of its term.
    pub auto_renew: Option<bool>,
    ///Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.
    pub unit_amount: Option<f64>,
    ///Optionally override the default quantity of 1.
    pub quantity: Option<i64>,
    ///If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.
    pub trial_ends_at: Option<String>,
    pub add_ons: Option<Vec<SubscriptionAddOnCreate>>,
    ///If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.
    pub next_bill_date: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
    pub tax_inclusive: Option<bool>,
    ///The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
    pub total_billing_cycles: Option<i64>,
    ///If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.
    pub starts_at: Option<String>,
    pub plan_code: String,
    ///The new set of ramp intervals for the subscription.
    pub ramp_intervals: Option<Vec<SubscriptionRampInterval>>,
    ///If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
    pub renewal_billing_cycles: Option<i64>,
    pub plan_id: Option<String>,
    pub shipping: Option<SubscriptionShippingPurchase>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
}
impl std::fmt::Display for SubscriptionPurchase {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionRampInterval {
    ///Represents the price for the ramp interval.
    pub unit_amount: Option<i64>,
    ///Represents the billing cycle where a ramp interval starts.
    pub starting_billing_cycle: Option<i64>,
}
impl std::fmt::Display for SubscriptionRampInterval {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionRampIntervalResponse {
    ///Represents how many billing cycles are left in a ramp interval.
    pub remaining_billing_cycles: Option<i64>,
    ///Represents the price for the ramp interval.
    pub unit_amount: Option<f64>,
    ///Represents the billing cycle where a ramp interval starts.
    pub starting_billing_cycle: Option<i64>,
}
impl std::fmt::Display for SubscriptionRampIntervalResponse {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionShipping {
    pub object: Option<String>,
    pub method: Option<ShippingMethodMini>,
    pub amount: Option<f64>,
    pub address: Option<ShippingAddress>,
}
impl std::fmt::Display for SubscriptionShipping {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionShippingCreate {
    pub address: Option<ShippingAddressCreate>,
    ///The id of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_id: Option<String>,
    ///The code of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_code: Option<String>,
    pub amount: Option<f64>,
    ///Assign a shipping address from the account's existing shipping addresses. If `address_id` and `address` are both present, `address` will be used.
    pub address_id: Option<String>,
}
impl std::fmt::Display for SubscriptionShippingCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct SubscriptionShippingPurchase {
    ///The id of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_id: Option<String>,
    ///The code of the shipping method used to deliver the subscription. If `method_id` and `method_code` are both present, `method_id` will be used.
    pub method_code: Option<String>,
    pub amount: Option<f64>,
}
impl std::fmt::Display for SubscriptionShippingPurchase {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionShippingUpdate {
    ///Assign a shipping address from the account's existing shipping addresses.
    pub address_id: Option<String>,
    pub object: Option<String>,
    pub address: Option<ShippingAddressCreate>,
}
impl std::fmt::Display for SubscriptionShippingUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct SubscriptionUpdate {
    ///For manual invoicing, this identifies the PO number associated with the subscription.
    pub po_number: Option<String>,
    ///The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    pub custom_fields: Option<CustomFields>,
    ///The remaining billing cycles in the current term.
    pub remaining_billing_cycles: Option<i64>,
    ///Whether the subscription renews at the end of its term.
    pub auto_renew: Option<bool>,
    ///The `billing_info_id` is the value that represents a specific billing info for an end customer. When `billing_info_id` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. `billing_info_id` can ONLY be used for sites utilizing the Wallet feature.
    pub billing_info_id: Option<String>,
    pub shipping: Option<SubscriptionShippingUpdate>,
    ///Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
    pub customer_notes: Option<String>,
    ///If present, this subscription's transactions will use the payment gateway with this code.
    pub gateway_code: Option<String>,
    ///If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
    pub renewal_billing_cycles: Option<i64>,
    pub collection_method: Option<String>,
    ///This field is deprecated. Please do not use it.
    pub tax_inclusive: Option<bool>,
    ///If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. For a subscription in a trial period, this will change when the trial expires. This parameter is useful for postponement of a subscription to change its billing date without proration.
    pub next_bill_date: Option<String>,
    pub revenue_schedule_type: Option<String>,
    ///Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
    pub terms_and_conditions: Option<String>,
    ///Integer representing the number of days after an invoice's creation that the invoice will become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will become past due 24 hours after it’s created. If an invoice is due net 30, it will become past due at 31 days exactly.
    pub net_terms: Option<i64>,
}
impl std::fmt::Display for SubscriptionUpdate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TaxDetail {
    ///Provides the tax rate for the region.
    pub rate: Option<f64>,
    ///Provides the tax region applied on an invoice. For Canadian Sales Tax, this will be either the 2 letter province code or country code.
    pub region: Option<String>,
    ///The total tax applied for this tax type.
    pub tax: Option<f64>,
    #[serde(rename = "type")]
    ///Provides the tax type for the region. For Canadian Sales Tax, this will be GST, HST, QST or PST.
    pub type_: Option<String>,
}
impl std::fmt::Display for TaxDetail {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TaxInfo {
    #[serde(rename = "type")]
    ///Provides the tax type as "vat" for EU VAT, "usst" for U.S. Sales Tax, or the 2 letter country code for country level tax types like Canada, Australia, New Zealand, Israel, and all non-EU European countries.
    pub type_: Option<String>,
    ///Provides the tax region applied on an invoice. For U.S. Sales Tax, this will be the 2 letter state code. For EU VAT this will be the 2 letter country code. For all country level tax types, this will display the regional tax, like VAT, GST, or PST.
    pub region: Option<String>,
    ///Provides additional tax details for Canadian Sales Tax when there is tax applied at both the country and province levels. This will only be populated for the Invoice response when fetching a single invoice and not for the InvoiceList or LineItem.
    pub tax_details: Option<Vec<TaxDetail>>,
    pub rate: Option<f64>,
}
impl std::fmt::Display for TaxInfo {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Tier {
    ///Ending quantity for the tier.  This represents a unit amount for unit-priced add ons. Must be left empty if it is the final tier.
    pub ending_quantity: Option<i64>,
    ///(deprecated) -- Use the percentage_tiers object instead.
    pub usage_percentage: Option<String>,
    pub currencies: Option<Vec<TierPricing>>,
}
impl std::fmt::Display for Tier {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TierPricing {
    ///Allows up to 2 decimal places. Required unless `unit_amount_decimal` is provided.
    pub unit_amount: Option<f64>,
    ///3-letter ISO 4217 currency code.
    pub currency: String,
    /**Allows up to 9 decimal places. Only supported when `add_on_type` = `usage`.
If `unit_amount_decimal` is provided, `unit_amount` cannot be provided.
*/
    pub unit_amount_decimal: Option<String>,
}
impl std::fmt::Display for TierPricing {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Transaction {
    pub billing_address: Option<AddressWithName>,
    ///Indicates if the transaction was completed using a backup payment
    pub backup_payment_method_used: Option<bool>,
    ///The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
    pub uuid: Option<String>,
    pub ip_address_country: Option<String>,
    ///Transaction reference number from the payment gateway.
    pub gateway_reference: Option<String>,
    #[serde(rename = "type")]
    /**- `authorization` – verifies billing information and places a hold on money in the customer's account.
- `capture` – captures funds held by an authorization and completes a purchase.
- `purchase` – combines the authorization and capture in one transaction.
- `refund` – returns all or a portion of the money collected in a previous transaction to the customer.
- `verify` – a $0 or $1 transaction used to verify billing information which is immediately voided.
*/
    pub type_: Option<String>,
    pub invoice: Option<InvoiceMini>,
    ///Total transaction amount sent to the payment gateway.
    pub amount: Option<f64>,
    ///Indicates if part or all of this transaction was refunded.
    pub refunded: Option<bool>,
    /**IP address provided when the billing information was collected:

- When the customer enters billing information into the Recurly.js or Hosted Payment Pages, Recurly records the IP address.
- When the merchant enters billing information using the API, the merchant may provide an IP address.
- When the merchant enters billing information using the UI, no IP address is recorded.
*/
    pub ip_address_v4: Option<String>,
    pub created_at: Option<String>,
    pub payment_gateway: Option<serde_json::Value>,
    pub voided_by_invoice: Option<InvoiceMini>,
    ///Time, in seconds, for gateway to process the transaction.
    pub gateway_response_time: Option<f64>,
    pub payment_method: Option<PaymentMethod>,
    ///For declined (`success=false`) transactions, the message displayed to the merchant.
    pub status_message: Option<String>,
    pub gateway_approval_code: Option<String>,
    pub account: Option<AccountMini>,
    ///3-letter ISO 4217 currency code.
    pub currency: Option<String>,
    ///Describes how the transaction was triggered.
    pub origin: Option<String>,
    ///When processed, result from checking the CVV/CVC value on the transaction.
    pub cvv_check: Option<String>,
    pub gateway_response_code: Option<String>,
    pub voided_at: Option<String>,
    ///When processed, result from checking the overall AVS on the transaction.
    pub avs_check: Option<String>,
    pub updated_at: Option<String>,
    pub customer_message_locale: Option<String>,
    pub collected_at: Option<String>,
    ///The current transaction status. Note that the status may change, e.g. a `pending` transaction may become `declined` or `success` may later become `void`.
    pub status: Option<String>,
    pub id: Option<String>,
    ///The method by which the payment was collected.
    pub collection_method: Option<String>,
    ///For declined (`success=false`) transactions, the message displayed to the customer.
    pub customer_message: Option<String>,
    ///If this transaction is a refund (`type=refund`), this will be the ID of the original transaction on the invoice being refunded.
    pub original_transaction_id: Option<String>,
    ///Transaction message from the payment gateway.
    pub gateway_message: Option<String>,
    ///Did this transaction complete successfully?
    pub success: Option<bool>,
    pub object: Option<String>,
    ///If the transaction is charging or refunding for one or more subscriptions, these are their IDs.
    pub subscription_ids: Option<Vec<String>>,
    pub status_code: Option<String>,
    ///The values in this field will vary from gateway to gateway.
    pub gateway_response_values: Option<serde_json::Value>,
}
impl std::fmt::Display for Transaction {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct TransactionList {
    ///Will always be List.
    pub object: Option<String>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    pub data: Option<Vec<Transaction>>,
}
impl std::fmt::Display for TransactionList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct UniqueCouponCode {
    pub id: Option<String>,
    ///The date and time the coupon was expired early or reached its `max_redemptions`.
    pub expired_at: Option<String>,
    pub created_at: Option<String>,
    ///The Coupon code of the parent Bulk Coupon
    pub bulk_coupon_code: Option<String>,
    ///Indicates if the unique coupon code is redeemable or why not.
    pub state: Option<String>,
    ///The date and time the unique coupon code was redeemed.
    pub redeemed_at: Option<String>,
    pub object: Option<String>,
    ///The code the customer enters to redeem the coupon.
    pub code: Option<String>,
    pub updated_at: Option<String>,
    ///The Coupon ID of the parent Bulk Coupon
    pub bulk_coupon_id: Option<String>,
}
impl std::fmt::Display for UniqueCouponCode {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct UniqueCouponCodeList {
    pub data: Option<Vec<UniqueCouponCode>>,
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Will always be List.
    pub object: Option<String>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
}
impl std::fmt::Display for UniqueCouponCodeList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct UniqueCouponCodeParams {
    pub order: Option<String>,
    pub sort: Option<String>,
    pub limit: Option<i64>,
    ///The date-time to be included when listing UniqueCouponCodes
    pub begin_time: Option<String>,
}
impl std::fmt::Display for UniqueCouponCodeParams {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct Usage {
    ///When the usage record was billed on an invoice.
    pub updated_at: Option<String>,
    ///The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = []
    pub tiers: Option<Vec<SubscriptionAddOnTier>>,
    ///The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places.  Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500").
    pub amount: Option<f64>,
    ///Unit price that can optionally support a sub-cent value.
    pub unit_amount_decimal: Option<String>,
    ///The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0.
    pub usage_percentage: Option<f64>,
    pub object: Option<String>,
    /**The pricing model for the add-on.  For more information,
[click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). See our
[Guide](https://recurly.com/developers/guides/item-addon-guide.html) for an overview of how
to configure quantity-based pricing models.
*/
    pub tier_type: Option<String>,
    ///Type of usage, returns usage type if `add_on_type` is `usage`.
    pub usage_type: Option<String>,
    pub unit_amount: Option<f64>,
    ///When the usage record was billed on an invoice.
    pub billed_at: Option<String>,
    ///The ID of the measured unit associated with the add-on the usage record is for.
    pub measured_unit_id: Option<String>,
    ///When the usage record was created in Recurly.
    pub created_at: Option<String>,
    ///When the usage was recorded in your system.
    pub recording_timestamp: Option<String>,
    ///When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.
    pub usage_timestamp: Option<String>,
    ///Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.
    pub merchant_tag: Option<String>,
    pub id: Option<String>,
    ///The percentage tiers of the subscription based on the usage_timestamp. If tier_type = flat, percentage_tiers = []
    pub percentage_tiers: Option<Vec<SubscriptionAddOnPercentageTier>>,
}
impl std::fmt::Display for Usage {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct UsageCreate {
    ///When the usage was recorded in your system.
    pub recording_timestamp: Option<String>,
    ///When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition.
    pub usage_timestamp: Option<String>,
    ///The amount of usage. Can be positive, negative, or 0. If the Decimal Quantity feature is enabled, this value will be rounded to nine decimal places.  Otherwise, all digits after the decimal will be stripped. If the usage-based add-on is billed with a percentage, your usage should be a monetary amount formatted in cents (e.g., $5.00 is "500").
    pub amount: Option<f64>,
    ///Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint.
    pub merchant_tag: Option<String>,
}
impl std::fmt::Display for UsageCreate {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct UsageList {
    ///Indicates there are more results on subsequent pages.
    pub has_more: Option<bool>,
    ///Path to subsequent page of results.
    pub next: Option<String>,
    ///Will always be List.
    pub object: Option<String>,
    pub data: Option<Vec<Usage>>,
}
impl std::fmt::Display for UsageList {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct User {
    pub id: Option<String>,
    pub object: Option<String>,
    pub created_at: Option<String>,
    pub last_name: Option<String>,
    pub deleted_at: Option<String>,
    pub time_zone: Option<String>,
    pub email: Option<String>,
    pub first_name: Option<String>,
}
impl std::fmt::Display for User {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CreateAccountRequired {
    pub email: String,
    pub preferred_locale: String,
    pub username: String,
    pub invoice_template_id: String,
    pub transaction_type: String,
    pub billing_info: BillingInfoCreate,
    pub code: String,
    pub exemption_certificate: String,
    pub bill_to: String,
    pub address: Address,
    pub company: String,
    pub shipping_addresses: Vec<ShippingAddressCreate>,
    pub acquisition: AccountAcquisitionUpdate,
    pub parent_account_code: String,
    pub tax_exempt: bool,
    pub first_name: String,
    pub cc_emails: String,
    pub parent_account_id: String,
    pub vat_number: String,
    pub last_name: String,
    pub dunning_campaign_id: String,
    pub custom_fields: CustomFields,
}
impl std::fmt::Display for CreateAccountRequired {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CreateCouponRequired {
    pub hosted_description: String,
    pub item_codes: Vec<String>,
    pub duration: String,
    pub name: String,
    pub redeem_by_date: String,
    pub applies_to_non_plan_charges: bool,
    pub temporal_amount: i64,
    pub temporal_unit: String,
    pub max_redemptions_per_account: i64,
    pub discount_percent: i64,
    pub free_trial_amount: i64,
    pub applies_to_all_plans: bool,
    pub plan_codes: Vec<String>,
    pub redemption_resource: String,
    pub invoice_description: String,
    pub applies_to_all_items: bool,
    pub free_trial_unit: String,
    pub discount_type: String,
    pub max_redemptions: i64,
    pub currencies: Vec<CouponPricing>,
    pub coupon_type: String,
    pub code: String,
    pub unique_code_template: String,
}
impl std::fmt::Display for CreateCouponRequired {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CreateLineItemRequired {
    pub currency: String,
    pub account_id: String,
    pub unit_amount: f64,
    #[serde(rename = "type")]
    pub type_: String,
}
impl std::fmt::Display for CreateLineItemRequired {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CreateShippingAddressRequired {
    pub first_name: String,
    pub account_id: String,
    pub postal_code: String,
    pub country: String,
    pub last_name: String,
    pub street1: String,
    pub city: String,
}
impl std::fmt::Display for CreateShippingAddressRequired {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{}", serde_json::to_string(self).unwrap())
    }
}