blockchyp 2.30.1

This is the SDK for Rust. Like all BlockChyp SDKs, it provides a full client for the BlockChyp gateway and BlockChyp payment terminals.
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
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
// Copyright 2019-2026 BlockChyp, Inc. All rights reserved. Use of this code
// is governed by a license that can be found in the LICENSE file.
//
// This file was generated automatically by the BlockChyp SDK Generator.
// Changes to this file will be lost every time the code is regenerated.
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use serde_json::{self, Value};
use serde::de::DeserializeOwned;
use chrono::{DateTime, Utc};

// APICredentials models gateway credentials.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct APICredentials {
    #[serde(rename = "apiKey")]
	pub api_key: String,
    #[serde(rename = "bearerToken")]
    pub bearer_token: String,
    #[serde(rename = "signingKey")]
    pub signing_key: String,
}

// CardType is used to differentiate credit, debit, and EBT.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] 
pub enum CardType {
    #[default]
    Credit,
    Debit,
    EBT,
    BlockchainGift,
    Healthcare,
}

// SignatureFormat is used to specify the output format for customer signature images.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum SignatureFormat {
    #[serde(rename = "")]
    #[default]
    None,
    #[serde(rename = "png")]
    PNG,
    #[serde(rename = "jpg")]
    JPG,
    #[serde(rename = "gif")]
    GIF,
}

impl SignatureFormat {
    // Function to get the string representation of each variant
    pub fn as_str(&self) -> &'static str {
        match self {
            SignatureFormat::None => "",
            SignatureFormat::PNG => "png",
            SignatureFormat::JPG => "jpg",
            SignatureFormat::GIF => "gif",
        }
    }
}

// CVMType designates a customer verification method.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum CVMType {
    #[serde(rename = "Signature")]
    Signature,
    #[serde(rename = "Offline PIN")]
    OfflinePIN,
    #[serde(rename = "Online PIN")]
    OnlinePIN,
    #[serde(rename = "CDCVM")]
    CDCVM,
    #[serde(rename = "No CVM")]
    NoCVM,
    #[serde(other)]
    #[default]
    Default,
}

impl CVMType {
    pub fn as_str(&self) -> &'static str {
        match self {
            CVMType::Signature => "Signature",
            CVMType::OfflinePIN => "Offline PIN",
            CVMType::OnlinePIN => "Online PIN",
            CVMType::CDCVM => "CDCVM",
            CVMType::NoCVM => "No CVM",
            CVMType::Default => "",
        }
    }
}

// PromptType is used to specify the type of text input data being requested
// from a customer.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum PromptType {
    #[serde(rename = "amount")]
    Amount,
    #[serde(rename = "email")]
    Email,
    #[serde(rename = "phone")]
    Phone,
    #[serde(rename = "customer-number")]
    CustomerNumber,
    #[serde(rename = "rewards-number")]
    RewardsNumber,
    #[serde(rename = "first-name")]
    FirstName,
    #[serde(rename = "last-name")]
    LastName,
    #[serde(other)]
    #[default]
    Default,
}

impl PromptType {
    // Function to get the string representation of each variant
    pub fn as_str(&self) -> &'static str {
        match self {
            PromptType::Amount => "amount",
            PromptType::Email => "email",
            PromptType::Phone => "phone",
            PromptType::CustomerNumber => "customer-number",
            PromptType::RewardsNumber => "rewards-number",
            PromptType::FirstName => "first-name",
            PromptType::LastName => "last-name",
            PromptType::Default => "",
        }
    }
}

// AVSResponse indicates the result of address verification.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum AVSResponse {
    #[serde(rename = "")]
    NotApplicable,
    #[serde(rename = "not_supported")]
    NotSupported,
    #[serde(rename = "retry")]
    Retry,
    #[serde(rename = "no_match")]
    NoMatch,
    #[serde(rename = "address_match")]
    AddressMatch,
    #[serde(rename = "zip_match")]
    PostalCodeMatch,
    #[serde(rename = "match")]
    AddressAndPostalCodeMatch,
    #[serde(other)]
    #[default]
    Default,
}

impl AVSResponse {
    // Function to get the string representation of each variant
    pub fn as_str(&self) -> &'static str {
        match self {
            AVSResponse::NotApplicable => "",
            AVSResponse::NotSupported => "not_supported",
            AVSResponse::Retry => "retry",
            AVSResponse::NoMatch => "no_match",
            AVSResponse::AddressMatch => "address_match",
            AVSResponse::PostalCodeMatch => "zip_match",
            AVSResponse::AddressAndPostalCodeMatch => "match",
            AVSResponse::Default => "",
        }
    }
}

// HealthcareType is a category of healthcare.
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum HealthcareType {
    Healthcare,
    Prescription,
    Vision,
    Clinic,
    Dental,
    #[default]
    Default,
}

impl HealthcareType {
    // Function to get the string representation of each variant
    pub fn as_str(&self) -> &'static str {
        match self {
            HealthcareType::Healthcare => "healthcare",
            HealthcareType::Prescription => "prescription",
            HealthcareType::Vision => "vision",
            HealthcareType::Clinic => "clinic",
            HealthcareType::Dental => "dental",
            HealthcareType::Default => "",
        }
    }
}

// RoundingMode indicates how partial penny rounding operations should work
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
pub enum RoundingMode {
    Up,
    Nearest,
    Down,
    #[default]
    Default,
}

impl RoundingMode {
    // Function to get the string representation of each variant
    pub fn as_str(&self) -> &'static str {
        match self {
            RoundingMode::Up => "up",
            RoundingMode::Nearest => "nearest",
            RoundingMode::Down => "down",
            RoundingMode::Default => "",
        }
    }
}


/// EMV fields we recommend developers put on their receipts.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ReceiptSuggestions {
    /// The EMV Application Identifier.
    #[serde(rename = "aid", default)]
    pub aid: String,
    /// The EMV Application Request Cryptogram.
    #[serde(rename = "arqc", default)]
    pub arqc: String,
    /// The EMV Issuer Application Data.
    #[serde(rename = "iad", default)]
    pub iad: String,
    /// The EMV Authorization Response Code.
    #[serde(rename = "arc", default)]
    pub arc: String,
    /// The EMV Transaction Certificate.
    #[serde(rename = "tc", default)]
    pub tc: String,
    /// The EMV Terminal Verification Response.
    #[serde(rename = "tvr", default)]
    pub tvr: String,
    /// The EMV Transaction Status Indicator.
    #[serde(rename = "tsi", default)]
    pub tsi: String,
    /// The ID of the payment terminal.
    #[serde(rename = "terminalId", default)]
    pub terminal_id: String,
    /// The name of the merchant's business.
    #[serde(rename = "merchantName", default)]
    pub merchant_name: String,
    /// The ID of the merchant.
    #[serde(rename = "merchantId", default)]
    pub merchant_id: String,
    /// The partially masked merchant key required on EMV receipts.
    #[serde(rename = "merchantKey", default)]
    pub merchant_key: String,
    /// A description of the selected AID.
    #[serde(rename = "applicationLabel", default)]
    pub application_label: String,
    /// That the receipt should contain a signature line.
    #[serde(rename = "requestSignature")]
    pub request_signature: bool,
    /// The masked primary account number of the payment card, as required.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The amount authorized by the payment network. Could be less than the requested amount
/// for partial auth.
    #[serde(rename = "authorizedAmount")]
    pub authorized_amount: String,
    /// The type of transaction performed (CHARGE, PREAUTH, REFUND, etc).
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The method by which the payment card was entered (MSR, CHIP, KEYED, etc.).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// That PIN verification was performed.
    #[serde(rename = "pinVerified", default)]
    pub pin_verified: bool,
    /// The customer verification method used for the transaction.
    #[serde(rename = "cvmUsed", default)]
    pub cvm_used: CVMType,
    /// That a chip read failure caused the transaction to fall back to the magstripe.
    #[serde(rename = "fallback", default)]
    pub fallback: bool,
    /// The sequence of the transaction in the batch.
    #[serde(rename = "batchSequence", default)]
    pub batch_sequence: i32,
    /// The amount of cash back that was approved.
    #[serde(rename = "cashBackAmount", default)]
    pub cash_back_amount: String,
    /// The amount added to the transaction to cover eligible credit card fees.
    #[serde(rename = "surcharge", default)]
    pub surcharge: String,
    /// The discount applied to the transaction for payment methods ineligible for
/// surcharges.
    #[serde(rename = "cashDiscount", default)]
    pub cash_discount: String,

}

/// A basic api acknowledgement.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Acknowledgement {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// A request for customer signature data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CaptureSignatureRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// A location on the filesystem which a customer signature should be written to.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat", default)]
    pub sig_format: SignatureFormat,
    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
/// not provided, the signature is returned in the terminal's max resolution.
    #[serde(rename = "sigWidth", default)]
    pub sig_width: i32,
    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
/// indicate whether or not a signature is required by the card in the receipt suggestions
/// response.
    #[serde(rename = "disableSignature", default)]
    pub disable_signature: bool,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// Customer signature data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CaptureSignatureResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,

}

/// Information needed to test connectivity with a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PingRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The response to a ping request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PingResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,

}

/// Information needed to retrieve location information for a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct LocateRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The response to a locate request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct LocateResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// The name assigned to the terminal at activation.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// The local IP address of the terminal.
    #[serde(rename = "ipAddress")]
    pub ip_address: String,
    /// Whether or not the terminal is running in cloud relay mode.
    #[serde(rename = "cloudRelay")]
    pub cloud_relay: bool,
    /// The terminal's public key.
    #[serde(rename = "publicKey")]
    pub public_key: String,

}

/// A message to be displayed on the terminal screen.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MessageRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// The message to be displayed on the terminal.
    #[serde(rename = "message")]
    pub message: String,

}

/// A simple yes no prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BooleanPromptRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// The preferred caption for the 'yes' button.
    #[serde(rename = "yesCaption")]
    pub yes_caption: String,
    /// The preferred caption for the 'no' button.
    #[serde(rename = "noCaption")]
    pub no_caption: String,
    /// The text to be displayed on the terminal.
    #[serde(rename = "prompt")]
    pub prompt: String,

}

/// A text prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TextPromptRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// The prompt type (email, phone, etc).
    #[serde(rename = "promptType")]
    pub prompt_type: PromptType,

}

/// Models a customer data request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CustomerRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// BlockChyp assigned customer id.
    #[serde(rename = "customerId")]
    pub customer_id: String,
    /// Optional customer ref that can be used for the client's system's customer id.
    #[serde(rename = "customerRef")]
    pub customer_ref: String,

}

/// Models a customer data response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CustomerResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The customer record.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,

}

/// Models a customer data search request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CustomerSearchRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Search query for customer searches.
    #[serde(rename = "query")]
    pub query: String,

}

/// Models a customer data search request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UpdateCustomerRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Models a customer update request.
    #[serde(rename = "customer")]
    pub customer: Customer,

}

/// Models customer search results.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CustomerSearchResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The customer results matching the search query.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,

}

/// Models a customer record.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Customer {
    /// BlockChyp assigned customer id.
    #[serde(rename = "id")]
    pub id: String,
    /// Optional customer ref that can be used for the client's system's customer id.
    #[serde(rename = "customerRef")]
    pub customer_ref: String,
    /// Customer's first name.
    #[serde(rename = "firstName")]
    pub first_name: String,
    /// Customer's last name.
    #[serde(rename = "lastName")]
    pub last_name: String,
    /// Customer's company name.
    #[serde(rename = "companyName")]
    pub company_name: String,
    /// Customer's email address.
    #[serde(rename = "emailAddress")]
    pub email_address: String,
    /// Customer's SMS or mobile number.
    #[serde(rename = "smsNumber")]
    pub sms_number: String,
    /// Model saved payment methods associated with a customer.
    #[serde(rename = "paymentMethods")]
    pub payment_methods: Option<Vec<CustomerToken>>,

}

/// Retrieves token metadata.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TokenMetadataRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The token to retrieve.
    #[serde(rename = "token")]
    pub token: String,

}

/// Models a payment token metadata response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TokenMetadataResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The token metadata for a given query.
    #[serde(rename = "token")]
    pub token: CustomerToken,
    /// Details about a payment card derived from its BIN/IIN.
    #[serde(rename = "cardMetadata", default)]
    pub card_metadata: Option<CardMetadata>,

}

/// Updates a payment token.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UpdateTokenRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The token to update.
    #[serde(rename = "token")]
    pub token: String,
    /// Bank account holder type (personal or business).
    #[serde(rename = "accountHolderType")]
    pub account_holder_type: String,
    /// Bank account type (checking or saving).
    #[serde(rename = "accountType")]
    pub account_type: String,
    /// Bank name.
    #[serde(rename = "bankName")]
    pub bank_name: String,
    /// Card holder name.
    #[serde(rename = "cardHolderName")]
    pub card_holder_name: String,
    /// Expiry month.
    #[serde(rename = "expiryMonth")]
    pub expiry_month: String,
    /// Expiry year.
    #[serde(rename = "expiryYear")]
    pub expiry_year: String,
    /// Address.
    #[serde(rename = "address")]
    pub address: String,
    /// Postal code.
    #[serde(rename = "postalCode")]
    pub postal_code: String,

}

/// The response to a update token request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UpdateTokenResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The updated token for a given query.
    #[serde(rename = "token")]
    pub token: CustomerToken,

}

/// Models a customer token.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CustomerToken {
    /// BlockChyp assigned customer id.
    #[serde(rename = "token")]
    pub token: String,
    /// Masked primary account number.
    #[serde(rename = "maskedPan")]
    pub masked_pan: String,
    /// Expiration month.
    #[serde(rename = "expiryMonth")]
    pub expiry_month: String,
    /// Expiration month.
    #[serde(rename = "expiryYear")]
    pub expiry_year: String,
    /// Payment type.
    #[serde(rename = "paymentType")]
    pub payment_type: String,
    /// Bank account type (checking, saving).
    #[serde(rename = "accountType")]
    pub account_type: String,
    /// Bank account holder type (personal, business).
    #[serde(rename = "accountHolderType")]
    pub account_holder_type: String,
    /// Bank name.
    #[serde(rename = "bankName")]
    pub bank_name: String,
    /// Routing number.
    #[serde(rename = "routingNumber")]
    pub routing_number: String,
    /// Token hash (generated with a static salt, Merchant ID, Registration Date and PAN.
    #[serde(rename = "tokenHash")]
    pub token_hash: String,
    /// Card bin.
    #[serde(rename = "bin")]
    pub bin: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// The card holder name.
    #[serde(rename = "cardHolderName", default)]
    pub card_holder_name: String,
    /// Models customer records associated with a payment token.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,

}

/// The response to a text prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TextPromptResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The text prompt response.
    #[serde(rename = "response")]
    pub response: String,

}

/// The response to a boolean prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BooleanPromptResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The boolean prompt response.
    #[serde(rename = "response")]
    pub response: bool,

}

/// Shows details about a white listed card.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct WhiteListedCard {
    /// The card BIN.
    #[serde(rename = "bin")]
    pub bin: String,
    /// The track 1 data from the card.
    #[serde(rename = "track1")]
    pub track_1: String,
    /// The track 2 data from the card.
    #[serde(rename = "track2")]
    pub track_2: String,
    /// The card primary account number.
    #[serde(rename = "pan")]
    pub pan: String,

}

/// An authorization request for a charge, preauth, or reverse transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AuthorizationRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token", default)]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1", default)]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2", default)]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan", default)]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber", default)]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName", default)]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv", default)]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry", default)]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn", default)]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock", default)]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType", default)]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// A location on the filesystem which a customer signature should be written to.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat", default)]
    pub sig_format: SignatureFormat,
    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
/// not provided, the signature is returned in the terminal's max resolution.
    #[serde(rename = "sigWidth", default)]
    pub sig_width: i32,
    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
/// indicate whether or not a signature is required by the card in the receipt suggestions
/// response.
    #[serde(rename = "disableSignature", default)]
    pub disable_signature: bool,
    /// The tip amount.
    #[serde(rename = "tipAmount", default)]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount", default)]
    pub tax_amount: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// Can be used to update a pre-auth to a new amount, sometimes called incremental auth.
    #[serde(rename = "transactionId", default)]
    pub transaction_id: String,
    /// Used to validate online gift card authorizations.
    #[serde(rename = "onlineAuthCode", default)]
    pub online_auth_code: String,
    /// That the payment method should be added to the token vault alongside the
/// authorization.
    #[serde(rename = "enroll", default)]
    pub enroll: bool,
    /// Duplicate detection should be bypassed.
    #[serde(rename = "bypassDupeFilter", default)]
    pub bypass_dupe_filter: bool,
    /// A narrative description of the transaction.
    #[serde(rename = "description", default)]
    pub description: String,
    /// That the terminal should request a tip from the user before starting the transaction.
    #[serde(rename = "promptForTip", default)]
    pub prompt_for_tip: bool,
    /// That cash back should be enabled for supported cards.
    #[serde(rename = "cashBackEnabled", default)]
    pub cash_back_enabled: bool,
    /// That this transaction should be treated as MOTO with a card on file.
    #[serde(rename = "cardOnFile", default)]
    pub card_on_file: bool,
    /// That this transaction should be treated as a recurring transaction.
    #[serde(rename = "recurring", default)]
    pub recurring: bool,
    /// Manually sets the CIT (Customer Initiated Transaction) flag.
    #[serde(rename = "cit", default)]
    pub cit: bool,
    /// Manually sets the MIT (Merchant Initiated Transaction) flag.
    #[serde(rename = "mit", default)]
    pub mit: bool,
    /// That this transaction should be treated as a subscription recurring transaction.
    #[serde(rename = "subscription", default)]
    pub subscription: bool,
    /// The purchase order number, if known.
    #[serde(rename = "purchaseOrderNumber", default)]
    pub purchase_order_number: String,
    /// The supplier reference number, if known.
    #[serde(rename = "supplierReferenceNumber", default)]
    pub supplier_reference_number: String,
    /// An item to display. Can be overwritten or appended, based on the request type.
    #[serde(rename = "lineItems")]
    pub line_items: Option<Vec<TransactionDisplayItem>>,
    /// A map of alternate currencies and the price in each currency. Use only if you want to set
/// your own exchange rate for a crypto transaction.
    #[serde(rename = "altPrices", default)]
    pub alt_prices: HashMap<String, String>,
    /// Customer information.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// How partial pennies should be rounded for calculated values like surcharges.
/// Rounding up is the default behavior.
    #[serde(rename = "roundingMode")]
    pub rounding_mode: Option<RoundingMode>,
    /// Details for HSA/FSA transactions.
    #[serde(rename = "healthcareMetadata", default)]
    pub healthcare_metadata: Option<HealthcareMetadata>,
    /// That the transaction should be a cryptocurrency transaction. Value should be a crypto
/// currency code (ETH, BTC) or ANY to prompt the user to choose from supported
/// cryptocurrencies.
    #[serde(rename = "cryptocurrency", default)]
    pub cryptocurrency: Option<String>,
    /// An optional parameter that can be used to force a crypto transaction onto a level one or
/// level two network. Valid values are L1 and L2. Defaults to L1.
    #[serde(rename = "cryptoNetwork", default)]
    pub crypto_network: Option<String>,
    /// Can be used to specify a specific receive address for a crypto transaction. Disabled by
/// default. This should only be used by sophisticated users with access to properly
/// configured hot wallets.
    #[serde(rename = "cryptoReceiveAddress", default)]
    pub crypto_receive_address: Option<String>,
    /// Can optionally add a label to the payment request if the target cryptocurrency
/// supports labels. Defaults to the merchant's DBA Name.
    #[serde(rename = "paymentRequestLabel", default)]
    pub payment_request_label: Option<String>,
    /// Can optionally add a message to the payment request if the target cryptocurrency
/// supports labels. Defaults to empty.
    #[serde(rename = "paymentRequestMessage", default)]
    pub payment_request_message: Option<String>,
    /// Instructs the terminal to simulate a post auth chip rejection that would trigger an
/// automatic reversal.
    #[serde(rename = "simulateChipRejection", default)]
    pub simulate_chip_rejection: bool,
    /// Instructs the terminal to simulate an out of order automatic reversal.
    #[serde(rename = "simulateOutOfOrderReversal", default)]
    pub simulate_out_of_order_reversal: bool,
    /// Causes auto-reversals on the terminal to be executed asyncronously. Use with caution
/// and in conjunction with the transaction status API.
    #[serde(rename = "asyncReversals", default)]
    pub async_reversals: bool,
    /// A passthrough surcharge amount. This surcharge amount will be passed directly to the
/// gateway and is not directly calculated.
    #[serde(rename = "passthroughSurcharge", default)]
    pub passthrough_surcharge: String,
    /// Marks a transaction as HSA/FSA.
    #[serde(rename = "healthcare", default)]
    pub healthcare: bool,
    /// The total amount to process as healthcare.
    #[serde(rename = "healthcareTotal", default)]
    pub healthcare_total: String,
    /// The total amount to process as ebt.
    #[serde(rename = "ebtTotal", default)]
    pub ebt_total: String,
    /// That this transaction will include a card metadata lookup.
    #[serde(rename = "cardMetadataLookup", default)]
    pub card_metadata_lookup: bool,
    /// The total discount amount for the transaction, and will overide additive logic for
/// line item discounts.
    #[serde(rename = "totalDiscountAmount", default)]
    pub total_discount_amount: String,
    /// The shipping cost associated with the transaction.
    #[serde(rename = "shippingAmount", default)]
    pub shipping_amount: String,
    /// The duty amount associated with the transaction.
    #[serde(rename = "dutyAmount", default)]
    pub duty_amount: String,
    /// The processor ID associated with the transaction.
    #[serde(rename = "processorId", default)]
    pub processor_id: String,
    /// The external customer ID associated with the transaction.
    #[serde(rename = "externalCustomerId", default)]
    pub external_customer_id: String,
    /// Three character, numeric, ship-to country code. Defaults to '840' (USA) if not
/// specified.
    #[serde(rename = "destinationCountryCode", default)]
    pub destination_country_code: String,
    /// Nine character postal code for shipping origin addresses. For US addresses, this is a
/// 5+4 ZIP or five digit ZIP.
    #[serde(rename = "shipFromPostalCode", default)]
    pub ship_from_postal_code: String,
    /// Nine character postal code for shipping destination addresses. For US addresses,
/// this is a 5+4 ZIP or five digit ZIP.
    #[serde(rename = "shipToPostalCode", default)]
    pub ship_to_postal_code: String,
    /// The purchase order date.
    #[serde(rename = "orderDate", default)]
    pub order_date: Option<DateTime<Utc>>,
    /// The number of shipments the original authorization will be broken into.
    #[serde(rename = "shipmentCount")]
    pub shipment_count: i32,
    /// Which shipment this particular capture is for.
    #[serde(rename = "shipmentNumber")]
    pub shipment_number: i32,

}

/// Essential information about a payment card derived from its BIN/IIN.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CardMetadata {
    /// The brand or network of the card (e.g., Visa, Mastercard, Amex).
    #[serde(rename = "cardBrand")]
    pub card_brand: String,
    /// The name of the financial institution that issued the card.
    #[serde(rename = "issuerName")]
    pub issuer_name: String,
    /// Whether the card supports Level 3 processing for detailed transaction data.
    #[serde(rename = "l3")]
    pub l_3: bool,
    /// Whether the card supports Level 2 processing for additional transaction data.
    #[serde(rename = "l2")]
    pub l_2: bool,
    /// The general category or type of the card product.
    #[serde(rename = "productType")]
    pub product_type: String,
    /// The specific name or designation of the card product.
    #[serde(rename = "productName")]
    pub product_name: String,
    /// Whether the card is an Electronic Benefit Transfer (EBT) card.
    #[serde(rename = "ebt")]
    pub ebt: bool,
    /// Whether the card is a debit card.
    #[serde(rename = "debit")]
    pub debit: bool,
    /// Whether the card is a healthcare-specific payment card.
    #[serde(rename = "healthcare")]
    pub healthcare: bool,
    /// Whether the card is a prepaid card.
    #[serde(rename = "prepaid")]
    pub prepaid: bool,
    /// The geographical region associated with the card's issuer.
    #[serde(rename = "region")]
    pub region: String,
    /// The country associated with the card's issuer.
    #[serde(rename = "country")]
    pub country: String,

}

/// Retrieves card metadata.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CardMetadataRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token", default)]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1", default)]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2", default)]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan", default)]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber", default)]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName", default)]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv", default)]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry", default)]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn", default)]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock", default)]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType", default)]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// Marks a transaction as HSA/FSA.
    #[serde(rename = "healthcare", default)]
    pub healthcare: bool,

}

/// The response to a card metadata request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CardMetadataResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// Details about a payment card derived from its BIN/IIN.
    #[serde(rename = "cardMetadata", default)]
    pub card_metadata: Option<CardMetadata>,

}

/// A request for the remaining balance on a payment type.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BalanceRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token", default)]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1", default)]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2", default)]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan", default)]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber", default)]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName", default)]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv", default)]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry", default)]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn", default)]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock", default)]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType", default)]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The response to a balance request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BalanceResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// Remaining balance on the payment method.
    #[serde(rename = "remainingBalance", default)]
    pub remaining_balance: String,

}

/// A refund request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct RefundRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token", default)]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1", default)]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2", default)]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan", default)]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber", default)]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName", default)]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv", default)]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry", default)]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn", default)]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock", default)]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType", default)]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// The ID of the previous transaction being referenced.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// A location on the filesystem which a customer signature should be written to.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat", default)]
    pub sig_format: SignatureFormat,
    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
/// not provided, the signature is returned in the terminal's max resolution.
    #[serde(rename = "sigWidth", default)]
    pub sig_width: i32,
    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
/// indicate whether or not a signature is required by the card in the receipt suggestions
/// response.
    #[serde(rename = "disableSignature", default)]
    pub disable_signature: bool,
    /// The tip amount.
    #[serde(rename = "tipAmount", default)]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount", default)]
    pub tax_amount: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// Details for HSA/FSA transactions.
    #[serde(rename = "healthcareMetadata", default)]
    pub healthcare_metadata: Option<HealthcareMetadata>,
    /// Instructs the terminal to simulate a post auth chip rejection that would trigger an
/// automatic reversal.
    #[serde(rename = "simulateChipRejection", default)]
    pub simulate_chip_rejection: bool,
    /// Instructs the terminal to simulate an out of order automatic reversal.
    #[serde(rename = "simulateOutOfOrderReversal", default)]
    pub simulate_out_of_order_reversal: bool,
    /// Causes auto-reversals on the terminal to be executed asyncronously. Use with caution
/// and in conjunction with the transaction status API.
    #[serde(rename = "asyncReversals", default)]
    pub async_reversals: bool,
    /// Manually sets the CIT (Customer Initiated Transaction) flag.
    #[serde(rename = "cit", default)]
    pub cit: bool,
    /// Manually sets the MIT (Merchant Initiated Transaction) flag.
    #[serde(rename = "mit", default)]
    pub mit: bool,
    /// That this transaction will include a card metadata lookup.
    #[serde(rename = "cardMetadataLookup", default)]
    pub card_metadata_lookup: bool,

}

/// The information needed to capture a preauth.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CaptureRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The ID of the previous transaction being referenced.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// The tip amount.
    #[serde(rename = "tipAmount", default)]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount", default)]
    pub tax_amount: String,
    /// The number of shipments the original authorization will be broken into.
    #[serde(rename = "shipmentCount")]
    pub shipment_count: i32,
    /// Which shipment this particular capture is for.
    #[serde(rename = "shipmentNumber")]
    pub shipment_number: i32,
    /// A passthrough surcharge amount. This surcharge amount will be passed directly to the
/// gateway and is not directly calculated.
    #[serde(rename = "passthroughSurcharge", default)]
    pub passthrough_surcharge: String,

}

/// The response to a capture request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CaptureResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode", default)]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode", default)]
    pub auth_response_code: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// Whether or not the transaction was approved for a partial amount.
    #[serde(rename = "partialAuth")]
    pub partial_auth: bool,
    /// Whether or not an alternate currency was used.
    #[serde(rename = "altCurrency")]
    pub alt_currency: bool,
    /// Whether or not a request was settled on an FSA card.
    #[serde(rename = "fsaAuth")]
    pub fsa_auth: bool,
    /// The currency code used for the transaction.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "requestedAmount")]
    pub requested_amount: String,
    /// The authorized amount. May not match the requested amount in the event of a partial
/// auth.
    #[serde(rename = "authorizedAmount")]
    pub authorized_amount: String,
    /// The remaining balance on the payment method.
    #[serde(rename = "remainingBalance")]
    pub remaining_balance: String,
    /// The tip amount.
    #[serde(rename = "tipAmount")]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount")]
    pub tax_amount: String,
    /// The cash back amount the customer requested during the transaction.
    #[serde(rename = "requestedCashBackAmount")]
    pub requested_cash_back_amount: String,
    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
/// requested, or zero.
    #[serde(rename = "authorizedCashBackAmount")]
    pub authorized_cash_back_amount: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,

}

/// A void request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct VoidRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The ID of the previous transaction being referenced.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,

}

/// The response to a void request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct VoidResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode", default)]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode", default)]
    pub auth_response_code: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,

}

/// The information needed to enroll a new payment method in the token vault.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct EnrollRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token", default)]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1", default)]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2", default)]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan", default)]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber", default)]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName", default)]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv", default)]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry", default)]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn", default)]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock", default)]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType", default)]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// The method by which the payment card was entered (MSR, CHIP, KEYED, etc.).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// Customer with which the new token should be associated.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// That this transaction should be treated as a recurring transaction.
    #[serde(rename = "recurring", default)]
    pub recurring: bool,
    /// That this transaction and any using this token should be treated as a subscription
/// recurring transaction.
    #[serde(rename = "subscription", default)]
    pub subscription: bool,
    /// That this transaction will include a card metadata lookup.
    #[serde(rename = "cardMetadataLookup", default)]
    pub card_metadata_lookup: bool,
    /// The type of account (checking, savings, etc) for an ACH payment method.
    #[serde(rename = "accountType", default)]
    pub account_type: String,
    /// The type of account holder (personal, business, etc) for an ACH payment method.
    #[serde(rename = "accountHolderType", default)]
    pub account_holder_type: String,
    /// The bank name for an ACH payment method.
    #[serde(rename = "bankName", default)]
    pub bank_name: String,

}

/// The response to an enroll request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct EnrollResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode", default)]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode", default)]
    pub auth_response_code: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// Details about a payment card derived from its BIN/IIN.
    #[serde(rename = "cardMetadata", default)]
    pub card_metadata: Option<CardMetadata>,
    /// The type of account (checking, savings, etc) for an ACH payment method.
    #[serde(rename = "accountType", default)]
    pub account_type: String,
    /// The type of account holder (personal, business, etc) for an ACH payment method.
    #[serde(rename = "accountHolderType", default)]
    pub account_holder_type: String,
    /// The bank name for an ACH payment method.
    #[serde(rename = "bankName", default)]
    pub bank_name: String,
    /// The token hash (generated with a static salt, Merchant ID, Registration Date and PAN).
    #[serde(rename = "tokenHash", default)]
    pub token_hash: String,
    /// The first 8 digits of the card aka the BIN.
    #[serde(rename = "bin", default)]
    pub bin: String,

}

/// The information needed to enroll a new payment method in the token vault.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ClearTerminalRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The information needed to activate or recharge a gift card.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct GiftActivateRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The response to a gift activate request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct GiftActivateResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// That the card was activated.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The amount of the transaction.
    #[serde(rename = "amount")]
    pub amount: String,
    /// The current balance of the gift card.
    #[serde(rename = "currentBalance")]
    pub current_balance: String,
    /// The currency code used for the transaction.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The public key of the activated card.
    #[serde(rename = "publicKey")]
    pub public_key: String,
    /// The masked card identifier.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,

}

/// The information needed to manually close a credit card batch.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CloseBatchRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Optional batch id.
    #[serde(rename = "batchId")]
    pub batch_id: String,

}

/// The response to a close batch request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CloseBatchResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// A collection of batches closed during the batch close operation.
    #[serde(rename = "batches")]
    pub batches: Option<Vec<BatchSummary>>,

}

/// The fields needed for custom Terms and Conditions prompts.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The ID of the previous transaction being referenced.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// A location on the filesystem which a customer signature should be written to.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat", default)]
    pub sig_format: SignatureFormat,
    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
/// not provided, the signature is returned in the terminal's max resolution.
    #[serde(rename = "sigWidth", default)]
    pub sig_width: i32,
    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
/// indicate whether or not a signature is required by the card in the receipt suggestions
/// response.
    #[serde(rename = "disableSignature", default)]
    pub disable_signature: bool,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// An alias for a Terms and Conditions template configured in the BlockChyp dashboard.
    #[serde(rename = "tcAlias")]
    pub tc_alias: String,
    /// The name of the Terms and Conditions the user is accepting.
    #[serde(rename = "tcName")]
    pub tc_name: String,
    /// The content of the terms and conditions that will be presented to the user.
    #[serde(rename = "tcContent")]
    pub tc_content: String,
    /// A hash of the terms and conditions content that can be used for caching.
    #[serde(rename = "contentHash")]
    pub content_hash: String,
    /// That a signature should be requested.
    #[serde(rename = "sigRequired")]
    pub sig_required: bool,

}

/// A signature capture response for Terms and Conditions.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,

}

/// The response to an authorization request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AuthorizationResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode", default)]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode", default)]
    pub auth_response_code: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// Whether or not the transaction was approved for a partial amount.
    #[serde(rename = "partialAuth")]
    pub partial_auth: bool,
    /// Whether or not an alternate currency was used.
    #[serde(rename = "altCurrency")]
    pub alt_currency: bool,
    /// Whether or not a request was settled on an FSA card.
    #[serde(rename = "fsaAuth")]
    pub fsa_auth: bool,
    /// The currency code used for the transaction.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "requestedAmount")]
    pub requested_amount: String,
    /// The authorized amount. May not match the requested amount in the event of a partial
/// auth.
    #[serde(rename = "authorizedAmount")]
    pub authorized_amount: String,
    /// The remaining balance on the payment method.
    #[serde(rename = "remainingBalance")]
    pub remaining_balance: String,
    /// The tip amount.
    #[serde(rename = "tipAmount")]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount")]
    pub tax_amount: String,
    /// The cash back amount the customer requested during the transaction.
    #[serde(rename = "requestedCashBackAmount")]
    pub requested_cash_back_amount: String,
    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
/// requested, or zero.
    #[serde(rename = "authorizedCashBackAmount")]
    pub authorized_cash_back_amount: String,
    /// That the transaction has met the standard criteria for confirmation on the network.
/// (For example, 6 confirmations for level one bitcoin.)
    #[serde(rename = "confirmed")]
    pub confirmed: bool,
    /// The amount submitted to the blockchain.
    #[serde(rename = "cryptoAuthorizedAmount")]
    pub crypto_authorized_amount: String,
    /// The network level fee assessed for the transaction denominated in cryptocurrency.
/// This fee goes to channel operators and crypto miners, not BlockChyp.
    #[serde(rename = "cryptoNetworkFee")]
    pub crypto_network_fee: String,
    /// The three letter cryptocurrency code used for the transactions.
    #[serde(rename = "cryptocurrency")]
    pub cryptocurrency: String,
    /// Whether or not the transaction was processed on the level one or level two network.
    #[serde(rename = "cryptoNetwork")]
    pub crypto_network: String,
    /// The address on the crypto network the transaction was sent to.
    #[serde(rename = "cryptoReceiveAddress")]
    pub crypto_receive_address: String,
    /// Hash or other identifier that identifies the block on the cryptocurrency network, if
/// available or relevant.
    #[serde(rename = "cryptoBlock")]
    pub crypto_block: String,
    /// Hash or other transaction identifier that identifies the transaction on the
/// cryptocurrency network, if available or relevant.
    #[serde(rename = "cryptoTransactionId")]
    pub crypto_transaction_id: String,
    /// The payment request URI used for the transaction, if available.
    #[serde(rename = "cryptoPaymentRequest")]
    pub crypto_payment_request: String,
    /// Used for additional status information related to crypto transactions.
    #[serde(rename = "cryptoStatus")]
    pub crypto_status: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// Card BIN ranges can be whitelisted so that they are read instead of being processed
/// directly. This is useful for integration with legacy gift card systems.
    #[serde(rename = "whiteListedCard")]
    pub white_listed_card: Option<WhiteListedCard>,
    /// That the transaction was flagged for store and forward due to network problems.
    #[serde(rename = "storeAndForward")]
    pub store_and_forward: bool,
    /// The current status of a transaction.
    #[serde(rename = "status")]
    pub status: String,
    /// Details about a payment card derived from its BIN/IIN.
    #[serde(rename = "cardMetadata", default)]
    pub card_metadata: Option<CardMetadata>,

}

/// Models the request for updated information about a transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionStatusRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The BlockChyp assigned transaction id.
    #[serde(rename = "transactionId", default)]
    pub transaction_id: String,

}

/// Models the request for updated information about a payment link.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentLinkStatusRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The link code assigned to the payment link.
    #[serde(rename = "linkCode")]
    pub link_code: String,

}

/// Models the status of a payment link.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentLinkStatusResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The code used to retrieve the payment link.
    #[serde(rename = "linkCode")]
    pub link_code: String,
    /// The BlockChyp merchant id associated with a payment link.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The customer id associated with a payment link.
    #[serde(rename = "customerId", default)]
    pub customer_id: String,
    /// The user's internal reference for any transaction that may occur.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The user's internal reference for an order.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// That the order is tax exempt.
    #[serde(rename = "taxExempt", default)]
    pub tax_exempt: bool,
    /// That the amount to collect via the payment link.
    #[serde(rename = "amount", default)]
    pub amount: String,
    /// The sales tax to be collected via the payment link.
    #[serde(rename = "taxAmount", default)]
    pub tax_amount: String,
    /// Subject for email notifications.
    #[serde(rename = "subject", default)]
    pub subject: String,
    /// Id of the most recent transaction associated with the link.
    #[serde(rename = "transactionId", default)]
    pub transaction_id: String,
    /// Description associated with the payment link.
    #[serde(rename = "description", default)]
    pub description: String,
    /// Date and time the link will expire.
    #[serde(rename = "expiration", default)]
    pub expiration: Option<DateTime<Utc>>,
    /// Date and time the link was created.
    #[serde(rename = "dateCreated", default)]
    pub date_created: DateTime<Utc>,
    /// Line item level data if provided.
    #[serde(rename = "transactionDetails", default)]
    pub transaction_details: Option<TransactionDisplayTransaction>,
    /// The current status of the payment link.
    #[serde(rename = "status", default)]
    pub status: String,
    /// Alias for any terms and conditions language associated with the link.
    #[serde(rename = "tcAlias", default)]
    pub tc_alias: String,
    /// Name of any terms and conditions agreements associated with the payment link.
    #[serde(rename = "tcName", default)]
    pub tc_name: String,
    /// Full text of any terms and conditions language associated with the agreement.
    #[serde(rename = "tcContent", default)]
    pub tc_content: String,
    /// That the link is intended for internal use by the merchant.
    #[serde(rename = "cashierFacing", default)]
    pub cashier_facing: bool,
    /// That the payment method should be enrolled in the token vault.
    #[serde(rename = "enroll", default)]
    pub enroll: bool,
    /// That the link should only be used for enrollment in the token vault without any
/// underlying payment transaction.
    #[serde(rename = "enrollOnly", default)]
    pub enroll_only: bool,
    /// Returns details about the last transaction status.
    #[serde(rename = "lastTransaction", default)]
    pub last_transaction: Option<AuthorizationResponse>,
    /// Returns a list of transactions associated with the link, including any declines.
    #[serde(rename = "transactionHistory", default)]
    pub transaction_history: Option<Vec<AuthorizationResponse>>,

}

/// Models the status of a transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionStatus {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode", default)]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode", default)]
    pub auth_response_code: String,
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId", default)]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig", default)]
    pub sig: String,
    /// Whether or not the transaction was approved for a partial amount.
    #[serde(rename = "partialAuth")]
    pub partial_auth: bool,
    /// Whether or not an alternate currency was used.
    #[serde(rename = "altCurrency")]
    pub alt_currency: bool,
    /// Whether or not a request was settled on an FSA card.
    #[serde(rename = "fsaAuth")]
    pub fsa_auth: bool,
    /// The currency code used for the transaction.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "requestedAmount")]
    pub requested_amount: String,
    /// The authorized amount. May not match the requested amount in the event of a partial
/// auth.
    #[serde(rename = "authorizedAmount")]
    pub authorized_amount: String,
    /// The remaining balance on the payment method.
    #[serde(rename = "remainingBalance")]
    pub remaining_balance: String,
    /// The tip amount.
    #[serde(rename = "tipAmount")]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount")]
    pub tax_amount: String,
    /// The cash back amount the customer requested during the transaction.
    #[serde(rename = "requestedCashBackAmount")]
    pub requested_cash_back_amount: String,
    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
/// requested, or zero.
    #[serde(rename = "authorizedCashBackAmount")]
    pub authorized_cash_back_amount: String,
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token", default)]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod", default)]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType", default)]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network", default)]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo", default)]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan", default)]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey", default)]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert", default)]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder", default)]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth", default)]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear", default)]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode", default)]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address", default)]
    pub address: String,
    /// The card country.
    #[serde(rename = "country", default)]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse", default)]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Option<Vec<Customer>>,
    /// The hex encoded signature data.
    #[serde(rename = "sigFile", default)]
    pub sig_file: String,
    /// That the transaction was flagged for store and forward due to network problems.
    #[serde(rename = "storeAndForward")]
    pub store_and_forward: bool,

}

/// An item level discount for transaction display. Discounts never combine.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionDisplayDiscount {
    /// The discount description.
    #[serde(rename = "description")]
    pub description: String,
    /// The amount of the discount.
    #[serde(rename = "amount")]
    pub amount: String,

}

/// An item category in a transaction display. Groups combine if their descriptions
/// match. Calculated subtotal amounts are rounded to two decimal places of precision.
/// Quantity is a floating point number that is not rounded at all.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionDisplayItem {
    /// A unique value identifying the item. This is not required, but recommended since it is
/// required to update or delete line items.
    #[serde(rename = "id")]
    pub id: String,
    /// A description of the line item.
    #[serde(rename = "description")]
    pub description: String,
    /// The price of the line item.
    #[serde(rename = "price")]
    pub price: String,
    /// The quantity of the line item.
    #[serde(rename = "quantity")]
    pub quantity: f64,
    /// An item category in a transaction display. Groups combine if their descriptions
/// match. Calculated subtotal amounts are rounded to two decimal places of precision.
/// Quantity is a floating point number that is not rounded at all.
    #[serde(rename = "extended")]
    pub extended: String,
    /// An alphanumeric code for units of measurement as used in international trade.
    #[serde(rename = "unitCode")]
    pub unit_code: String,
    /// An international description code of the item.
    #[serde(rename = "commodityCode")]
    pub commodity_code: String,
    /// A merchant-defined description code of the item.
    #[serde(rename = "productCode")]
    pub product_code: String,
    /// Are displayed under their corresponding item.
    #[serde(rename = "discounts")]
    pub discounts: Option<Vec<TransactionDisplayDiscount>>,
    /// The amount of any value added taxes which apply to the item.
    #[serde(rename = "taxAmount", default)]
    pub tax_amount: String,
    /// The tax rate as a percentage. Example: '8.5' for 8.5% tax rate.
    #[serde(rename = "taxRate", default)]
    pub tax_rate: String,
    /// How tax was applied to discounted items. '0' = no discount, '1' = tax calculated after
/// discount, '2' = taxcalculated before discount.
    #[serde(rename = "discountCode", default)]
    pub discount_code: String,

}

/// The items to display on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionDisplayTransaction {
    /// The subtotal to display.
    #[serde(rename = "subtotal")]
    pub subtotal: String,
    /// The tax to display.
    #[serde(rename = "tax")]
    pub tax: String,
    /// The total to display.
    #[serde(rename = "total")]
    pub total: String,
    /// An item to display. Can be overwritten or appended, based on the request type.
    #[serde(rename = "items")]
    pub items: Option<Vec<TransactionDisplayItem>>,

}

/// Used to start or update a transaction line item display on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionDisplayRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// Transaction to display on the terminal.
    #[serde(rename = "transaction")]
    pub transaction: Option<TransactionDisplayTransaction>,

}

/// The response to a basic API health check. If the security context permits it, the
/// response may also include the public key of the current merchant.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct HeartbeatResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The timestamp of the heartbeat.
    #[serde(rename = "timestamp")]
    pub timestamp: DateTime<Utc>,
    /// The public key of the clockchain. This is blockchain stuff that you don't really need to
/// worry about. It is a base 58 encoded and compressed eliptic curve public key. For the
/// production clockchain, this will always be:
/// '3cuhsckVUd9HzMjbdUSW17aY5kCcm1d6YAphJMUwmtXRj7WLyU'.
    #[serde(rename = "clockchain")]
    pub clockchain: String,
    /// The hash of the last tick block.
    #[serde(rename = "latestTick")]
    pub latest_tick: String,
    /// The public key for the merchant's blockchain.
    #[serde(rename = "merchantPublicKey")]
    pub merchant_public_key: String,

}

/// A request for the status of a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalStatusRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// The current status of a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalStatusResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the terminal is idle.
    #[serde(rename = "idle")]
    pub idle: bool,
    /// Whether or not a card is currently in the card slot.
    #[serde(rename = "cardInSlot")]
    pub card_in_slot: bool,
    /// The operation that the terminal is performing.
    #[serde(rename = "status")]
    pub status: String,
    /// The transaction reference for an ongoing transaction, if one was specified at request
/// time.
    #[serde(rename = "transactionRef")]
    pub transaction_ref: String,
    /// The timestamp of the last status change.
    #[serde(rename = "since")]
    pub since: DateTime<Utc>,

}

/// Creates a payment link.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentLinkRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// Automatically send the link via an email.
    #[serde(rename = "autoSend")]
    pub auto_send: bool,
    /// That the payment method should be added to the token vault alongside the
/// authorization.
    #[serde(rename = "enroll", default)]
    pub enroll: bool,
    /// That the link should be used to enroll a token only. Can only be used in cashier mode.
    #[serde(rename = "enrollOnly", default)]
    pub enroll_only: bool,
    /// That the QR Code binary should be returned.
    #[serde(rename = "qrcodeBinary", default)]
    pub qrcode_binary: bool,
    /// Determines the size of the qr code to be returned.
    #[serde(rename = "qrcodeSize", default)]
    pub qrcode_size: i32,
    /// Number of days until the payment link expires.
    #[serde(rename = "daysToExpiration", default)]
    pub days_to_expiration: i32,
    /// Flags the payment link as cashier facing.
    #[serde(rename = "cashier")]
    pub cashier: bool,
    /// Description explaining the transaction for display to the user.
    #[serde(rename = "description")]
    pub description: String,
    /// Subject of the payment email.
    #[serde(rename = "subject")]
    pub subject: String,
    /// Transaction details for display on the payment email.
    #[serde(rename = "transaction")]
    pub transaction: Option<TransactionDisplayTransaction>,
    /// Customer information.
    #[serde(rename = "customer")]
    pub customer: Customer,
    /// Optional callback url to which transaction responses for this link will be posted.
    #[serde(rename = "callbackUrl")]
    pub callback_url: String,
    /// An alias for a Terms and Conditions template configured in the BlockChyp dashboard.
    #[serde(rename = "tcAlias")]
    pub tc_alias: String,
    /// The name of the Terms and Conditions the user is accepting.
    #[serde(rename = "tcName")]
    pub tc_name: String,
    /// The content of the terms and conditions that will be presented to the user.
    #[serde(rename = "tcContent")]
    pub tc_content: String,
    /// That the transaction should be a cryptocurrency transaction. Value should be a crypto
/// currency code (ETH, BTC) or ANY to prompt the user to choose from supported
/// cryptocurrencies.
    #[serde(rename = "cryptocurrency")]
    pub cryptocurrency: Option<String>,
    /// An optional parameter that can be used to force a crypto transaction onto a level one or
/// level two network. Valid values are L1 and L2. Defaults to L1.
    #[serde(rename = "cryptoNetwork")]
    pub crypto_network: Option<String>,
    /// Can be used to specify a specific receive address for a crypto transaction. Disabled by
/// default. This should only be used by sophisticated users with access to properly
/// configured hot wallets.
    #[serde(rename = "cryptoReceiveAddress")]
    pub crypto_receive_address: Option<String>,
    /// Can optionally add a label to the payment request if the target cryptocurrency
/// supports labels. Defaults to the merchant's DBA Name.
    #[serde(rename = "paymentRequestLabel")]
    pub payment_request_label: Option<String>,
    /// Can optionally add a message to the payment request if the target cryptocurrency
/// supports labels. Defaults to empty.
    #[serde(rename = "paymentRequestMessage")]
    pub payment_request_message: Option<String>,

}

/// Creates a payment link.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentLinkResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The payment link code.
    #[serde(rename = "linkCode")]
    pub link_code: String,
    /// The url for the payment link.
    #[serde(rename = "url")]
    pub url: String,
    /// The url for a QR Code associated with this link.
    #[serde(rename = "qrcodeUrl")]
    pub qrcode_url: String,
    /// The hex encoded binary for the QR Code, if requested. Encoded in PNG format.
    #[serde(rename = "qrcodeBinary")]
    pub qrcode_binary: String,
    /// The customer id created or used for the payment.
    #[serde(rename = "customerId")]
    pub customer_id: String,

}

/// Cancels a pending payment link. Payment links that have already been used cannot be
/// canceled and the request will be rejected.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CancelPaymentLinkRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment link code to cancel.
    #[serde(rename = "linkCode")]
    pub link_code: String,

}

/// Success or failure of a payment link cancellation.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CancelPaymentLinkResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// Resends a pending payment link. Payment links that have already been used or cancelled
/// cannot be resent and the request will be rejected.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ResendPaymentLinkRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The payment link code to cancel.
    #[serde(rename = "linkCode")]
    pub link_code: String,

}

/// Success or failure of a payment link resend operation.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ResendPaymentLinkResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// Computes the cash discount for a cash discount if enabled.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CashDiscountRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,
    /// How partial pennies should be rounded for calculated values like surcharges.
/// Rounding up is the default behavior.
    #[serde(rename = "roundingMode")]
    pub rounding_mode: Option<RoundingMode>,

}

/// Models the results of a cash discount calculation.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CashDiscountResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The new calculated total amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// The normal surcharge for a transaction. Will only be returned if an offsetting cash
/// discount is also returned.
    #[serde(rename = "surcharge")]
    pub surcharge: String,
    /// The cash discount. Will not be returned in surcharge only mode.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: String,

}

/// Models a batch history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionHistoryRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Optional search query. Will match amount, last 4 and customer name. batchId and
/// terminalName are not supported with this option.
    #[serde(rename = "query")]
    pub query: String,
    /// Optional batch id.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// Optional terminal name.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// Optional start date filter for batch history.
    #[serde(rename = "startDate")]
    pub start_date: DateTime<Utc>,
    /// Optional end date filter for batch history.
    #[serde(rename = "endDate")]
    pub end_date: DateTime<Utc>,
    /// Max results to be returned by this request.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for results to be returned.
    #[serde(rename = "startIndex")]
    pub start_index: i32,

}

/// Models response to a batch history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TransactionHistoryResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the response came from the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Batch identifier if filtered by batch.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// Terminal name if filtered by terminal.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// Start date if filtered by start date.
    #[serde(rename = "startDate")]
    pub start_date: DateTime<Utc>,
    /// End date if filtered by end date.
    #[serde(rename = "endDate")]
    pub end_date: DateTime<Utc>,
    /// Max results from the original request echoed back. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index from the original request echoed back.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "totalResultCount")]
    pub total_result_count: i32,
    /// Matching transaction history.
    #[serde(rename = "transactions")]
    pub transactions: Option<Vec<AuthorizationResponse>>,

}

/// Models a batch history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BatchHistoryRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Optional start date filter for batch history.
    #[serde(rename = "startDate")]
    pub start_date: DateTime<Utc>,
    /// Optional end date filter for batch history.
    #[serde(rename = "endDate")]
    pub end_date: DateTime<Utc>,
    /// Max results to be returned by this request. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for results to be returned.
    #[serde(rename = "startIndex")]
    pub start_index: i32,

}

/// Models response to a batch history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BatchHistoryResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the response came from the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Start date if filtered by start date.
    #[serde(rename = "startDate")]
    pub start_date: DateTime<Utc>,
    /// End date if filtered by end date.
    #[serde(rename = "endDate")]
    pub end_date: DateTime<Utc>,
    /// Merchant's batch history in descending order.
    #[serde(rename = "batches")]
    pub batches: Option<Vec<BatchSummary>>,
    /// Max results from the original request echoed back.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index from the original request echoed back.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "totalResultCount")]
    pub total_result_count: i32,

}

/// Models high level information about a single batch.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BatchSummary {
    /// Batch identifier.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// Entry method for the batch, if any.
    #[serde(rename = "entryMethod")]
    pub entry_method: String,
    /// Merchant deposit account into which proceeds should be deposited.
    #[serde(rename = "destinationAccountId")]
    pub destination_account_id: String,
    /// The new captured amount.
    #[serde(rename = "capturedAmount")]
    pub captured_amount: String,
    /// The amount of preauths opened during the batch that have not been captured.
    #[serde(rename = "openPreauths")]
    pub open_preauths: String,
    /// The currency the batch was settled in.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// Flag indicating whether or not the batch is open.
    #[serde(rename = "open")]
    pub open: bool,
    /// Date and time of the first transaction for this batch.
    #[serde(rename = "openDate")]
    pub open_date: DateTime<Utc>,
    /// Date and time the batch was closed.
    #[serde(rename = "closeDate")]
    pub close_date: DateTime<Utc>,

}

/// Models a request for details about a single batch.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BatchDetailsRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// Id for the batch to be retrieved.
    #[serde(rename = "batchId")]
    pub batch_id: String,

}

/// Models a response for details about a single batch.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BatchDetailsResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the response came from the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Batch identifier.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// Entry method for the batch, if any.
    #[serde(rename = "entryMethod")]
    pub entry_method: String,
    /// Merchant deposit account into which proceeds should be deposited.
    #[serde(rename = "destinationAccountId")]
    pub destination_account_id: String,
    /// The new captured amount.
    #[serde(rename = "capturedAmount")]
    pub captured_amount: String,
    /// Preauths from this batch still open.
    #[serde(rename = "openPreauths")]
    pub open_preauths: String,
    /// The total volume from this batch.
    #[serde(rename = "totalVolume")]
    pub total_volume: String,
    /// The total number of transactions in this batch.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i32,
    /// The total volume of gift cards sold.
    #[serde(rename = "giftCardsSold")]
    pub gift_cards_sold: String,
    /// The total volume of gift cards transactions.
    #[serde(rename = "giftCardVolume")]
    pub gift_card_volume: String,
    /// The expected volume for this batch, usually captured volume less gift card volume.
    #[serde(rename = "expectedDeposit")]
    pub expected_deposit: String,
    /// Flag indicating whether or not the batch is open.
    #[serde(rename = "open")]
    pub open: bool,
    /// Date and time of the first transaction for this batch.
    #[serde(rename = "openDate")]
    pub open_date: DateTime<Utc>,
    /// Date and time the batch was closed.
    #[serde(rename = "closeDate")]
    pub close_date: DateTime<Utc>,
    /// Merchant's batch history in descending order.
    #[serde(rename = "volumeByTerminal")]
    pub volume_by_terminal: Option<Vec<TerminalVolume>>,
    /// The net volume for this batch, usually expected volume less daily fees volume.
    #[serde(rename = "netDeposit")]
    pub net_deposit: String,
    /// The daily fees for this batch
    #[serde(rename = "dailyFees")]
    pub daily_fees: String,

}

/// Models transaction volume for a single terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalVolume {
    /// The terminal name assigned during activation.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// The manufacturer's serial number.
    #[serde(rename = "serialNumber")]
    pub serial_number: String,
    /// The terminal type.
    #[serde(rename = "terminalType")]
    pub terminal_type: String,
    /// The captured amount.
    #[serde(rename = "capturedAmount")]
    pub captured_amount: String,
    /// The number of transactions run on this terminal.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i32,

}

/// Models basic information needed to create a test merchant.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AddTestMerchantRequest {
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The DBA name for the test merchant.
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The corporate name for the test merchant.
    #[serde(rename = "companyName")]
    pub company_name: String,
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,

}

/// Models basic information needed to create a gateway merchant.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AddGatewayMerchantRequest {
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The merchant profile to be boarded.
    #[serde(rename = "profile")]
    pub profile: MerchantProfile,
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,

}

/// Models a request for information about the merchant profile.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantProfileRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The merchant id. Optional for merchant scoped requests.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,

}

/// Models a request related to a platform configuration.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantPlatformRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The platform configuration id.
    #[serde(rename = "platformId")]
    pub platform_id: String,

}

/// Models a request for adding a new user to a merchant account.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct InviteMerchantUserRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The merchant id. Optional for merchant scoped requests.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The email address of the user.
    #[serde(rename = "email")]
    pub email: String,
    /// The first name of the new user.
    #[serde(rename = "firstName")]
    pub first_name: String,
    /// The last name of the new user.
    #[serde(rename = "lastName")]
    pub last_name: String,
    /// An optional array of role codes that will be assigned to the user. If omitted defaults to
/// the default merchant role.
    #[serde(rename = "roles")]
    pub roles: Option<Vec<String>>,

}

/// Models a physical address.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Address {
    /// The first line of the street address.
    #[serde(rename = "address1")]
    pub address_1: String,
    /// The second line of the street address.
    #[serde(rename = "address2")]
    pub address_2: String,
    /// The city associated with the street address.
    #[serde(rename = "city")]
    pub city: String,
    /// The state or province associated with the street address.
    #[serde(rename = "stateOrProvince")]
    pub state_or_province: String,
    /// The postal code associated with the street address.
    #[serde(rename = "postalCode")]
    pub postal_code: String,
    /// The ISO country code associated with the street address.
    #[serde(rename = "countryCode")]
    pub country_code: String,
    /// The latitude component of the address's GPS coordinates.
    #[serde(rename = "latitude")]
    pub latitude: f64,
    /// The longitude component of the address's GPS coordinates.
    #[serde(rename = "longitude")]
    pub longitude: f64,

}

/// Models a merchant profile.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantProfile {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// That the response came from the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The merchant id.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The primary bank mid.
    #[serde(rename = "bankMid")]
    pub bank_mid: String,
    /// The merchant's company name.
    #[serde(rename = "companyName")]
    pub company_name: String,
    /// The dba name of the merchant.
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The name the merchant prefers on payment link invoices.
    #[serde(rename = "invoiceName")]
    pub invoice_name: String,
    /// The contact name for the merchant.
    #[serde(rename = "contactName")]
    pub contact_name: String,
    /// The contact number for the merchant.
    #[serde(rename = "contactNumber")]
    pub contact_number: String,
    /// The location name.
    #[serde(rename = "locationName")]
    pub location_name: String,
    /// The store number.
    #[serde(rename = "storeNumber")]
    pub store_number: String,
    /// The partner assigne reference for this merchant.
    #[serde(rename = "partnerRef")]
    pub partner_ref: String,
    /// The merchant's local time zone.
    #[serde(rename = "timeZone")]
    pub time_zone: String,
    /// The batch close time in the merchant's time zone.
    #[serde(rename = "batchCloseTime")]
    pub batch_close_time: String,
    /// The terminal firmware update time.
    #[serde(rename = "terminalUpdateTime")]
    pub terminal_update_time: String,
    /// Flag indicating whether or not the batch automatically closes.
    #[serde(rename = "autoBatchClose")]
    pub auto_batch_close: bool,
    /// Flag indicating whether or not batch closure emails should be automatically sent.
    #[serde(rename = "disableBatchEmails")]
    pub disable_batch_emails: bool,
    /// Flag indicating whether or not pin entry is enabled.
    #[serde(rename = "pinEnabled")]
    pub pin_enabled: bool,
    /// Flag indicating whether or not cash back is enabled.
    #[serde(rename = "cashBackEnabled")]
    pub cash_back_enabled: bool,
    /// Flag indicating whether or not store and forward is enabled.
    #[serde(rename = "storeAndForwardEnabled")]
    pub store_and_forward_enabled: bool,
    /// Flag indicating whether or not partial authorizations are supported for this
/// merchant.
    #[serde(rename = "partialAuthEnabled")]
    pub partial_auth_enabled: bool,
    /// Flag indicating whether or not this merchant support split settlement.
    #[serde(rename = "splitBankAccountsEnabled")]
    pub split_bank_accounts_enabled: bool,
    /// Floor limit for store and forward transactions.
    #[serde(rename = "storeAndForwardFloorLimit")]
    pub store_and_forward_floor_limit: String,
    /// The blockchyp public key for this merchant.
    #[serde(rename = "publicKey")]
    pub public_key: String,
    /// The underwriting/processing status for the the merchant.
    #[serde(rename = "status")]
    pub status: String,
    /// Enables cash discount or surcharging.
    #[serde(rename = "cashDiscountEnabled")]
    pub cash_discount_enabled: bool,
    /// The post transaction survey timeout in seconds.
    #[serde(rename = "surveyTimeout")]
    pub survey_timeout: i32,
    /// Time a transaction result is displayed on a terminal before the terminal is
/// automatically cleared in seconds.
    #[serde(rename = "cooldownTimeout")]
    pub cooldown_timeout: i32,
    /// That tips are enabled for a merchant account.
    #[serde(rename = "tipEnabled")]
    pub tip_enabled: bool,
    /// That tips should be automatically prompted for after charge and preauth
/// transactions.
    #[serde(rename = "promptForTip")]
    pub prompt_for_tip: bool,
    /// Three default values for tips. Can be provided as a percentage if a percent sign is
/// provided. Otherwise the values are assumed to be basis points.
    #[serde(rename = "tipDefaults")]
    pub tip_defaults: Option<Vec<String>>,
    /// Four default values for cashback prompts.
    #[serde(rename = "cashbackPresets")]
    pub cashback_presets: Option<Vec<String>>,
    /// That EBT cards are enabled.
    #[serde(rename = "ebtEnabled")]
    pub ebt_enabled: bool,
    /// That refunds without transaction references are permitted.
    #[serde(rename = "freeRangeRefundsEnabled")]
    pub free_range_refunds_enabled: bool,
    /// That pin bypass is enabled.
    #[serde(rename = "pinBypassEnabled")]
    pub pin_bypass_enabled: bool,
    /// That gift cards are disabled.
    #[serde(rename = "giftCardsDisabled")]
    pub gift_cards_disabled: bool,
    /// Disables terms and conditions pages in the merchant UI.
    #[serde(rename = "tcDisabled")]
    pub tc_disabled: bool,
    /// That digital signature capture is enabled.
    #[serde(rename = "digitalSignaturesEnabled")]
    pub digital_signatures_enabled: bool,
    /// That transactions should auto-reverse when signatures are refused.
    #[serde(rename = "digitalSignatureReversal")]
    pub digital_signature_reversal: bool,
    /// The address to be used for billing correspondence.
    #[serde(rename = "billingAddress")]
    pub billing_address: Address,
    /// The address to be used for shipping.
    #[serde(rename = "shippingAddress")]
    pub shipping_address: Address,
    /// That Visa cards are supported.
    #[serde(rename = "visa")]
    pub visa: bool,
    /// That MasterCard is supported.
    #[serde(rename = "masterCard")]
    pub master_card: bool,
    /// That American Express is supported.
    #[serde(rename = "amex")]
    pub amex: bool,
    /// That Discover cards are supported.
    #[serde(rename = "discover")]
    pub discover: bool,
    /// That JCB (Japan Card Bureau) cards are supported.
    #[serde(rename = "jcb")]
    pub jcb: bool,
    /// That China Union Pay cards are supported.
    #[serde(rename = "unionPay")]
    pub union_pay: bool,
    /// That contactless EMV cards are supported.
    #[serde(rename = "contactlessEmv")]
    pub contactless_emv: bool,
    /// That manual card entry is enabled.
    #[serde(rename = "manualEntryEnabled")]
    pub manual_entry_enabled: bool,
    /// Requires a zip code to be entered for manually entered transactions.
    #[serde(rename = "manualEntryPromptZip")]
    pub manual_entry_prompt_zip: bool,
    /// Requires a street number to be entered for manually entered transactions.
    #[serde(rename = "manualEntryPromptStreetNumber")]
    pub manual_entry_prompt_street_number: bool,
    /// That this merchant is boarded on BlockChyp in gateway only mode.
    #[serde(rename = "gatewayOnly")]
    pub gateway_only: bool,
    /// Bank accounts for split bank account merchants.
    #[serde(rename = "bankAccounts")]
    pub bank_accounts: Option<Vec<BankAccount>>,
    /// That a merchant is allowed to send a surcharge amount directly to the gateway.
    #[serde(rename = "passthroughSurchargeEnabled")]
    pub passthrough_surcharge_enabled: bool,
    /// That CVV verification is enabled for manually entered transactions.
    #[serde(rename = "cvvVerificationEnabled")]
    pub cvv_verification_enabled: bool,
    /// That CVV mismatch (N) responses should be declined.
    #[serde(rename = "cvvVerificationNEnabled")]
    pub cvv_verification_nenabled: bool,
    /// That CVV not processed (P) responses should be declined.
    #[serde(rename = "cvvVerificationPEnabled")]
    pub cvv_verification_penabled: bool,
    /// That CVV should be on card but is not indicated (S) responses should be declined.
    #[serde(rename = "cvvVerificationSEnabled")]
    pub cvv_verification_senabled: bool,
    /// That issuer not certified or has not provided encryption key (U) responses should be
/// declined.
    #[serde(rename = "cvvVerificationUEnabled")]
    pub cvv_verification_uenabled: bool,
    /// That the merchant follows the partner's CVV settings.
    #[serde(rename = "followPartnerCvvSettings")]
    pub follow_partner_cvv_settings: bool,
    /// The AVS (Address Verification Service) rule to apply. Allowed values are
/// 'allow_all', 'require_full_match', 'require_zip_match',
/// 'require_address_match'. If avsRule is empty, then merchant follows partner
/// setting.
    #[serde(rename = "avsRule")]
    pub avs_rule: String,
    /// That the merchant follows the partner's AVS settings.
    #[serde(rename = "followPartnerAvsSettings")]
    pub follow_partner_avs_settings: bool,
    /// Flag indicating whether or not account updater is enrolled. Note that only merchant's
/// whose partner is enrolled will be processed by the account updater.
    #[serde(rename = "accountUpdaterEnrolled")]
    pub account_updater_enrolled: bool,
    /// Whether the merchant should bypass an auth with TSYS on Enrollment.
    #[serde(rename = "bypassEnrollAuthEnabled")]
    pub bypass_enroll_auth_enabled: bool,

}

/// Models a response for a single merchant profile.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantProfileResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// That the response came from the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The merchant id.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The primary bank mid.
    #[serde(rename = "bankMid")]
    pub bank_mid: String,
    /// The merchant's company name.
    #[serde(rename = "companyName")]
    pub company_name: String,
    /// The dba name of the merchant.
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The name the merchant prefers on payment link invoices.
    #[serde(rename = "invoiceName")]
    pub invoice_name: String,
    /// The contact name for the merchant.
    #[serde(rename = "contactName")]
    pub contact_name: String,
    /// The contact number for the merchant.
    #[serde(rename = "contactNumber")]
    pub contact_number: String,
    /// The location name.
    #[serde(rename = "locationName")]
    pub location_name: String,
    /// The store number.
    #[serde(rename = "storeNumber")]
    pub store_number: String,
    /// The partner assigne reference for this merchant.
    #[serde(rename = "partnerRef")]
    pub partner_ref: String,
    /// The merchant's local time zone.
    #[serde(rename = "timeZone")]
    pub time_zone: String,
    /// The batch close time in the merchant's time zone.
    #[serde(rename = "batchCloseTime")]
    pub batch_close_time: String,
    /// The terminal firmware update time.
    #[serde(rename = "terminalUpdateTime")]
    pub terminal_update_time: String,
    /// Flag indicating whether or not the batch automatically closes.
    #[serde(rename = "autoBatchClose")]
    pub auto_batch_close: bool,
    /// Flag indicating whether or not batch closure emails should be automatically sent.
    #[serde(rename = "disableBatchEmails")]
    pub disable_batch_emails: bool,
    /// Flag indicating whether or not pin entry is enabled.
    #[serde(rename = "pinEnabled")]
    pub pin_enabled: bool,
    /// Flag indicating whether or not cash back is enabled.
    #[serde(rename = "cashBackEnabled")]
    pub cash_back_enabled: bool,
    /// Flag indicating whether or not store and forward is enabled.
    #[serde(rename = "storeAndForwardEnabled")]
    pub store_and_forward_enabled: bool,
    /// Flag indicating whether or not partial authorizations are supported for this
/// merchant.
    #[serde(rename = "partialAuthEnabled")]
    pub partial_auth_enabled: bool,
    /// Flag indicating whether or not this merchant support split settlement.
    #[serde(rename = "splitBankAccountsEnabled")]
    pub split_bank_accounts_enabled: bool,
    /// Floor limit for store and forward transactions.
    #[serde(rename = "storeAndForwardFloorLimit")]
    pub store_and_forward_floor_limit: String,
    /// The blockchyp public key for this merchant.
    #[serde(rename = "publicKey")]
    pub public_key: String,
    /// The underwriting/processing status for the the merchant.
    #[serde(rename = "status")]
    pub status: String,
    /// Enables cash discount or surcharging.
    #[serde(rename = "cashDiscountEnabled")]
    pub cash_discount_enabled: bool,
    /// The post transaction survey timeout in seconds.
    #[serde(rename = "surveyTimeout")]
    pub survey_timeout: i32,
    /// Time a transaction result is displayed on a terminal before the terminal is
/// automatically cleared in seconds.
    #[serde(rename = "cooldownTimeout")]
    pub cooldown_timeout: i32,
    /// That tips are enabled for a merchant account.
    #[serde(rename = "tipEnabled")]
    pub tip_enabled: bool,
    /// That tips should be automatically prompted for after charge and preauth
/// transactions.
    #[serde(rename = "promptForTip")]
    pub prompt_for_tip: bool,
    /// Three default values for tips. Can be provided as a percentage if a percent sign is
/// provided. Otherwise the values are assumed to be basis points.
    #[serde(rename = "tipDefaults")]
    pub tip_defaults: Option<Vec<String>>,
    /// Four default values for cashback prompts.
    #[serde(rename = "cashbackPresets")]
    pub cashback_presets: Option<Vec<String>>,
    /// That EBT cards are enabled.
    #[serde(rename = "ebtEnabled")]
    pub ebt_enabled: bool,
    /// That refunds without transaction references are permitted.
    #[serde(rename = "freeRangeRefundsEnabled")]
    pub free_range_refunds_enabled: bool,
    /// That pin bypass is enabled.
    #[serde(rename = "pinBypassEnabled")]
    pub pin_bypass_enabled: bool,
    /// That gift cards are disabled.
    #[serde(rename = "giftCardsDisabled")]
    pub gift_cards_disabled: bool,
    /// Disables terms and conditions pages in the merchant UI.
    #[serde(rename = "tcDisabled")]
    pub tc_disabled: bool,
    /// That digital signature capture is enabled.
    #[serde(rename = "digitalSignaturesEnabled")]
    pub digital_signatures_enabled: bool,
    /// That transactions should auto-reverse when signatures are refused.
    #[serde(rename = "digitalSignatureReversal")]
    pub digital_signature_reversal: bool,
    /// The address to be used for billing correspondence.
    #[serde(rename = "billingAddress")]
    pub billing_address: Address,
    /// The address to be used for shipping.
    #[serde(rename = "shippingAddress")]
    pub shipping_address: Address,
    /// That Visa cards are supported.
    #[serde(rename = "visa")]
    pub visa: bool,
    /// That MasterCard is supported.
    #[serde(rename = "masterCard")]
    pub master_card: bool,
    /// That American Express is supported.
    #[serde(rename = "amex")]
    pub amex: bool,
    /// That Discover cards are supported.
    #[serde(rename = "discover")]
    pub discover: bool,
    /// That JCB (Japan Card Bureau) cards are supported.
    #[serde(rename = "jcb")]
    pub jcb: bool,
    /// That China Union Pay cards are supported.
    #[serde(rename = "unionPay")]
    pub union_pay: bool,
    /// That contactless EMV cards are supported.
    #[serde(rename = "contactlessEmv")]
    pub contactless_emv: bool,
    /// That manual card entry is enabled.
    #[serde(rename = "manualEntryEnabled")]
    pub manual_entry_enabled: bool,
    /// Requires a zip code to be entered for manually entered transactions.
    #[serde(rename = "manualEntryPromptZip")]
    pub manual_entry_prompt_zip: bool,
    /// Requires a street number to be entered for manually entered transactions.
    #[serde(rename = "manualEntryPromptStreetNumber")]
    pub manual_entry_prompt_street_number: bool,
    /// That this merchant is boarded on BlockChyp in gateway only mode.
    #[serde(rename = "gatewayOnly")]
    pub gateway_only: bool,
    /// Bank accounts for split bank account merchants.
    #[serde(rename = "bankAccounts")]
    pub bank_accounts: Option<Vec<BankAccount>>,
    /// That a merchant is allowed to send a surcharge amount directly to the gateway.
    #[serde(rename = "passthroughSurchargeEnabled")]
    pub passthrough_surcharge_enabled: bool,
    /// That CVV verification is enabled for manually entered transactions.
    #[serde(rename = "cvvVerificationEnabled")]
    pub cvv_verification_enabled: bool,
    /// That CVV mismatch (N) responses should be declined.
    #[serde(rename = "cvvVerificationNEnabled")]
    pub cvv_verification_nenabled: bool,
    /// That CVV not processed (P) responses should be declined.
    #[serde(rename = "cvvVerificationPEnabled")]
    pub cvv_verification_penabled: bool,
    /// That CVV should be on card but is not indicated (S) responses should be declined.
    #[serde(rename = "cvvVerificationSEnabled")]
    pub cvv_verification_senabled: bool,
    /// That issuer not certified or has not provided encryption key (U) responses should be
/// declined.
    #[serde(rename = "cvvVerificationUEnabled")]
    pub cvv_verification_uenabled: bool,
    /// That the merchant follows the partner's CVV settings.
    #[serde(rename = "followPartnerCvvSettings")]
    pub follow_partner_cvv_settings: bool,
    /// The AVS (Address Verification Service) rule to apply. Allowed values are
/// 'allow_all', 'require_full_match', 'require_zip_match',
/// 'require_address_match'. If avsRule is empty, then merchant follows partner
/// setting.
    #[serde(rename = "avsRule")]
    pub avs_rule: String,
    /// That the merchant follows the partner's AVS settings.
    #[serde(rename = "followPartnerAvsSettings")]
    pub follow_partner_avs_settings: bool,
    /// Flag indicating whether or not account updater is enrolled. Note that only merchant's
/// whose partner is enrolled will be processed by the account updater.
    #[serde(rename = "accountUpdaterEnrolled")]
    pub account_updater_enrolled: bool,
    /// Whether the merchant should bypass an auth with TSYS on Enrollment.
    #[serde(rename = "bypassEnrollAuthEnabled")]
    pub bypass_enroll_auth_enabled: bool,

}

/// Models meta data about a merchant bank account.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BankAccount {
    /// The account identifier to be used with authorization requests.
    #[serde(rename = "id")]
    pub id: String,
    /// The name of the account.
    #[serde(rename = "name")]
    pub name: String,
    /// The purpose of the account.
    #[serde(rename = "purpose")]
    pub purpose: String,
    /// The masked account number.
    #[serde(rename = "maskedAccountNumber")]
    pub masked_account_number: String,

}

/// Returns a list of queued transactions on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ListQueuedTransactionsRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// A list of queued transactions on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ListQueuedTransactionsResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// A list of queued transactions on the terminal.
    #[serde(rename = "transactionRefs")]
    pub transaction_refs: Option<Vec<String>>,

}

/// Deletes one or all transactions from a terminal queue.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteQueuedTransactionRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName", default)]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,
    /// A transaction reference string of the transaction to delete. Passing `*` will clear
/// all queued transactions.
    #[serde(rename = "transactionRef")]
    pub transaction_ref: String,

}

/// The response to a delete queued transaction request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteQueuedTransactionResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// Deletes a customer record.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteCustomerRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The ID of the customer to delete.
    #[serde(rename = "customerId")]
    pub customer_id: String,

}

/// The response to a delete customer request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteCustomerResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// Deletes a payment token.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteTokenRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The token to delete.
    #[serde(rename = "token")]
    pub token: String,

}

/// The response to a delete token request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct DeleteTokenResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// Links a payment token with a customer record.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct LinkTokenRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The token to delete.
    #[serde(rename = "token")]
    pub token: String,
    /// BlockChyp assigned customer id.
    #[serde(rename = "customerId")]
    pub customer_id: String,

}

/// Removes a link between a payment token with a customer record, if one exists.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UnlinkTokenRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef", default)]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard", default)]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force", default)]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef", default)]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount", default)]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase", default)]
    pub test_case: String,
    /// The token to delete.
    #[serde(rename = "token")]
    pub token: String,
    /// BlockChyp assigned customer id.
    #[serde(rename = "customerId")]
    pub customer_id: String,

}

/// Fields for HSA/FSA transactions.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct HealthcareMetadata {
    /// A list of healthcare categories in the transaction.
    #[serde(rename = "types")]
    pub types: Option<Vec<HealthcareGroup>>,
    /// That the purchased items were verified against an Inventory Information Approval
/// System (IIAS).
    #[serde(rename = "iiasVerified")]
    pub iias_verified: bool,
    /// That the transaction is exempt from IIAS verification.
    #[serde(rename = "iiasExempt")]
    pub iias_exempt: bool,

}

/// A group of fields for a specific type of healthcare.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct HealthcareGroup {
    /// The type of healthcare cost.
    #[serde(rename = "type")]
    pub type_yo: HealthcareType,
    /// The amount of this type.
    #[serde(rename = "amount")]
    pub amount: String,
    /// The provider ID used for Mastercard and Discover IIAS requests.
    #[serde(rename = "providerId")]
    pub provider_id: String,
    /// The service type code used for Mastercard and Discover IIAS requests.
    #[serde(rename = "serviceTypeCode")]
    pub service_type_code: String,
    /// Thr payer ID/carrier ID used for Mastercard and Discover IIAS requests.
    #[serde(rename = "payerOrCarrierId")]
    pub payer_or_carrier_id: String,
    /// The approval or reject reason code used for Mastercard and Discover IIAS requests.
    #[serde(rename = "approvalRejectReasonCode")]
    pub approval_reject_reason_code: String,

}

/// Models a request for merchant information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct GetMerchantsRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to return test or live merchants.
    #[serde(rename = "test")]
    pub test: bool,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,

}

/// The results for a merchant list request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct GetMerchantsResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Whether or not these results are for test or live merchants.
    #[serde(rename = "test")]
    pub test: bool,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "resultCount")]
    pub result_count: i32,
    /// Merchants in the current page of results.
    #[serde(rename = "merchants")]
    pub merchants: Option<Vec<MerchantProfileResponse>>,

}

/// The results for a merchant users list.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantUsersResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Whether or not these results are for test or live merchants.
    #[serde(rename = "test")]
    pub test: bool,
    /// Users and pending invites associated with the merchant.
    #[serde(rename = "results")]
    pub results: Option<Vec<MerchantUser>>,

}

/// Details about a merchant user.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantUser {
    /// Whether or not these results are for test or live merchants.
    #[serde(rename = "test")]
    pub test: bool,
    /// The user's primary key.
    #[serde(rename = "id")]
    pub id: String,
    /// The user's first name.
    #[serde(rename = "firstName")]
    pub first_name: String,
    /// The user's last name.
    #[serde(rename = "lastName")]
    pub last_name: String,
    /// The user's email address.
    #[serde(rename = "email")]
    pub email: String,
    /// The user account status.
    #[serde(rename = "status")]
    pub status: String,
    /// The type of user account.
    #[serde(rename = "type")]
    pub type_yo: String,
    /// The role codes assigned to this user.
    #[serde(rename = "roles")]
    pub roles: Option<Vec<String>>,
    /// Whether or not this user account is locked.
    #[serde(rename = "locked")]
    pub locked: bool,

}

/// The results for a merchant platforms inquiry.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantPlatformsResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Whether or not these results are for test or live merchants.
    #[serde(rename = "test")]
    pub test: bool,
    /// Enumerates merchant platform settings.
    #[serde(rename = "results")]
    pub results: Option<Vec<MerchantPlatform>>,

}

/// Used to up platform configuration for gateway merchants.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UpdateMerchantPlatformRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The merchant platform configuration.
    #[serde(rename = "platform")]
    pub platform: MerchantPlatform,

}

/// Echoes back the state of the current platform configuration after a change.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UpdateMerchantPlatformResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The current platform configuration.
    #[serde(rename = "platform")]
    pub platform: MerchantPlatform,

}

/// Details about a merchant board platform configuration.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantPlatform {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Primary identifier for a given platform configuration.
    #[serde(rename = "id")]
    pub id: String,
    /// That a platform configuration is disabled.
    #[serde(rename = "disabled")]
    pub disabled: bool,
    /// BlockChyp's code for the boarding platform.
    #[serde(rename = "platformCode")]
    pub platform_code: String,
    /// The platform's priority in a multi platform setup.
    #[serde(rename = "priority")]
    pub priority: i32,
    /// An optional field specifying the merchant's card brand registration record.
    #[serde(rename = "registrationId")]
    pub registration_id: String,
    /// The merchant's primary identifier.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The merchant id assigned by the acquiring bank.
    #[serde(rename = "acquirerMid")]
    pub acquirer_mid: String,
    /// Free form notes description the purpose or intent behind the platform configuration.
    #[serde(rename = "notes")]
    pub notes: String,
    /// The optional entry method code if a platform should only be used for specific entry
/// methods. Leave blank for 'all'.
    #[serde(rename = "entryMethod")]
    pub entry_method: String,
    /// The date the platform configuration was first created.
    #[serde(rename = "dateCreated")]
    pub date_created: String,
    /// The date the platform configuration was last modified.
    #[serde(rename = "lastChange")]
    pub last_change: String,
    /// A map of configuration values specific to the boarding platform. These are not
/// published. Contact your BlockChyp rep for supported values.
    #[serde(rename = "configMap", default)]
    pub config_map: HashMap<String, String>,

}

/// Models a terminal profile request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalProfileRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,

}

/// Models a terminal profile response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalProfileResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Enumerates all terminal profiles in the response.
    #[serde(rename = "results")]
    pub results: Option<Vec<TerminalProfile>>,

}

/// Models a terminal deactivation request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalDeactivationRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The terminal name assigned to the terminal.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// The id assigned by BlockChyp to the terminal.
    #[serde(rename = "terminalId")]
    pub terminal_id: String,

}

/// Models a terminal activation request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalActivationRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The optional merchant id.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The terminal activation code displayed on the terminal.
    #[serde(rename = "activationCode")]
    pub activation_code: String,
    /// The name to be assigned to the terminal. Must be unique for the merchant account.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// That the terminal should be activated in cloud relay mode.
    #[serde(rename = "cloudRelay")]
    pub cloud_relay: bool,

}

/// Details about a merchant board platform configuration.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalProfile {
    /// Primary identifier for a given terminal.
    #[serde(rename = "id")]
    pub id: String,
    /// The terminal's local IP address.
    #[serde(rename = "ipAddress")]
    pub ip_address: String,
    /// The name assigned to the terminal during activation.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// The terminal type.
    #[serde(rename = "terminalType")]
    pub terminal_type: String,
    /// The terminal type display string.
    #[serde(rename = "terminalTypeDisplayString")]
    pub terminal_type_display_string: String,
    /// The current firmware version deployed on the terminal.
    #[serde(rename = "blockChypFirmwareVersion")]
    pub block_chyp_firmware_version: String,
    /// Whether or not the terminal is configured for cloud relay.
    #[serde(rename = "cloudBased")]
    pub cloud_based: bool,
    /// The terminal's elliptic curve public key.
    #[serde(rename = "publicKey")]
    pub public_key: String,
    /// The manufacturer's serial number.
    #[serde(rename = "serialNumber")]
    pub serial_number: String,
    /// Whether or not the terminal is currently online.
    #[serde(rename = "online")]
    pub online: bool,
    /// The date and time the terminal was first brought online.
    #[serde(rename = "since")]
    pub since: String,
    /// The total memory on the terminal.
    #[serde(rename = "totalMemory")]
    pub total_memory: i32,
    /// The storage on the terminal.
    #[serde(rename = "totalStorage")]
    pub total_storage: i32,
    /// The available (unused) memory on the terminal.
    #[serde(rename = "availableMemory")]
    pub available_memory: i32,
    /// The available (unused) storage on the terminal.
    #[serde(rename = "availableStorage")]
    pub available_storage: i32,
    /// The memory currently in use on the terminal.
    #[serde(rename = "usedMemory")]
    pub used_memory: i32,
    /// The storage currently in use on the terminal.
    #[serde(rename = "usedStorage")]
    pub used_storage: i32,
    /// The branding asset currently displayed on the terminal.
    #[serde(rename = "brandingPreview")]
    pub branding_preview: String,
    /// The id of the terminal group to which the terminal belongs, if any.
    #[serde(rename = "groupId")]
    pub group_id: String,
    /// The name of the terminal group to which the terminal belongs, if any.
    #[serde(rename = "groupName")]
    pub group_name: String,

}

/// Models a full terms and conditions template.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsTemplate {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Primary identifier for a given template.
    #[serde(rename = "id")]
    pub id: String,
    /// An alias or code used to refer to a template.
    #[serde(rename = "alias")]
    pub alias: String,
    /// The name of the template. Displayed as the agreement title on the terminal.
    #[serde(rename = "name")]
    pub name: String,
    /// The full text of the agreement template.
    #[serde(rename = "content")]
    pub content: String,

}

/// Models a request to retrieve or manipulate terms and conditions data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsTemplateRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id of a single template.
    #[serde(rename = "templateId")]
    pub template_id: String,

}

/// Models a set of templates responsive to a request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsTemplateResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Results responsive to a request.
    #[serde(rename = "results")]
    pub results: Option<Vec<TermsAndConditionsTemplate>>,
    /// An optional timeout override.
    #[serde(rename = "timeout")]
    pub timeout: i32,

}

/// Models a Terms and Conditions history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsLogRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The identifier of the log entry to be returned for single result requests.
    #[serde(rename = "logEntryId")]
    pub log_entry_id: String,
    /// Optional transaction id if only log entries related to a transaction should be
/// returned.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// An optional start date for filtering response data.
    #[serde(rename = "startDate")]
    pub start_date: String,
    /// An optional end date for filtering response data.
    #[serde(rename = "endDate")]
    pub end_date: String,

}

/// Models a Terms and Conditions history request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsLogResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Optional transaction id if only log entries related to a transaction should be
/// returned.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "resultCount")]
    pub result_count: i32,
    /// The full result set responsive to the original request, subject to pagination limits.
    #[serde(rename = "results")]
    pub results: Option<Vec<TermsAndConditionsLogEntry>>,

}

/// Models a Terms and Conditions log entry.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TermsAndConditionsLogEntry {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Internal id for a Terms and Conditions entry.
    #[serde(rename = "id")]
    pub id: String,
    /// Id of the terminal that captured this terms and conditions entry.
    #[serde(rename = "terminalId")]
    pub terminal_id: String,
    /// Name of the terminal that captured this terms and conditions entry.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// A flag indicating whether or not the terminal was a test terminal.
    #[serde(rename = "test")]
    pub test: bool,
    /// Date and time the terms and conditions acceptance occurred.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// Optional transaction ref if the terms and conditions was associated with a
/// transaction.
    #[serde(rename = "transactionRef")]
    pub transaction_ref: String,
    /// Optional transaction id if only log entries related to a transaction should be
/// returned.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// Alias of the terms and conditions template used for this entry, if any.
    #[serde(rename = "alias")]
    pub alias: String,
    /// Title of the document displayed on the terminal at the time of capture.
    #[serde(rename = "name")]
    pub name: String,
    /// Full text of the document agreed to at the time of signature capture.
    #[serde(rename = "content")]
    pub content: String,
    /// First 32 characters of the full text. Used to support user interfaces that show
/// summaries.
    #[serde(rename = "contentLeader")]
    pub content_leader: String,
    /// A flag that indicates whether or not a signature has been captured.
    #[serde(rename = "hasSignature")]
    pub has_signature: bool,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat", default)]
    pub sig_format: SignatureFormat,
    /// The base 64 encoded signature image if the format requested.
    #[serde(rename = "signature")]
    pub signature: String,

}

/// Models a survey question.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SurveyQuestion {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Internal id for a survey question.
    #[serde(rename = "id")]
    pub id: String,
    /// Ordinal number indicating the position of the survey question in the post transaction
/// sequence.
    #[serde(rename = "ordinal")]
    pub ordinal: i32,
    /// Determines whether or not the question will be presented post transaction.
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// The full text of the transaction.
    #[serde(rename = "questionText")]
    pub question_text: String,
    /// The type of question. Valid values are 'yes_no' and 'scaled'.
    #[serde(rename = "questionType")]
    pub question_type: String,
    /// The total number of transactions processed during the query period if results are
/// requested.
    #[serde(rename = "transactionCount", default)]
    pub transaction_count: i32,
    /// The total number of responses during the query period if results are requested.
    #[serde(rename = "responseCount", default)]
    pub response_count: i32,
    /// The response rate, expressed as a ratio, if results are requested.
    #[serde(rename = "responseRate", default)]
    pub response_rate: f64,
    /// The set of response data points.
    #[serde(rename = "responses")]
    pub responses: Option<Vec<SurveyDataPoint>>,

}

/// Models a request to retrieve or manipulate survey questions.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SurveyQuestionRequest {
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id of a single question.
    #[serde(rename = "questionId")]
    pub question_id: String,
    /// An optional timeout override.
    #[serde(rename = "timeout")]
    pub timeout: i32,

}

/// Models a survey question response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SurveyQuestionResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The full result set responsive to the original request.
    #[serde(rename = "results")]
    pub results: Option<Vec<SurveyQuestion>>,

}

/// Models a request to retrieve or manipulate survey questions.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SurveyDataPoint {
    /// A unique identifier for a specific answer type.
    #[serde(rename = "answerKey")]
    pub answer_key: String,
    /// A narrative description of the answer.
    #[serde(rename = "answerDescription")]
    pub answer_description: String,
    /// The number of responses.
    #[serde(rename = "responseCount")]
    pub response_count: i32,
    /// Response rate as a percentage of total transactions.
    #[serde(rename = "responsePercentage")]
    pub response_percentage: f64,
    /// The average transaction amount for a given answer.
    #[serde(rename = "averageTransaction")]
    pub average_transaction: f64,

}

/// Models a request to retrieve survey results.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SurveyResultsRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id of a single question.
    #[serde(rename = "questionId")]
    pub question_id: String,
    /// An optional start date for filtering response data.
    #[serde(rename = "startDate")]
    pub start_date: String,
    /// An optional end date for filtering response data.
    #[serde(rename = "endDate")]
    pub end_date: String,

}

/// Models a request to retrieve survey results.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MediaMetadata {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Id used to identify the media asset.
    #[serde(rename = "id")]
    pub id: String,
    /// The original filename assigned to the media asset.
    #[serde(rename = "originalFile")]
    pub original_file: String,
    /// The descriptive name of the media asset.
    #[serde(rename = "name")]
    pub name: String,
    /// A description of the media asset and its purpose.
    #[serde(rename = "description")]
    pub description: String,
    /// An array of tags associated with a media asset.
    #[serde(rename = "tags")]
    pub tags: Option<Vec<String>>,
    /// The url for the full resolution versio of the media file.
    #[serde(rename = "fileUrl")]
    pub file_url: String,
    /// The url for to the thumbnail of an image.
    #[serde(rename = "thumbnailUrl")]
    pub thumbnail_url: String,
    /// An identifier used to flag video files.
    #[serde(rename = "video")]
    pub video: bool,

}

/// Models information needed to process a file upload.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UploadMetadata {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Optional id used to track status and progress of an upload while in progress.
    #[serde(rename = "uploadId")]
    pub upload_id: String,
    /// The size of the file to be uploaded in bytes.
    #[serde(rename = "fileSize")]
    pub file_size: i64,
    /// The name of file to be uploaded.
    #[serde(rename = "fileName")]
    pub file_name: String,

}

/// Models the current status of a file upload.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UploadStatus {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Id used to track status and progress of an upload while in progress.
    #[serde(rename = "id")]
    pub id: String,
    /// The media id assigned to the result.
    #[serde(rename = "mediaId")]
    pub media_id: String,
    /// The size of the file to be uploaded in bytes.
    #[serde(rename = "fileSize")]
    pub file_size: i64,
    /// The amount of the file already uploaded.
    #[serde(rename = "uploadedAmount")]
    pub uploaded_amount: i64,
    /// The current status of a file upload.
    #[serde(rename = "status")]
    pub status: String,
    /// Whether or not the upload and associated file processing is complete.
    #[serde(rename = "complete")]
    pub complete: bool,
    /// Whether or not the file is processing. This normally applied to video files undergoing
/// format transcoding.
    #[serde(rename = "processing")]
    pub processing: bool,
    /// Current upload progress rounded to the nearest integer.
    #[serde(rename = "percentage")]
    pub percentage: i32,
    /// The url of a thumbnail for the file, if available.
    #[serde(rename = "thumbnailLocation")]
    pub thumbnail_location: String,

}

/// Used to request the status of a file upload.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct UploadStatusRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id used to track status and progress of an upload while in progress.
    #[serde(rename = "uploadId")]
    pub upload_id: String,

}

/// Models a request to retrieve or manipulate media assets.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MediaRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id used to track a media asset.
    #[serde(rename = "mediaId")]
    pub media_id: String,

}

/// Models a media library response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MediaLibraryResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "resultCount")]
    pub result_count: i32,
    /// Total number of pages.
    #[serde(rename = "pages")]
    pub pages: i32,
    /// Page currently selected through paging.
    #[serde(rename = "currentPage")]
    pub current_page: i32,
    /// Enumerates all media assets available in the context.
    #[serde(rename = "results")]
    pub results: Option<Vec<MediaMetadata>>,

}

/// Models a slide within a slide show.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Slide {
    /// The id for the media asset to be used for this slide. Must be an image.
    #[serde(rename = "mediaId")]
    pub media_id: String,
    /// Position of the slide within the slide show.
    #[serde(rename = "ordinal")]
    pub ordinal: i32,
    /// The fully qualified thumbnail url for the slide.
    #[serde(rename = "thumbnailUrl")]
    pub thumbnail_url: String,

}

/// Models a media library response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SlideShow {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The primary id for the slide show.
    #[serde(rename = "id")]
    pub id: String,
    /// The name of the slide show.
    #[serde(rename = "name")]
    pub name: String,
    /// Time between slides in seconds.
    #[serde(rename = "delay")]
    pub delay: i32,
    /// Enumerates all slides in the display sequence.
    #[serde(rename = "slides")]
    pub slides: Option<Vec<Slide>>,

}

/// Models a slide show response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SlideShowResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Max to be returned in a single page. Defaults to the system max of 250.
    #[serde(rename = "maxResults")]
    pub max_results: i32,
    /// Starting index for paged results. Defaults to zero.
    #[serde(rename = "startIndex")]
    pub start_index: i32,
    /// Total number of results accessible through paging.
    #[serde(rename = "resultCount")]
    pub result_count: i32,
    /// Enumerates all slide shows responsive to the original query.
    #[serde(rename = "results")]
    pub results: Option<Vec<SlideShow>>,

}

/// Models a request to retrieve or manipulate terminal slide shows.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SlideShowRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id used to track a slide show.
    #[serde(rename = "slideShowId")]
    pub slide_show_id: String,

}

/// Models a request to retrieve or manipulate terminal slide shows.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BrandingAssetRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Id used to track a branding asset.
    #[serde(rename = "assetId")]
    pub asset_id: String,

}

/// Models the priority and display settings for terminal media.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BrandingAsset {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Id used to track a branding asset.
    #[serde(rename = "id")]
    pub id: String,
    /// The id owner of the tenant who owns the branding asset.
    #[serde(rename = "ownerId")]
    pub owner_id: String,
    /// The terminal id if this branding asset is specific to a single terminal.
    #[serde(rename = "terminalId")]
    pub terminal_id: String,
    /// The terminal group id if this branding asset is specific to a terminal group.
    #[serde(rename = "terminalGroupId")]
    pub terminal_group_id: String,
    /// The merchant id associated with this branding asset.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The organization id associated with this branding asset.
    #[serde(rename = "organizationId")]
    pub organization_id: String,
    /// The partner id associated with this branding asset.
    #[serde(rename = "partnerId")]
    pub partner_id: String,
    /// The slide show associated with this branding asset, if any. A branding asset can
/// reference a slide show or media asset, but not both.
    #[serde(rename = "slideShowId")]
    pub slide_show_id: String,
    /// The media id associated with this branding asset, if any. A branding asset can
/// reference a slide show or media asset, but not both.
    #[serde(rename = "mediaId")]
    pub media_id: String,
    /// Applies standard margins to images displayed on terminals. Usually the best option
/// for logos.
    #[serde(rename = "padded")]
    pub padded: bool,
    /// The start date if this asset should be displayed based on a schedule. Format:
/// MM/DD/YYYY.
    #[serde(rename = "startDate")]
    pub start_date: String,
    /// The end date if this asset should be displayed based on a schedule. Format: MM/DD/YYYY.
    #[serde(rename = "endDate")]
    pub end_date: String,
    /// An array of days of the week during which a branding asset should be enabled. Days of the
/// week are coded as integers starting with Sunday (0) and ending with Saturday (6).
    #[serde(rename = "daysOfWeek")]
    pub days_of_week: Option<Vec<i8>>,
    /// The start date if this asset should be displayed based on a schedule. Format:
/// MM/DD/YYYY.
    #[serde(rename = "startTime")]
    pub start_time: String,
    /// The end date if this asset should be displayed based on a schedule. Format: MM/DD/YYYY.
    #[serde(rename = "endTime")]
    pub end_time: String,
    /// The ordinal number marking the position of this asset within the branding stack.
    #[serde(rename = "ordinal")]
    pub ordinal: i32,
    /// Enables the asset for display.
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// If true, the asset will be displayed in the merchant portal, but not on merchant
/// terminal hardware. Developers will usually want this to always be false.
    #[serde(rename = "preview")]
    pub preview: bool,
    /// Id of the user who created this branding asset, if applicable.
    #[serde(rename = "userId")]
    pub user_id: String,
    /// Name of the user who created this branding asset, if applicable.
    #[serde(rename = "userName")]
    pub user_name: String,
    /// The fully qualified URL of the thumbnail image for this branding asset.
    #[serde(rename = "thumbnail")]
    pub thumbnail: String,
    /// The time and date this asset was last modified.
    #[serde(rename = "lastModified")]
    pub last_modified: String,
    /// A field for notes related to a branding asset.
    #[serde(rename = "notes")]
    pub notes: String,
    /// If true, the API credentials used to retrieve the branding asset record can be used to
/// update it.
    #[serde(rename = "editable")]
    pub editable: bool,
    /// The type of branding asset.
    #[serde(rename = "assetType")]
    pub asset_type: String,
    /// The type of user or tenant that owns this asset.
    #[serde(rename = "ownerType")]
    pub owner_type: String,
    /// A recommended caption for displaying the owner. Takes into account multiple
/// organization types.
    #[serde(rename = "ownerTypeCaption")]
    pub owner_type_caption: String,
    /// The name of the tenant or entity that owns the branding asset.
    #[serde(rename = "ownerName")]
    pub owner_name: String,
    /// The recommended image to be displayed when rendering a preview of this branding asset.
    #[serde(rename = "previewImage")]
    pub preview_image: String,
    /// A compact narrative string explaining the effective date and time rules for a branding
/// asset.
    #[serde(rename = "narrativeEffectiveDates")]
    pub narrative_effective_dates: String,
    /// A compact narrative string explaining the display period for a branding asset.
    #[serde(rename = "narrativeDisplayPeriod")]
    pub narrative_display_period: String,

}

/// Models a branding asset response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BrandingAssetResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The id owner of this branding stack.
    #[serde(rename = "ownerId")]
    pub owner_id: String,
    /// The type of user or tenant that owns this branding stack.
    #[serde(rename = "ownerType")]
    pub owner_type: String,
    /// The name of the entity or tenant that owns this branding stack.
    #[serde(rename = "ownerName")]
    pub owner_name: String,
    /// The owner level currently being displayed.
    #[serde(rename = "levelName")]
    pub level_name: String,
    /// A narrative description of the current simulate time.
    #[serde(rename = "narrativeTime")]
    pub narrative_time: String,
    /// The asset currently displayed on the terminal.
    #[serde(rename = "activeAsset")]
    pub active_asset: BrandingAsset,
    /// Enumerates all branding assets in a given credential scope.
    #[serde(rename = "results")]
    pub results: Option<Vec<BrandingAsset>>,

}

/// Models a request to retrieve pricing policy information. The default policy for the
/// merchant is returned if no idea is provided.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingPolicyRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// An optional id used to retrieve a specific pricing policy.
    #[serde(rename = "id")]
    pub id: String,
    /// An optional merchant id if this request is submitted via partner credentials.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,

}

/// Models a single set of pricing values for a pricing policy.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricePoint {
    /// The string representation of a per transaction minimum.
    #[serde(rename = "buyRate")]
    pub buy_rate: String,
    /// The string representation of the current fee per transaction.
    #[serde(rename = "current")]
    pub current: String,
    /// The string representation of a per transaction gouge limit.
    #[serde(rename = "limit")]
    pub limit: String,

}

/// Models a the response to a pricing policy request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingPolicyResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The id owner of the pricing policy.
    #[serde(rename = "id")]
    pub id: String,
    /// The id of the partner associated with this pricing policy.
    #[serde(rename = "partnerId")]
    pub partner_id: String,
    /// The id of the merchant associated with this pricing policy.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// Whether or not a pricing policy is enabled.
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// The date and time when the pricing policy was created.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The description of the pricing policy.
    #[serde(rename = "description")]
    pub description: String,
    /// Type of pricing policy (flat vs interchange).
    #[serde(rename = "policyType")]
    pub policy_type: String,
    /// The percentage split of the of buy rate markup with BlockChyp.
    #[serde(rename = "partnerMarkupSplit")]
    pub partner_markup_split: String,
    /// The flat rate percentage for standard card present transactions.
    #[serde(rename = "standardFlatRate")]
    pub standard_flat_rate: PricePoint,
    /// The flat rate percentage for debit card transactions.
    #[serde(rename = "debitFlatRate")]
    pub debit_flat_rate: PricePoint,
    /// The flat rate percentage for ecommerce transactions.
    #[serde(rename = "ecommerceFlatRate")]
    pub ecommerce_flat_rate: PricePoint,
    /// The flat rate percentage for keyed/manual transactions.
    #[serde(rename = "keyedFlatRate")]
    pub keyed_flat_rate: PricePoint,
    /// The flat rate percentage for premium (high rewards) card transactions.
    #[serde(rename = "premiumFlatRate")]
    pub premium_flat_rate: PricePoint,
    /// The interchange markup percentage for standard card present transactions.
    #[serde(rename = "standardInterchangeMarkup")]
    pub standard_interchange_markup: PricePoint,
    /// The interchange markup percentage for debit card transactions.
    #[serde(rename = "debitInterchangeMarkup")]
    pub debit_interchange_markup: PricePoint,
    /// The interchange markup percentage for ecommerce transactions.
    #[serde(rename = "ecommerceInterchangeMarkup")]
    pub ecommerce_interchange_markup: PricePoint,
    /// The interchange markup percentage for keyed/manual transactions.
    #[serde(rename = "keyedInterchangeMarkup")]
    pub keyed_interchange_markup: PricePoint,
    /// The interchange markup percentage for premium (high rewards) card transactions.
    #[serde(rename = "premiumInterchangeMarkup")]
    pub premium_interchange_markup: PricePoint,
    /// The transaction fee for standard card present transactions.
    #[serde(rename = "standardTransactionFee")]
    pub standard_transaction_fee: PricePoint,
    /// The transaction fee for debit card transactions.
    #[serde(rename = "debitTransactionFee")]
    pub debit_transaction_fee: PricePoint,
    /// The transaction fee for ecommerce transactions.
    #[serde(rename = "ecommerceTransactionFee")]
    pub ecommerce_transaction_fee: PricePoint,
    /// The transaction fee for keyed/manual transactions.
    #[serde(rename = "keyedTransactionFee")]
    pub keyed_transaction_fee: PricePoint,
    /// The transaction fee for premium (high rewards) card transactions.
    #[serde(rename = "premiumTransactionFee")]
    pub premium_transaction_fee: PricePoint,
    /// The transaction fee for EBT card transactions.
    #[serde(rename = "ebtTransactionFee")]
    pub ebt_transaction_fee: PricePoint,
    /// A flat fee charged per month.
    #[serde(rename = "monthlyFee")]
    pub monthly_fee: PricePoint,
    /// A flat fee charged per year.
    #[serde(rename = "annualFee")]
    pub annual_fee: PricePoint,
    /// The fee per dispute or chargeback.
    #[serde(rename = "chargebackFee")]
    pub chargeback_fee: PricePoint,
    /// The fee per address verification operation.
    #[serde(rename = "avsFee")]
    pub avs_fee: PricePoint,
    /// The fee per batch.
    #[serde(rename = "batchFee")]
    pub batch_fee: PricePoint,
    /// The voice authorization fee.
    #[serde(rename = "voiceAuthFee")]
    pub voice_auth_fee: PricePoint,
    /// The one time account setup fee.
    #[serde(rename = "accountSetupFee")]
    pub account_setup_fee: PricePoint,

}

/// Models a request to retrieve a list of partner statements.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementListRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Optional start date filter for batch history.
    #[serde(rename = "startDate")]
    pub start_date: Option<DateTime<Utc>>,
    /// Optional end date filter for batch history.
    #[serde(rename = "endDate")]
    pub end_date: Option<DateTime<Utc>>,

}

/// Models a basic information about partner statements for use in list or search results.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementSummary {
    /// The id owner of the pricing policy.
    #[serde(rename = "id")]
    pub id: String,
    /// The date the statement was generated.
    #[serde(rename = "statementDate")]
    pub statement_date: DateTime<Utc>,
    /// Total volume in numeric format.
    #[serde(rename = "totalVolume")]
    pub total_volume: f64,
    /// The string formatted total volume on the statement.
    #[serde(rename = "totalVolumeFormatted")]
    pub total_volume_formatted: String,
    /// The total volume on the statement.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i64,
    /// The commission earned on the portfolio during the statement period.
    #[serde(rename = "partnerCommission")]
    pub partner_commission: f64,
    /// The string formatted total volume on the statement.
    #[serde(rename = "partnerCommissionFormatted")]
    pub partner_commission_formatted: String,
    /// The status of the statement.
    #[serde(rename = "status")]
    pub status: String,

}

/// Models results to a partner statement list inquiry.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementListResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The list of statements summaries.
    #[serde(rename = "statements")]
    pub statements: Option<Vec<PartnerStatementSummary>>,

}

/// Models a request to retrieve detailed partner statement information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementDetailRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Optional start date filter for batch history.
    #[serde(rename = "id")]
    pub id: String,

}

/// Models a response to retrieve detailed partner statement information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementDetailResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Optional start date filter for batch history.
    #[serde(rename = "id")]
    pub id: String,
    /// The id of the partner associated with the statement.
    #[serde(rename = "partnerId")]
    pub partner_id: String,
    /// The name of the partner associated with the statement.
    #[serde(rename = "partnerName")]
    pub partner_name: String,
    /// The date the statement was generated.
    #[serde(rename = "statementDate")]
    pub statement_date: DateTime<Utc>,
    /// Total volume in numeric format.
    #[serde(rename = "totalVolume")]
    pub total_volume: f64,
    /// The string formatted total volume on the statement.
    #[serde(rename = "totalVolumeFormatted")]
    pub total_volume_formatted: String,
    /// The total volume on the statement.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i64,
    /// The commission earned on the portfolio during the statement period.
    #[serde(rename = "partnerCommission")]
    pub partner_commission: f64,
    /// The string formatted partner commission on the statement.
    #[serde(rename = "partnerCommissionFormatted")]
    pub partner_commission_formatted: String,
    /// The partner commission earned on the portfolio during the statement period as a ratio
/// against volume.
    #[serde(rename = "partnerCommissionsOnVolume")]
    pub partner_commissions_on_volume: f64,
    /// The string formatted version of partner commissions as a percentage of volume.
    #[serde(rename = "partnerCommissionsOnVolumeFormatted")]
    pub partner_commissions_on_volume_formatted: String,
    /// The status of the statement.
    #[serde(rename = "status")]
    pub status: String,
    /// The line item detail associated with the statement.
    #[serde(rename = "lineItems")]
    pub line_items: Option<Vec<PartnerStatementLineItem>>,
    /// The list of adjustments made against the statement, if any.
    #[serde(rename = "adjustments")]
    pub adjustments: Option<Vec<PartnerStatementAdjustment>>,
    /// The list of partner disbursements made against the partner statement.
    #[serde(rename = "disbursements")]
    pub disbursements: Option<Vec<PartnerStatementDisbursement>>,

}

/// Models line item level data for a partner statement.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementLineItem {
    /// The line item id.
    #[serde(rename = "id")]
    pub id: String,
    /// The invoice id for the underlying merchant statement.
    #[serde(rename = "invoiceId")]
    pub invoice_id: String,
    /// The total fees charged to the merchant.
    #[serde(rename = "totalFees")]
    pub total_fees: f64,
    /// The total fees charge formatted as a currency string.
    #[serde(rename = "totalFeesFormatted")]
    pub total_fees_formatted: String,
    /// The total fees charged to the merchant as ratio of volume.
    #[serde(rename = "totalFeesOnVolume")]
    pub total_fees_on_volume: f64,
    /// The total fees charged to the merchant as percentage of volume.
    #[serde(rename = "totalFeesOnVolumeFormatted")]
    pub total_fees_on_volume_formatted: String,
    /// The id of the merchant.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The corporate name of the merchant.
    #[serde(rename = "merchantName")]
    pub merchant_name: String,
    /// The dba name of the merchant.
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The date the statement was generated.
    #[serde(rename = "statementDate")]
    pub statement_date: DateTime<Utc>,
    /// Volume in numeric format.
    #[serde(rename = "volume")]
    pub volume: f64,
    /// The string formatted total volume on the statement.
    #[serde(rename = "volumeFormatted")]
    pub volume_formatted: String,
    /// The total volume on the statement.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i64,
    /// The total interchange fees incurred this period.
    #[serde(rename = "interchange")]
    pub interchange: f64,
    /// The currency formatted form of interchange.
    #[serde(rename = "interchangeFormatted")]
    pub interchange_formatted: String,
    /// The total interchange as a ratio on volume incurred this period.
    #[serde(rename = "interchangeOnVolume")]
    pub interchange_on_volume: f64,
    /// The total interchange as a percentage of volume.
    #[serde(rename = "interchangeOnVolumeFormatted")]
    pub interchange_on_volume_formatted: String,
    /// The total card brand assessments fees incurred this period.
    #[serde(rename = "assessments")]
    pub assessments: f64,
    /// The currency formatted form of card brand assessments.
    #[serde(rename = "assessmentsFormatted")]
    pub assessments_formatted: String,
    /// The total card brand assessments as a ratio on volume incurred this period.
    #[serde(rename = "assessmentsOnVolume")]
    pub assessments_on_volume: f64,
    /// The total card brand assessments as a percentage of volume.
    #[serde(rename = "assessmentsOnVolumeFormatted")]
    pub assessments_on_volume_formatted: String,
    /// The commission earned on the portfolio during the statement period.
    #[serde(rename = "partnerCommission")]
    pub partner_commission: f64,
    /// The string formatted total volume on the statement.
    #[serde(rename = "partnerCommissionFormatted")]
    pub partner_commission_formatted: String,
    /// The total fees charge to the partner due to buy rates.
    #[serde(rename = "buyRate")]
    pub buy_rate: f64,
    /// The currency formatted form of partner buy rate.
    #[serde(rename = "buyRateFormatted")]
    pub buy_rate_formatted: String,
    /// Refers to card brand fees shared between BlockChyp and the partner.
    #[serde(rename = "hardCosts")]
    pub hard_costs: f64,
    /// The currency formatted form of hard costs.
    #[serde(rename = "hardCostsFormatted")]
    pub hard_costs_formatted: String,

}

/// Models details about disbursements related to partner statements.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementDisbursement {
    /// The disbursement id.
    #[serde(rename = "id")]
    pub id: String,
    /// Date and time the disbursement was processed.
    #[serde(rename = "timestamp")]
    pub timestamp: DateTime<Utc>,
    /// The type of disbursement transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The payment method used to fund the disbursement.
    #[serde(rename = "paymentType")]
    pub payment_type: String,
    /// The masked account number into which funds were deposited.
    #[serde(rename = "maskedPan")]
    pub masked_pan: String,
    /// That payment is still pending.
    #[serde(rename = "pending")]
    pub pending: bool,
    /// That payment is approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// A response description from the disbursement payment platform, in any.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The amount disbursed in floating point format.
    #[serde(rename = "amount")]
    pub amount: f64,
    /// The currency formatted form of amount.
    #[serde(rename = "amountFormatted")]
    pub amount_formatted: String,

}

/// Models partner statement adjustments.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerStatementAdjustment {
    /// The adjustment id.
    #[serde(rename = "id")]
    pub id: String,
    /// The date and time the disbursement was posted to the account.
    #[serde(rename = "timestamp")]
    pub timestamp: DateTime<Utc>,
    /// A description of the adjustment.
    #[serde(rename = "description")]
    pub description: String,
    /// The amount in floating point format.
    #[serde(rename = "amount")]
    pub amount: f64,
    /// The currency formatted form of amount.
    #[serde(rename = "amountFormatted")]
    pub amount_formatted: String,

}

/// Models a request to retrieve a list of partner statements.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantInvoiceListRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// Optional merchant id for partner scoped requests.
    #[serde(rename = "merchantId")]
    pub merchant_id: Option<String>,
    /// Optional type to filter normal invoices vs statements.
    #[serde(rename = "invoiceType")]
    pub invoice_type: Option<String>,
    /// Optional start date filter for batch history.
    #[serde(rename = "startDate")]
    pub start_date: Option<DateTime<Utc>>,
    /// Optional end date filter for batch history.
    #[serde(rename = "endDate")]
    pub end_date: Option<DateTime<Utc>>,

}

/// Models a response to an invoice list request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantInvoiceListResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The list of invoices returned by the request.
    #[serde(rename = "invoices")]
    pub invoices: Option<Vec<MerchantInvoiceSummary>>,

}

/// Models basic information about a merchant invoice for use in list or search results.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantInvoiceSummary {
    /// The id owner of the invoice.
    #[serde(rename = "id")]
    pub id: String,
    /// The date the statement was generated.
    #[serde(rename = "dateCreated")]
    pub date_created: DateTime<Utc>,
    /// The grand total.
    #[serde(rename = "grandTotal")]
    pub grand_total: f64,
    /// The string formatted grand total.
    #[serde(rename = "grandTotalFormatted")]
    pub grand_total_formatted: String,
    /// The status of the statement.
    #[serde(rename = "status")]
    pub status: String,
    /// Identifies the invoice type.
    #[serde(rename = "invoiceType")]
    pub invoice_type: String,
    /// Whether or not the invoice had been paid.
    #[serde(rename = "paid")]
    pub paid: bool,

}

/// Models a request to retrieve detailed merchant invoice information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantInvoiceDetailRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The invoice id.
    #[serde(rename = "id")]
    pub id: String,

}

/// Models detailed merchant invoice or statement information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantInvoiceDetailResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// Optional start date filter for batch history.
    #[serde(rename = "id")]
    pub id: String,
    /// The id of the merchant associated with the statement.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The corporate name of the merchant associated with the statement.
    #[serde(rename = "corporateName")]
    pub corporate_name: String,
    /// The dba name of the merchant associated with the statement.
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The date the statement was generated.
    #[serde(rename = "dateCreated")]
    pub date_created: DateTime<Utc>,
    /// The current status of the invoice.
    #[serde(rename = "status")]
    pub status: String,
    /// The type of invoice (statement or invoice).
    #[serde(rename = "invoiceType")]
    pub invoice_type: String,
    /// The type of pricing used for the invoice (typically flat rate or or interchange plus).
    #[serde(rename = "pricingType")]
    pub pricing_type: String,
    /// Whether or not the invoice has been paid.
    #[serde(rename = "paid")]
    pub paid: bool,
    /// The grand total.
    #[serde(rename = "grandTotal")]
    pub grand_total: f64,
    /// The string formatted grand total.
    #[serde(rename = "grandTotalFormatted")]
    pub grand_total_formatted: String,
    /// The subtotal before shipping and tax.
    #[serde(rename = "subtotal")]
    pub subtotal: f64,
    /// The string formatted subtotal before shipping and tax.
    #[serde(rename = "subotalFormatted")]
    pub subotal_formatted: String,
    /// The total sales tax.
    #[serde(rename = "taxTotal")]
    pub tax_total: f64,
    /// The string formatted total sales tax.
    #[serde(rename = "taxTotalFormatted")]
    pub tax_total_formatted: String,
    /// The total cost of shipping.
    #[serde(rename = "shippingCost")]
    pub shipping_cost: f64,
    /// The string formatted total cost of shipping.
    #[serde(rename = "shippingCostFormatted")]
    pub shipping_cost_formatted: String,
    /// The total unpaid balance on the invoice.
    #[serde(rename = "balanceDue")]
    pub balance_due: f64,
    /// The string formatted unpaid balance on the invoice.
    #[serde(rename = "balanceDueFormatted")]
    pub balance_due_formatted: String,
    /// The shipping or physical address associated with the invoice.
    #[serde(rename = "shippingAddress")]
    pub shipping_address: Option<Address>,
    /// The billing or mailing address associated with the invoice.
    #[serde(rename = "billingAddress")]
    pub billing_address: Option<Address>,
    /// The list of line item details associated with the invoice.
    #[serde(rename = "lineItems")]
    pub line_items: Option<Vec<InvoiceLineItem>>,
    /// The list of payments collected against the invoice.
    #[serde(rename = "payments")]
    pub payments: Option<Vec<InvoicePayment>>,
    /// The list of merchant settlements disbursed during the statement period.
    #[serde(rename = "deposits")]
    pub deposits: Option<Vec<StatementDeposit>>,

}

/// Models a single invoice or merchant statement line item.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct InvoiceLineItem {
    /// The line item id.
    #[serde(rename = "id")]
    pub id: String,
    /// The type of line item.
    #[serde(rename = "lineType")]
    pub line_type: String,
    /// The product id for standard invoices.
    #[serde(rename = "productId")]
    pub product_id: String,
    /// The quantity associated with the line item.
    #[serde(rename = "quantity")]
    pub quantity: i64,
    /// The description associated with the line item.
    #[serde(rename = "description")]
    pub description: String,
    /// An alternate explanation.
    #[serde(rename = "explanation")]
    pub explanation: String,
    /// The transaction count associated with any transaction based fees.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i64,
    /// The transaction volume associated with any fees.
    #[serde(rename = "volume")]
    pub volume: f64,
    /// The string formatted volume.
    #[serde(rename = "volumeFormatted")]
    pub volume_formatted: String,
    /// The per transaction fee.
    #[serde(rename = "perTransactionFee")]
    pub per_transaction_fee: f64,
    /// The string formatted per transaction fee.
    #[serde(rename = "perTransactionFeeFormatted")]
    pub per_transaction_fee_formatted: String,
    /// The percentage (as floating point ratio) fee assessed on volume.
    #[serde(rename = "transactionPercentage")]
    pub transaction_percentage: f64,
    /// The string formatted transaction fee percentage.
    #[serde(rename = "transactionPercentageFormatted")]
    pub transaction_percentage_formatted: String,
    /// The quantity price associated.
    #[serde(rename = "price")]
    pub price: f64,
    /// The string formatted price associated with a conventional line item.
    #[serde(rename = "priceFormatted")]
    pub price_formatted: String,
    /// The extended price .
    #[serde(rename = "priceExtended")]
    pub price_extended: f64,
    /// The string formatted extended price.
    #[serde(rename = "priceExtendedFormatted")]
    pub price_extended_formatted: String,
    /// The list of nested line items, if any.
    #[serde(rename = "lineItems")]
    pub line_items: Option<Vec<InvoiceLineItem>>,

}

/// Models information about payments against an invoice.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct InvoicePayment {
    /// The line item id.
    #[serde(rename = "id")]
    pub id: String,
    /// Timestamp the payment was authorized.
    #[serde(rename = "timestamp")]
    pub timestamp: DateTime<Utc>,
    /// The type of disbursement transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The payment method used to fund the disbursement.
    #[serde(rename = "paymentType")]
    pub payment_type: String,
    /// The auth code associated with credit card payment methods.
    #[serde(rename = "authCode")]
    pub auth_code: String,
    /// The masked account number into which funds were deposited.
    #[serde(rename = "maskedPan")]
    pub masked_pan: String,
    /// That payment is still pending.
    #[serde(rename = "pending")]
    pub pending: bool,
    /// That payment is approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// A response description from the disbursement payment platform, in any.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The amount disbursed in floating point format.
    #[serde(rename = "amount")]
    pub amount: f64,
    /// The currency formatted form of amount.
    #[serde(rename = "amountFormatted")]
    pub amount_formatted: String,

}

/// Models information about merchant deposits during a statement period.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct StatementDeposit {
    /// The line item id.
    #[serde(rename = "id")]
    pub id: String,
    /// The number of transactions in the batch for which funds were deposited.
    #[serde(rename = "transactionCount")]
    pub transaction_count: i64,
    /// The batch id associated with the deposit.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// The prepaid fees associated with the batch.
    #[serde(rename = "feesPaid")]
    pub fees_paid: f64,
    /// The currency formatted form of prepaid fees.
    #[serde(rename = "feesPaidFormatted")]
    pub fees_paid_formatted: String,
    /// The net deposit released to the merchant.
    #[serde(rename = "netDeposit")]
    pub net_deposit: f64,
    /// The currency formatted net deposit released to the merchant.
    #[serde(rename = "netDepositFormatted")]
    pub net_deposit_formatted: String,
    /// The total sales in the batch.
    #[serde(rename = "totalSales")]
    pub total_sales: f64,
    /// The currency formatted total sales in the batch.
    #[serde(rename = "totalSalesFormatted")]
    pub total_sales_formatted: String,
    /// The total refunds in the batch.
    #[serde(rename = "totalRefunds")]
    pub total_refunds: f64,
    /// The currency formatted total refunds in the batch.
    #[serde(rename = "totalRefundsFormatted")]
    pub total_refunds_formatted: String,

}

/// Models a request to retrieve detailed merchant invoice information.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerCommissionBreakdownRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The invoice or statement id.
    #[serde(rename = "statementId")]
    pub statement_id: String,

}

/// Models detailed information about how partner commissions were calculated for a
/// statement.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PartnerCommissionBreakdownResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The invoice (statement id) for which the commissions were calculated.
    #[serde(rename = "invoiceId")]
    pub invoice_id: String,
    /// The partner name.
    #[serde(rename = "partnerName")]
    pub partner_name: String,
    /// The partner statement id.
    #[serde(rename = "partnerStatementId")]
    pub partner_statement_id: String,
    /// The partner statement date.
    #[serde(rename = "partnerStatementDate")]
    pub partner_statement_date: DateTime<Utc>,
    /// The merchant id.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// The merchant's corporate name.
    #[serde(rename = "merchantCompanyName")]
    pub merchant_company_name: String,
    /// The merchant's dba name.
    #[serde(rename = "merchantDbaName")]
    pub merchant_dba_name: String,
    /// The grand total.
    #[serde(rename = "grandTotal")]
    pub grand_total: f64,
    /// The currency formatted grand total.
    #[serde(rename = "grandTotalFormatted")]
    pub grand_total_formatted: String,
    /// The total fees.
    #[serde(rename = "totalFees")]
    pub total_fees: f64,
    /// The currency formatted total fees.
    #[serde(rename = "totalFeesFormatted")]
    pub total_fees_formatted: String,
    /// The total due the partner for this merchant statement.
    #[serde(rename = "totalDue")]
    pub total_due: f64,
    /// The currency formatted total due the partner for this merchant statement.
    #[serde(rename = "totalDueFormatted")]
    pub total_due_formatted: String,
    /// The total volume during the statement period.
    #[serde(rename = "totalVolume")]
    pub total_volume: f64,
    /// The currency formatted total volume during the statement period.
    #[serde(rename = "totalVolumeFormatted")]
    pub total_volume_formatted: String,
    /// The total number of transactions processed during the statement period.
    #[serde(rename = "totalTransactions")]
    pub total_transactions: i64,
    /// The residual earned by the partner.
    #[serde(rename = "partnerResidual")]
    pub partner_residual: f64,
    /// The currency formatted residual earned by the partner.
    #[serde(rename = "partnerResidualFormatted")]
    pub partner_residual_formatted: String,
    /// The total interchange charged during the statement period.
    #[serde(rename = "interchange")]
    pub interchange: f64,
    /// The currency formatted total interchange charged during the statement period.
    #[serde(rename = "interchangeFormatted")]
    pub interchange_formatted: String,
    /// The total assessments charged during the statement period.
    #[serde(rename = "assessments")]
    pub assessments: f64,
    /// The currency formatted assessments charged during the statement period.
    #[serde(rename = "assessmentsFormatted")]
    pub assessments_formatted: String,
    /// The total of passthrough costs.
    #[serde(rename = "totalPassthrough")]
    pub total_passthrough: f64,
    /// The currency formatted total of passthrough costs.
    #[serde(rename = "totalPassthroughFormatted")]
    pub total_passthrough_formatted: String,
    /// The total of non passthrough costs.
    #[serde(rename = "totalNonPassthrough")]
    pub total_non_passthrough: f64,
    /// The currency formatted total of non passthrough costs.
    #[serde(rename = "totalNonPassthroughFormatted")]
    pub total_non_passthrough_formatted: String,
    /// The total of all card brand fees.
    #[serde(rename = "totalCardBrandFees")]
    pub total_card_brand_fees: f64,
    /// The currency formatted total of all card brand fees.
    #[serde(rename = "totalCardBrandFeesFormatted")]
    pub total_card_brand_fees_formatted: String,
    /// The total buy rate.
    #[serde(rename = "totalBuyRate")]
    pub total_buy_rate: f64,
    /// The currency formatted total buy rate.
    #[serde(rename = "totalBuyRateFormatted")]
    pub total_buy_rate_formatted: String,
    /// The total buy rate before passthrough costs.
    #[serde(rename = "buyRateBeforePassthrough")]
    pub buy_rate_before_passthrough: f64,
    /// The currency formatted total buy rate before passthrough costs.
    #[serde(rename = "buyRateBeforePassthroughFormatted")]
    pub buy_rate_before_passthrough_formatted: String,
    /// The net markup split between BlockChyp and the partner.
    #[serde(rename = "netMarkup")]
    pub net_markup: f64,
    /// The currency formatted net markup split between BlockChyp and the partner.
    #[serde(rename = "netMarkupFormatted")]
    pub net_markup_formatted: String,
    /// The partner's total share of non passthrough hard costs.
    #[serde(rename = "partnerNonPassthroughShare")]
    pub partner_non_passthrough_share: f64,
    /// The currency formatted partner's total share of non passthrough hard costs.
    #[serde(rename = "partnerNonPassthroughShareFormatted")]
    pub partner_non_passthrough_share_formatted: String,
    /// The total of chargeback fees assessed during the statement period.
    #[serde(rename = "chargebackFees")]
    pub chargeback_fees: f64,
    /// The currency formatted total of chargeback fees assessed during the statement
/// period.
    #[serde(rename = "chargebackFeesFormatted")]
    pub chargeback_fees_formatted: String,
    /// The total number of chargebacks during the period.
    #[serde(rename = "chargebackCount")]
    pub chargeback_count: i64,
    /// The partner's share of markup.
    #[serde(rename = "partnerPercentage")]
    pub partner_percentage: f64,
    /// The currency formatted partner's share of markup.
    #[serde(rename = "partnerPercentageFormatted")]
    pub partner_percentage_formatted: String,
    /// The list of line items documenting how the total buy rate was calculated.
    #[serde(rename = "buyRateLineItems")]
    pub buy_rate_line_items: Option<Vec<BuyRateLineItem>>,
    /// The list of detail lines describing how revenue was calculated and collected by the
/// sponsor bank.
    #[serde(rename = "revenueDetails")]
    pub revenue_details: Option<Vec<AggregateBillingLineItem>>,
    /// The nested list of costs levied by the card brands, grouped by card brand and type.
    #[serde(rename = "cardBrandCostDetails")]
    pub card_brand_cost_details: Option<Vec<AggregateBillingLineItem>>,

}

/// Models a request to generate merchant api credentials.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantCredentialGenerationRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The merchant id.
    #[serde(rename = "merchantId")]
    pub merchant_id: String,
    /// Protects the credentials from deletion.
    #[serde(rename = "deleteProtected")]
    pub delete_protected: bool,
    /// An optional array of role codes that will be assigned to the credentials.
    #[serde(rename = "roles")]
    pub roles: Option<Vec<String>>,
    /// Free form description of the purpose or intent behind the credentials.
    #[serde(rename = "notes")]
    pub notes: String,
    /// Type of credentials to generate, either API or TOKENIZING. Defaults to API.
    #[serde(rename = "credentialType")]
    pub credential_type: String,

}

/// Merchant api credential data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantCredentialGenerationResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The merchant api key.
    #[serde(rename = "apiKey")]
    pub api_key: String,
    /// The merchant bearer token.
    #[serde(rename = "bearerToken")]
    pub bearer_token: String,
    /// The merchant signing key.
    #[serde(rename = "signingKey")]
    pub signing_key: String,
    /// The tokenizing key.
    #[serde(rename = "tokenizingKey")]
    pub tokenizing_key: String,

}

/// Models a single buy rate calculation line item.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct BuyRateLineItem {
    /// Provides a basic description of the line item.
    #[serde(rename = "description")]
    pub description: String,
    /// The volume related to this line item.
    #[serde(rename = "volume")]
    pub volume: f64,
    /// The currency formatted volume related to this line item.
    #[serde(rename = "volumeFormatted")]
    pub volume_formatted: String,
    /// The rate on volume charged for this line item.
    #[serde(rename = "volumeRate")]
    pub volume_rate: f64,
    /// The string formatted rate on volume charged for this line item.
    #[serde(rename = "volumeRateFormatted")]
    pub volume_rate_formatted: String,
    /// The count associated with this line item.
    #[serde(rename = "count")]
    pub count: i64,
    /// The rate per item charged for this line item.
    #[serde(rename = "countRate")]
    pub count_rate: f64,
    /// The string formatted rate per item charged for this line item.
    #[serde(rename = "countRateFormatted")]
    pub count_rate_formatted: String,
    /// Provides a narrative description of the rate.
    #[serde(rename = "rateSummary")]
    pub rate_summary: String,
    /// The total amount for the line item.
    #[serde(rename = "total")]
    pub total: f64,
    /// The string formatted total for the line item.
    #[serde(rename = "totalFormatted")]
    pub total_formatted: String,

}

/// Models low level aggregated and nested data line items.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AggregateBillingLineItem {
    /// The line item identifier.
    #[serde(rename = "id")]
    pub id: String,
    /// Provides a basic description of the line item.
    #[serde(rename = "description")]
    pub description: String,
    /// That a line item has nested information.
    #[serde(rename = "expandable")]
    pub expandable: bool,
    /// The total is a negative number.
    #[serde(rename = "negative")]
    pub negative: bool,
    /// The total for the line item.
    #[serde(rename = "total")]
    pub total: f64,
    /// The currency formatted total for the line item.
    #[serde(rename = "totalFormatted")]
    pub total_formatted: String,
    /// The range of count based fees charged for the given line item.
    #[serde(rename = "perTranFeeRange")]
    pub per_tran_fee_range: Option<AggregateBillingLineItemStats>,
    /// The range of percentage based fees charged for the given line item.
    #[serde(rename = "transactionPercentageRange")]
    pub transaction_percentage_range: Option<AggregateBillingLineItemStats>,
    /// Encapsulated drill down or detail lines.
    #[serde(rename = "detailLines")]
    pub detail_lines: Option<Vec<AggregateBillingLineItem>>,

}

/// Models statistics for low level aggregation line items.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AggregateBillingLineItemStats {
    /// The min value in the set.
    #[serde(rename = "min")]
    pub min: String,
    /// The avg value in the set.
    #[serde(rename = "avg")]
    pub avg: String,
    /// The max value in the set.
    #[serde(rename = "max")]
    pub max: String,

}

/// Models an individual with 25% or more ownership interest in a company.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Owner {
    /// The first name of the owner.
    #[serde(rename = "firstName")]
    pub first_name: String,
    /// The last name of the owner.
    #[serde(rename = "lastName")]
    pub last_name: String,
    /// The job title of the owner.
    #[serde(rename = "jobTitle")]
    pub job_title: String,
    /// The tax identification number (SSN) of the owner.
    #[serde(rename = "taxIdNumber")]
    pub tax_id_number: String,
    /// The phone number of the owner.
    #[serde(rename = "phoneNumber")]
    pub phone_number: String,
    /// The date of birth of the owner in mm/dd/yyyy format.
    #[serde(rename = "dob")]
    pub dob: String,
    /// The percentage of ownership.
    #[serde(rename = "ownership")]
    pub ownership: String,
    /// The address of the owner.
    #[serde(rename = "address")]
    pub address: Address,
    /// The email address of the owner.
    #[serde(rename = "email")]
    pub email: String,
    /// A single line representation of the owner's address.
    #[serde(rename = "singleLineAddress")]
    pub single_line_address: String,
    /// The type of entity this owner represents.
    #[serde(rename = "entityType")]
    pub entity_type: String,
    /// The driver's license number of the owner.
    #[serde(rename = "dlNumber")]
    pub dl_number: String,
    /// The state that issued the owner's driver's license.
    #[serde(rename = "dlStateOrProvince")]
    pub dl_state_or_province: String,
    /// The expiration date of the owner's driver's license.
    #[serde(rename = "dlExpiration")]
    pub dl_expiration: String,

}

/// Models a bank account associated with an application.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ApplicationAccount {
    /// The name of the bank account.
    #[serde(rename = "name")]
    pub name: String,
    /// The name of the bank.
    #[serde(rename = "bank")]
    pub bank: String,
    /// The name of the account holder.
    #[serde(rename = "accountHolderName")]
    pub account_holder_name: String,
    /// The routing number of the bank.
    #[serde(rename = "routingNumber")]
    pub routing_number: String,
    /// The account number.
    #[serde(rename = "accountNumber")]
    pub account_number: String,

}

/// Models a merchant application form to add a merchant account.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct MerchantApplication {
    /// The invite code for the merchant.
    #[serde(rename = "inviteCode")]
    pub invite_code: String,
    /// The business name your customers know you by (DBA Name).
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The name of the legal entity you file your taxes under.
    #[serde(rename = "corporateName")]
    pub corporate_name: String,
    /// The business website.
    #[serde(rename = "webSite")]
    pub web_site: String,
    /// The business tax identification number (EIN).
    #[serde(rename = "taxIdNumber")]
    pub tax_id_number: String,
    /// The type of business entity.
    #[serde(rename = "entityType")]
    pub entity_type: String,
    /// The state where the business is incorporated.
    #[serde(rename = "stateOfIncorporation")]
    pub state_of_incorporation: String,
    /// The primary type of business (e.g., Retail, Service, etc.).
    #[serde(rename = "merchantType")]
    pub merchant_type: String,
    /// A short description of the products and services sold.
    #[serde(rename = "businessDescription")]
    pub business_description: String,
    /// The number of years the business has been operating.
    #[serde(rename = "yearsInBusiness")]
    pub years_in_business: String,
    /// The business telephone number.
    #[serde(rename = "businessPhoneNumber")]
    pub business_phone_number: String,
    /// The physical address of the business.
    #[serde(rename = "physicalAddress")]
    pub physical_address: Address,
    /// The mailing address of the business.
    #[serde(rename = "mailingAddress")]
    pub mailing_address: Address,
    /// The first name of the primary contact.
    #[serde(rename = "contactFirstName")]
    pub contact_first_name: String,
    /// The last name of the primary contact.
    #[serde(rename = "contactLastName")]
    pub contact_last_name: String,
    /// The phone number of the primary contact.
    #[serde(rename = "contactPhoneNumber")]
    pub contact_phone_number: String,
    /// The email address of the primary contact.
    #[serde(rename = "contactEmail")]
    pub contact_email: String,
    /// The job title of the primary contact.
    #[serde(rename = "contactTitle")]
    pub contact_title: String,
    /// The tax identification number (SSN) of the primary contact.
    #[serde(rename = "contactTaxIdNumber")]
    pub contact_tax_id_number: String,
    /// The date of birth of the primary contact.
    #[serde(rename = "contactDOB")]
    pub contact_dob: String,
    /// The driver's license number of the primary contact.
    #[serde(rename = "contactDlNumber")]
    pub contact_dl_number: String,
    /// The state that issued the primary contact's driver's license.
    #[serde(rename = "contactDlStateOrProvince")]
    pub contact_dl_state_or_province: String,
    /// The expiration date of the primary contact's driver's license.
    #[serde(rename = "contactDlExpiration")]
    pub contact_dl_expiration: String,
    /// The home address of the primary contact.
    #[serde(rename = "contactHomeAddress")]
    pub contact_home_address: Address,
    /// The role of the primary contact in the business.
    #[serde(rename = "contactRole")]
    pub contact_role: String,
    /// List of individuals with 25% or more ownership in the company.
    #[serde(rename = "owners")]
    pub owners: Option<Vec<Owner>>,
    /// The bank account information for the business.
    #[serde(rename = "manualAccount")]
    pub manual_account: ApplicationAccount,
    /// The average transaction amount.
    #[serde(rename = "averageTransaction")]
    pub average_transaction: String,
    /// The highest expected transaction amount.
    #[serde(rename = "highTransaction")]
    pub high_transaction: String,
    /// The average monthly transaction volume.
    #[serde(rename = "averageMonth")]
    pub average_month: String,
    /// The highest expected monthly transaction volume.
    #[serde(rename = "highMonth")]
    pub high_month: String,
    /// The refund policy of the business.
    #[serde(rename = "refundPolicy")]
    pub refund_policy: String,
    /// The number of days after purchase that refunds can be issued.
    #[serde(rename = "refundDays")]
    pub refund_days: String,
    /// The time zone of the business.
    #[serde(rename = "timeZone")]
    pub time_zone: String,
    /// The time when the daily batch should close.
    #[serde(rename = "batchCloseTime")]
    pub batch_close_time: String,
    /// Indicates if the business has multiple locations.
    #[serde(rename = "multipleLocations")]
    pub multiple_locations: String,
    /// The name of this specific business location.
    #[serde(rename = "locationName")]
    pub location_name: String,
    /// The store number for this location.
    #[serde(rename = "storeNumber")]
    pub store_number: String,
    /// Indicates if the business wants to accept EBT cards.
    #[serde(rename = "ebtRequested")]
    pub ebt_requested: String,
    /// The FNS number issued by the USDA for EBT processing.
    #[serde(rename = "fnsNumber")]
    pub fns_number: String,
    /// Indicates if the business plans to accept payments through a website.
    #[serde(rename = "ecommerce")]
    pub ecommerce: String,
    /// Indicates if suppliers ship products directly to customers.
    #[serde(rename = "dropShipping")]
    pub drop_shipping: bool,
    /// The percentage of transactions that will be chip or swipe.
    #[serde(rename = "cardPresentPercentage")]
    pub card_present_percentage: String,
    /// The percentage of transactions that will be phone orders.
    #[serde(rename = "phoneOrderPercentage")]
    pub phone_order_percentage: String,
    /// The percentage of transactions that will be e-commerce.
    #[serde(rename = "ecomPercentage")]
    pub ecom_percentage: String,
    /// The number of days before shipment that customers are charged.
    #[serde(rename = "billBeforeShipmentDays")]
    pub bill_before_shipment_days: String,
    /// Indicates if the business plans to process recurring payments.
    #[serde(rename = "subscriptionsSupported")]
    pub subscriptions_supported: String,
    /// The frequency of recurring payments (if applicable).
    #[serde(rename = "subscriptionFrequency")]
    pub subscription_frequency: String,
    /// The full legal name of the person signing the application.
    #[serde(rename = "signerName")]
    pub signer_name: String,

}

/// Models a merchant application submission request to add a new merchant account.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SubmitApplicationRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The invite code for the merchant.
    #[serde(rename = "inviteCode")]
    pub invite_code: String,
    /// The business name your customers know you by (DBA Name).
    #[serde(rename = "dbaName")]
    pub dba_name: String,
    /// The name of the legal entity you file your taxes under.
    #[serde(rename = "corporateName")]
    pub corporate_name: String,
    /// The business website.
    #[serde(rename = "webSite")]
    pub web_site: String,
    /// The business tax identification number (EIN).
    #[serde(rename = "taxIdNumber")]
    pub tax_id_number: String,
    /// The type of business entity.
    #[serde(rename = "entityType")]
    pub entity_type: String,
    /// The state where the business is incorporated.
    #[serde(rename = "stateOfIncorporation")]
    pub state_of_incorporation: String,
    /// The primary type of business (e.g., Retail, Service, etc.).
    #[serde(rename = "merchantType")]
    pub merchant_type: String,
    /// A short description of the products and services sold.
    #[serde(rename = "businessDescription")]
    pub business_description: String,
    /// The number of years the business has been operating.
    #[serde(rename = "yearsInBusiness")]
    pub years_in_business: String,
    /// The business telephone number.
    #[serde(rename = "businessPhoneNumber")]
    pub business_phone_number: String,
    /// The physical address of the business.
    #[serde(rename = "physicalAddress")]
    pub physical_address: Address,
    /// The mailing address of the business.
    #[serde(rename = "mailingAddress")]
    pub mailing_address: Address,
    /// The first name of the primary contact.
    #[serde(rename = "contactFirstName")]
    pub contact_first_name: String,
    /// The last name of the primary contact.
    #[serde(rename = "contactLastName")]
    pub contact_last_name: String,
    /// The phone number of the primary contact.
    #[serde(rename = "contactPhoneNumber")]
    pub contact_phone_number: String,
    /// The email address of the primary contact.
    #[serde(rename = "contactEmail")]
    pub contact_email: String,
    /// The job title of the primary contact.
    #[serde(rename = "contactTitle")]
    pub contact_title: String,
    /// The tax identification number (SSN) of the primary contact.
    #[serde(rename = "contactTaxIdNumber")]
    pub contact_tax_id_number: String,
    /// The date of birth of the primary contact.
    #[serde(rename = "contactDOB")]
    pub contact_dob: String,
    /// The driver's license number of the primary contact.
    #[serde(rename = "contactDlNumber")]
    pub contact_dl_number: String,
    /// The state that issued the primary contact's driver's license.
    #[serde(rename = "contactDlStateOrProvince")]
    pub contact_dl_state_or_province: String,
    /// The expiration date of the primary contact's driver's license.
    #[serde(rename = "contactDlExpiration")]
    pub contact_dl_expiration: String,
    /// The home address of the primary contact.
    #[serde(rename = "contactHomeAddress")]
    pub contact_home_address: Address,
    /// The role of the primary contact in the business.
    #[serde(rename = "contactRole")]
    pub contact_role: String,
    /// List of individuals with 25% or more ownership in the company.
    #[serde(rename = "owners")]
    pub owners: Option<Vec<Owner>>,
    /// The bank account information for the business.
    #[serde(rename = "manualAccount")]
    pub manual_account: ApplicationAccount,
    /// The average transaction amount.
    #[serde(rename = "averageTransaction")]
    pub average_transaction: String,
    /// The highest expected transaction amount.
    #[serde(rename = "highTransaction")]
    pub high_transaction: String,
    /// The average monthly transaction volume.
    #[serde(rename = "averageMonth")]
    pub average_month: String,
    /// The highest expected monthly transaction volume.
    #[serde(rename = "highMonth")]
    pub high_month: String,
    /// The refund policy of the business.
    #[serde(rename = "refundPolicy")]
    pub refund_policy: String,
    /// The number of days after purchase that refunds can be issued.
    #[serde(rename = "refundDays")]
    pub refund_days: String,
    /// The time zone of the business.
    #[serde(rename = "timeZone")]
    pub time_zone: String,
    /// The time when the daily batch should close.
    #[serde(rename = "batchCloseTime")]
    pub batch_close_time: String,
    /// Indicates if the business has multiple locations.
    #[serde(rename = "multipleLocations")]
    pub multiple_locations: String,
    /// The name of this specific business location.
    #[serde(rename = "locationName")]
    pub location_name: String,
    /// The store number for this location.
    #[serde(rename = "storeNumber")]
    pub store_number: String,
    /// Indicates if the business wants to accept EBT cards.
    #[serde(rename = "ebtRequested")]
    pub ebt_requested: String,
    /// The FNS number issued by the USDA for EBT processing.
    #[serde(rename = "fnsNumber")]
    pub fns_number: String,
    /// Indicates if the business plans to accept payments through a website.
    #[serde(rename = "ecommerce")]
    pub ecommerce: String,
    /// Indicates if suppliers ship products directly to customers.
    #[serde(rename = "dropShipping")]
    pub drop_shipping: bool,
    /// The percentage of transactions that will be chip or swipe.
    #[serde(rename = "cardPresentPercentage")]
    pub card_present_percentage: String,
    /// The percentage of transactions that will be phone orders.
    #[serde(rename = "phoneOrderPercentage")]
    pub phone_order_percentage: String,
    /// The percentage of transactions that will be e-commerce.
    #[serde(rename = "ecomPercentage")]
    pub ecom_percentage: String,
    /// The number of days before shipment that customers are charged.
    #[serde(rename = "billBeforeShipmentDays")]
    pub bill_before_shipment_days: String,
    /// Indicates if the business plans to process recurring payments.
    #[serde(rename = "subscriptionsSupported")]
    pub subscriptions_supported: String,
    /// The frequency of recurring payments (if applicable).
    #[serde(rename = "subscriptionFrequency")]
    pub subscription_frequency: String,
    /// The full legal name of the person signing the application.
    #[serde(rename = "signerName")]
    pub signer_name: String,

}

/// Models settings related to state checks for a merchant.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct StateCheckSettings {
    /// If state checks are enabled for the merchant.
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// The list of states that are exempt from surcharges.
    #[serde(rename = "surchargeExemptStates")]
    pub surcharge_exempt_states: Option<Vec<String>>,

}

/// Models merchant settings and configuration.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingMerchantSettings {
    /// The merchant account identifier.
    #[serde(rename = "account")]
    pub account: String,
    /// The gateway identifier.
    #[serde(rename = "gateway")]
    pub gateway: String,
    /// Whether surcharging is enabled for the merchant.
    #[serde(rename = "surchargingEnabled")]
    pub surcharging_enabled: bool,
    /// The custom surcharge percentage, if applicable.
    #[serde(rename = "customSurchargePercent")]
    pub custom_surcharge_percent: Option<f64>,
    /// If reduced rate pricing is enabled.
    #[serde(rename = "reducedRate")]
    pub reduced_rate: Option<bool>,
    /// If inverse pricing is enabled.
    #[serde(rename = "inversePricingEnabled")]
    pub inverse_pricing_enabled: Option<bool>,
    /// The credit discount rate, if applicable.
    #[serde(rename = "creditDiscountRate")]
    pub credit_discount_rate: Option<f64>,
    /// The acquiring solution identifier.
    #[serde(rename = "acquiringSolution")]
    pub acquiring_solution: String,
    /// Whether the merchant accepts debit cards.
    #[serde(rename = "acceptDebit")]
    pub accept_debit: Option<bool>,
    /// State check settings for the merchant.
    #[serde(rename = "stateCheckSettings")]
    pub state_check_settings: Option<StateCheckSettings>,

}

/// Models the attributes for a pricing request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingRequestAttributes {
    /// The card number for the pricing request.
    #[serde(rename = "cardNumber")]
    pub card_number: Option<String>,
    /// The payment token.
    #[serde(rename = "token")]
    pub token: String,
    /// The merchant identifier.
    #[serde(rename = "merchantIdentifier")]
    pub merchant_identifier: Option<String>,
    /// The transaction amount.
    #[serde(rename = "amount")]
    pub amount: f64,
    /// The country code.
    #[serde(rename = "country")]
    pub country: Option<String>,
    /// The postal code.
    #[serde(rename = "postalCode")]
    pub postal_code: Option<String>,
    /// The state or province.
    #[serde(rename = "state")]
    pub state: Option<String>,
    /// Merchant settings for the pricing request.
    #[serde(rename = "merchantSettings")]
    pub merchant_settings: Option<PricingMerchantSettings>,

}

/// Models the data wrapper for a pricing request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingRequestData {
    /// The type of the request.
    #[serde(rename = "type")]
    pub type_yo: String,
    /// The pricing request attributes.
    #[serde(rename = "attributes")]
    pub attributes: PricingRequestAttributes,

}

/// Models a pricing request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The pricing request data.
    #[serde(rename = "data")]
    pub data: PricingRequestData,

}

/// Models pricing response data for new handler for pricing api responses.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingResponseAttributes {
    /// The surcharge percentage.
    #[serde(rename = "surchargePercent")]
    pub surcharge_percent: f64,
    /// The surcharge amount.
    #[serde(rename = "surchargeAmount")]
    pub surcharge_amount: f64,
    /// If the transaction is exempt from surcharges.
    #[serde(rename = "surchargeExempt")]
    pub surcharge_exempt: bool,
    /// The type of card.
    #[serde(rename = "cardType")]
    pub card_type: String,
    /// The card token.
    #[serde(rename = "cardToken")]
    pub card_token: Option<String>,
    /// The card brand.
    #[serde(rename = "brand")]
    pub brand: String,
    /// The bank identification number.
    #[serde(rename = "bin")]
    pub bin: String,
    /// The commercial card indicator.
    #[serde(rename = "commercialIndicator")]
    pub commercial_indicator: String,
    /// The disclosure statement.
    #[serde(rename = "disclosure")]
    pub disclosure: Option<String>,
    /// The debit card category.
    #[serde(rename = "debitCategory")]
    pub debit_category: String,
    /// The country where the card was issued.
    #[serde(rename = "countryIssued")]
    pub country_issued: String,
    /// The unique identifier for the pricing response.
    #[serde(rename = "uuid")]
    pub uuid: String,

}

/// Models the data wrapper for a pricing response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingResponseData {
    /// The type of the response.
    #[serde(rename = "type")]
    pub type_yo: String,
    /// The pricing response attributes.
    #[serde(rename = "attributes")]
    pub attributes: PricingResponseAttributes,

}

/// Models an error response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ErrorType {
    /// The HTTP status code.
    #[serde(rename = "status")]
    pub status: i32,
    /// The error title.
    #[serde(rename = "title")]
    pub title: String,
    /// The detailed error message.
    #[serde(rename = "detail")]
    pub detail: String,

}

/// Models a pricing response.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PricingResponse {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,
    /// The pricing response data.
    #[serde(rename = "data")]
    pub data: PricingResponseData,

}



/// A request for customer signature data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalCaptureSignatureRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: CaptureSignatureRequest,
}

/// Information needed to test connectivity with a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalPingRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: PingRequest,
}

/// Information needed to retrieve location information for a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalLocateRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: LocateRequest,
}

/// A message to be displayed on the terminal screen.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalMessageRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: MessageRequest,
}

/// A simple yes no prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalBooleanPromptRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: BooleanPromptRequest,
}

/// A text prompt request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalTextPromptRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: TextPromptRequest,
}

/// An authorization request for a charge, preauth, or reverse transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalAuthorizationRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: AuthorizationRequest,
}

/// Retrieves card metadata.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalCardMetadataRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: CardMetadataRequest,
}

/// A request for the remaining balance on a payment type.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalBalanceRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: BalanceRequest,
}

/// A refund request.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalRefundRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: RefundRequest,
}

/// The information needed to enroll a new payment method in the token vault.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalEnrollRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: EnrollRequest,
}

/// The information needed to enroll a new payment method in the token vault.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalClearTerminalRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: ClearTerminalRequest,
}

/// The information needed to activate or recharge a gift card.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalGiftActivateRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: GiftActivateRequest,
}

/// The fields needed for custom Terms and Conditions prompts.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalTermsAndConditionsRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: TermsAndConditionsRequest,
}

/// A signature capture response for Terms and Conditions.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalTermsAndConditionsResponse {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: TermsAndConditionsResponse,
}

/// Used to start or update a transaction line item display on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalTransactionDisplayRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: TransactionDisplayRequest,
}

/// A request for the status of a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalTerminalStatusRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: TerminalStatusRequest,
}

/// Returns a list of queued transactions on a terminal.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalListQueuedTransactionsRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: ListQueuedTransactionsRequest,
}

/// Deletes one or all transactions from a terminal queue.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalDeleteQueuedTransactionRequest {
    #[serde(flatten)]
    pub api_credentials: APICredentials,
    #[serde(rename = "request")]
    pub request: DeleteQueuedTransactionRequest,
}



/// Fields which should be returned with standard requests.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct AbstractAcknowledgement {
    /// Whether or not the request succeeded.
    #[serde(rename = "success")]
    pub success: bool,
    /// The error, if an error occurred.
    #[serde(rename = "error")]
    pub error: String,
    /// A narrative description of the transaction result.
    #[serde(rename = "responseDescription")]
    pub response_description: String,

}

/// A reference to a terminal name.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TerminalReference {
    /// The name of the target payment terminal.
    #[serde(rename = "terminalName")]
    pub terminal_name: String,
    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
/// This is a diagnostic settings that can be used only for test transactions.
    #[serde(rename = "resetConnection")]
    pub reset_connection: bool,

}

/// Customer signature data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SignatureResponse {
    /// The hex encoded signature data.
    #[serde(rename = "sigFile")]
    pub sig_file: String,

}

/// A request for customer signature data.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct SignatureRequest {
    /// A location on the filesystem which a customer signature should be written to.
    #[serde(rename = "sigFile")]
    pub sig_file: String,
    /// The image format to be used for returning signatures.
    #[serde(rename = "sigFormat")]
    pub sig_format: SignatureFormat,
    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
/// not provided, the signature is returned in the terminal's max resolution.
    #[serde(rename = "sigWidth")]
    pub sig_width: i32,
    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
/// indicate whether or not a signature is required by the card in the receipt suggestions
/// response.
    #[serde(rename = "disableSignature")]
    pub disable_signature: bool,

}

/// Response fields for an approved transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct ApprovalResponse {
    /// That the transaction was approved.
    #[serde(rename = "approved")]
    pub approved: bool,
    /// The auth code from the payment network.
    #[serde(rename = "authCode")]
    pub auth_code: String,
    /// The code returned by the terminal or the card issuer to indicate the disposition of the
/// message.
    #[serde(rename = "authResponseCode")]
    pub auth_response_code: String,

}

/// Models a low level request with a timeout and test flag.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct TimeoutRequest {
    /// The request timeout in seconds.
    #[serde(rename = "timeout")]
    pub timeout: i32,
    /// Whether or not to route transaction to the test gateway.
    #[serde(rename = "test")]
    pub test: bool,

}

/// Core request fields for a transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CoreRequest {
    /// A user-assigned reference that can be used to recall or reverse transactions.
    #[serde(rename = "transactionRef")]
    pub transaction_ref: String,
    /// That the transaction reference was autogenerated and should be ignored for the
/// purposes of duplicate detection.
    #[serde(rename = "autogeneratedRef")]
    pub autogenerated_ref: bool,
    /// Defers the response to the transaction and returns immediately. Callers should
/// retrive the transaction result using the Transaction Status API.
    #[serde(rename = "async")]
    pub async_yo: bool,
    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
/// transaction result using the Transaction Status API.
    #[serde(rename = "queue")]
    pub queue: bool,
    /// Whether or not the request should block until all cards have been removed from the card
/// reader.
    #[serde(rename = "waitForRemovedCard")]
    pub wait_for_removed_card: bool,
    /// Override any in-progress transactions.
    #[serde(rename = "force")]
    pub force: bool,
    /// An identifier from an external point of sale system.
    #[serde(rename = "orderRef")]
    pub order_ref: String,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount")]
    pub destination_account: String,
    /// Can include a code used to trigger simulated conditions for the purposes of testing and
/// certification. Valid for test merchant accounts only.
    #[serde(rename = "testCase")]
    pub test_case: String,

}

/// Response details about a payment method.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentMethodResponse {
    /// The payment token, if the payment was enrolled in the vault.
    #[serde(rename = "token")]
    pub token: String,
    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
    #[serde(rename = "entryMethod")]
    pub entry_method: String,
    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
    #[serde(rename = "paymentType")]
    pub payment_type: String,
    /// Provides network level detail on how a transaction was routed, especially for debit
/// transactions.
    #[serde(rename = "network")]
    pub network: String,
    /// Identifies the card association based on bin number. Used primarily used to indicate
/// the major logo on a card, even when debit transactions are routed on a different
/// network.
    #[serde(rename = "logo")]
    pub logo: String,
    /// The masked primary account number.
    #[serde(rename = "maskedPan")]
    pub masked_pan: String,
    /// The BlockChyp public key if the user presented a BlockChyp payment card.
    #[serde(rename = "publicKey")]
    pub public_key: String,
    /// That the transaction did something that would put the system in PCI scope.
    #[serde(rename = "ScopeAlert")]
    pub scope_alert: bool,
    /// The cardholder name.
    #[serde(rename = "cardHolder")]
    pub card_holder: String,
    /// The card expiration month in MM format.
    #[serde(rename = "expMonth")]
    pub exp_month: String,
    /// The card expiration year in YY format.
    #[serde(rename = "expYear")]
    pub exp_year: String,
    /// The card postal code.
    #[serde(rename = "postalCode")]
    pub postal_code: String,
    /// The card address.
    #[serde(rename = "address")]
    pub address: String,
    /// The card country.
    #[serde(rename = "country")]
    pub country: String,
    /// Address verification results if address information was submitted.
    #[serde(rename = "avsResponse")]
    pub avs_response: AVSResponse,
    /// The CVV verification result if CVV was submitted.
    #[serde(rename = "cvvResponse")]
    pub cvv_response: String,
    /// Suggested receipt fields.
    #[serde(rename = "receiptSuggestions")]
    pub receipt_suggestions: ReceiptSuggestions,
    /// Customer data, if any. Preserved for reverse compatibility.
    #[serde(rename = "customer")]
    pub customer: Option<Customer>,
    /// Customer data, if any.
    #[serde(rename = "customers")]
    pub customers: Customer,

}

/// Response details for a cryptocurrency transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CryptocurrencyResponse {
    /// That the transaction has met the standard criteria for confirmation on the network.
/// (For example, 6 confirmations for level one bitcoin.)
    #[serde(rename = "confirmed")]
    pub confirmed: bool,
    /// The amount submitted to the blockchain.
    #[serde(rename = "cryptoAuthorizedAmount")]
    pub crypto_authorized_amount: String,
    /// The network level fee assessed for the transaction denominated in cryptocurrency.
/// This fee goes to channel operators and crypto miners, not BlockChyp.
    #[serde(rename = "cryptoNetworkFee")]
    pub crypto_network_fee: String,
    /// The three letter cryptocurrency code used for the transactions.
    #[serde(rename = "cryptocurrency")]
    pub cryptocurrency: String,
    /// Whether or not the transaction was processed on the level one or level two network.
    #[serde(rename = "cryptoNetwork")]
    pub crypto_network: String,
    /// The address on the crypto network the transaction was sent to.
    #[serde(rename = "cryptoReceiveAddress")]
    pub crypto_receive_address: String,
    /// Hash or other identifier that identifies the block on the cryptocurrency network, if
/// available or relevant.
    #[serde(rename = "cryptoBlock")]
    pub crypto_block: String,
    /// Hash or other transaction identifier that identifies the transaction on the
/// cryptocurrency network, if available or relevant.
    #[serde(rename = "cryptoTransactionId")]
    pub crypto_transaction_id: String,
    /// The payment request URI used for the transaction, if available.
    #[serde(rename = "cryptoPaymentRequest")]
    pub crypto_payment_request: String,
    /// Used for additional status information related to crypto transactions.
    #[serde(rename = "cryptoStatus")]
    pub crypto_status: String,

}

/// Response details about tender amounts.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentAmounts {
    /// Whether or not the transaction was approved for a partial amount.
    #[serde(rename = "partialAuth")]
    pub partial_auth: bool,
    /// Whether or not an alternate currency was used.
    #[serde(rename = "altCurrency")]
    pub alt_currency: bool,
    /// Whether or not a request was settled on an FSA card.
    #[serde(rename = "fsaAuth")]
    pub fsa_auth: bool,
    /// The currency code used for the transaction.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "requestedAmount")]
    pub requested_amount: String,
    /// The authorized amount. May not match the requested amount in the event of a partial
/// auth.
    #[serde(rename = "authorizedAmount")]
    pub authorized_amount: String,
    /// The remaining balance on the payment method.
    #[serde(rename = "remainingBalance")]
    pub remaining_balance: String,
    /// The tip amount.
    #[serde(rename = "tipAmount")]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount")]
    pub tax_amount: String,
    /// The cash back amount the customer requested during the transaction.
    #[serde(rename = "requestedCashBackAmount")]
    pub requested_cash_back_amount: String,
    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
/// requested, or zero.
    #[serde(rename = "authorizedCashBackAmount")]
    pub authorized_cash_back_amount: String,

}

/// Request details about a payment method.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PaymentMethod {
    /// The payment token to be used for this transaction. This should be used for recurring
/// transactions.
    #[serde(rename = "token")]
    pub token: String,
    /// Track 1 magnetic stripe data.
    #[serde(rename = "track1")]
    pub track_1: String,
    /// Track 2 magnetic stripe data.
    #[serde(rename = "track2")]
    pub track_2: String,
    /// The primary account number. We recommend using the terminal or e-commerce
/// tokenization libraries instead of passing account numbers in directly, as this would
/// put your application in PCI scope.
    #[serde(rename = "pan")]
    pub pan: String,
    /// The ACH routing number for ACH transactions.
    #[serde(rename = "routingNumber")]
    pub routing_number: String,
    /// The cardholder name. Only required if the request includes a primary account number or
/// track data.
    #[serde(rename = "cardholderName")]
    pub cardholder_name: String,
    /// The card expiration month for use with PAN based transactions.
    #[serde(rename = "expMonth")]
    pub exp_month: String,
    /// The card expiration year for use with PAN based transactions.
    #[serde(rename = "expYear")]
    pub exp_year: String,
    /// The card CVV for use with PAN based transactions.
    #[serde(rename = "cvv")]
    pub cvv: String,
    /// The cardholder address for use with address verification.
    #[serde(rename = "address")]
    pub address: String,
    /// The cardholder postal code for use with address verification.
    #[serde(rename = "postalCode")]
    pub postal_code: String,
    /// The cardholder country.
    #[serde(rename = "country")]
    pub country: String,
    /// That the payment entry method is a manual keyed transaction. If this is true, no other
/// payment method will be accepted.
    #[serde(rename = "manualEntry")]
    pub manual_entry: bool,
    /// The key serial number used for DUKPT encryption.
    #[serde(rename = "ksn")]
    pub ksn: String,
    /// The encrypted pin block.
    #[serde(rename = "pinBlock")]
    pub pin_block: String,
    /// Designates categories of cards: credit, debit, EBT.
    #[serde(rename = "cardType")]
    pub card_type: CardType,
    /// Designates brands of payment methods: Visa, Discover, etc.
    #[serde(rename = "paymentType")]
    pub payment_type: String,

}

/// Request details about tender amounts.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct RequestAmount {
    /// The transaction currency code.
    #[serde(rename = "currencyCode")]
    pub currency_code: String,
    /// The requested amount.
    #[serde(rename = "amount")]
    pub amount: String,
    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
    #[serde(rename = "taxExempt")]
    pub tax_exempt: bool,
    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
    #[serde(rename = "surcharge")]
    pub surcharge: bool,
    /// A flag that applies a discount to negate the surcharge for debit transactions or other
/// surcharge ineligible payment methods.
    #[serde(rename = "cashDiscount")]
    pub cash_discount: bool,

}

/// Request subtotals.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct Subtotals {
    /// The tip amount.
    #[serde(rename = "tipAmount")]
    pub tip_amount: String,
    /// The tax amount.
    #[serde(rename = "taxAmount")]
    pub tax_amount: String,

}

/// A reference to a previous transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct PreviousTransaction {
    /// The ID of the previous transaction being referenced.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,

}

/// Core response fields for a transaction.
#[derive(Debug, Default, Clone, Serialize, Deserialize)]
pub struct CoreResponse {
    /// The ID assigned to the transaction.
    #[serde(rename = "transactionId")]
    pub transaction_id: String,
    /// The ID assigned to the batch.
    #[serde(rename = "batchId")]
    pub batch_id: String,
    /// The transaction reference string assigned to the transaction request. If no
/// transaction ref was assiged on the request, then the gateway will randomly generate
/// one.
    #[serde(rename = "transactionRef")]
    pub transaction_ref: String,
    /// The type of transaction.
    #[serde(rename = "transactionType")]
    pub transaction_type: String,
    /// The timestamp of the transaction.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The hash of the last tick block.
    #[serde(rename = "tickBlock")]
    pub tick_block: String,
    /// That the transaction was processed on the test gateway.
    #[serde(rename = "test")]
    pub test: bool,
    /// The settlement account for merchants with split settlements.
    #[serde(rename = "destinationAccount")]
    pub destination_account: String,
    /// The ECC signature of the response. Can be used to ensure that it was signed by the
/// terminal and detect man-in-the middle attacks.
    #[serde(rename = "sig")]
    pub sig: String,

}

pub fn clear_field<T>(data: T, field: &str) -> Result<T, Box<dyn std::error::Error>>
where 
   T: Serialize + DeserializeOwned + Clone,
{
   let mut json_value = serde_json::to_value(&data)?;

   if let Value::Object(ref mut map) = json_value {
      map.remove(field);
   }

   Ok(serde_json::from_value(json_value)?)
}

pub fn to_signature_request<T: Serialize>(request: &T) -> Result<SignatureRequest, Box<dyn std::error::Error>> {
    let request_json = serde_json::to_value(request)?;
    match serde_json::from_value::<SignatureRequest>(request_json) {
        Ok(signature_request) => Ok(signature_request),
        Err(err) => Err(Box::new(err)),
    }
}

pub fn to_signature_response<T: Serialize>(response: &T) -> Result<SignatureResponse, Box<dyn std::error::Error>> {
    let response_json = serde_json::to_value(response)?;
    match serde_json::from_value::<SignatureResponse>(response_json) {
        Ok(signature_response) => Ok(signature_response),
        Err(err) => Err(Box::new(err)),
    }
}

pub fn copy_from_signature_request<T, R>(from: &T, to: &mut R) -> Result<Option<R>, Box<dyn std::error::Error>>
where
    T: Serialize,
    R: DeserializeOwned + Serialize + Clone,
{
   let from_json = serde_json::to_value(from)?;
   let to_json = serde_json::to_value(to)?;
   let mut from_map = from_json.as_object().ok_or("Failed to convert from to object")?.clone();
   let mut to_map = to_json.as_object().ok_or("Failed to convert to to object")?.clone();
   let mut ok = false;

   for (key, value) in from_map.iter_mut() {
      if let Some(to_field) = to_map.get_mut(key) {
         *to_field = value.clone();
         ok = true;
      }
   }

   if ok {
      Ok(serde_json::from_value(to_json)?)
   } else {
      Ok(None)
   }
}