bezant-api 0.3.0

Auto-generated Rust client for the IBKR Client Portal Web API
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
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
//!
//! AUTO-GENERATED CODE - DO NOT EDIT!
//!
//! IB REST API
//! Source: crates/bezant-spec/ibkr-openapi-3.1.json
//! Version: 2.29.0
//! Generated by `oas3-gen v0.25.3`
//!
//! The IB REST API reference documentation

use serde::{Deserialize, Serialize};
use validator::Validate;
pub const AUTHORIZATION: http::HeaderName = http::HeaderName::from_static("authorization");
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccessToken200Response {
    /// Indicates whether the authorizing username is paper or not.
    pub is_true: Option<bool>,
    /// Permanent OAuth access token for the consumer with respect to the authorizing username. 20 character hex value.
    pub oauth_token: Option<String>,
    /// OAuth token secret value. Base64-encoded string.
    pub oauth_token_secret: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Account200Response {
    #[default]
    FileDetails(FileDetailsResponse),
    ResponseFile(ResponseFileResponse),
}
impl Account200Response {
    pub fn file_details() -> Self {
        Self::FileDetails(FileDetailsResponse::default())
    }
    pub fn file() -> Self {
        Self::ResponseFile(ResponseFileResponse::default())
    }
}
/// Array of objects representing accounts in the structure.
pub type Account200Response2 = Vec<AccountAttributes>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct AccountAttributes {
    /// Indicates whether account has a prepaid crypto segment (Crypto Plus) with PAXOS.
    #[serde(rename = "PrepaidCrypto-P")]
    pub prepaid_crypto_p: Option<bool>,
    /// Indicates whether account has a prepaid crypto segment (Crypto Plus) with ZEROHASH.
    #[serde(rename = "PrepaidCrypto-Z")]
    pub prepaid_crypto_z: Option<bool>,
    /// User-defined alias assigned to the account for easy identification.
    #[serde(rename = "accountAlias")]
    pub account_alias: Option<String>,
    /// Indicates the identifying number for the account.
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    /// Unix epoch timestamp of account opening.
    #[serde(rename = "accountStatus")]
    pub account_status: Option<i32>,
    /// A name assigned to the account, typically the account holder name or business entity.
    #[serde(rename = "accountTitle")]
    pub account_title: Option<String>,
    /// The account's virtual account number, or otherwise its IB accountId if no VAN is set.
    #[serde(rename = "accountVan")]
    pub account_van: Option<String>,
    /// Identifies the type of client with which the account is associated, such as an individual or LLC.
    #[serde(rename = "acctCustType")]
    pub acct_cust_type: Option<String>,
    /// Indicates whether account can receive live orders (do not mix with paper trading).
    #[serde(rename = "brokerageAccess")]
    pub brokerage_access: Option<bool>,
    /// A descriptor of the nature of the account, reflecting the responsible group within IB.
    #[serde(rename = "businessType")]
    pub business_type: Option<AccountAttributesBusinessType>,
    /// Designated account category. Only used in non-standard account structures.
    pub category: Option<String>,
    /// Status of the account with respect to clearing at IB. O is open, P pending, N new, A abandoned, C closed, R rejected.
    #[serde(rename = "clearingStatus")]
    pub clearing_status: Option<AccountAttributesClearingStatus>,
    /// Indicates a Covestor account.
    pub covestor: Option<bool>,
    /// Base currency of the account.
    #[default(Some("USD".to_string()))]
    pub currency: Option<String>,
    /// Internal human-readable description of the account.
    pub desc: Option<String>,
    /// Displayed name of the account in UI. Will reflect either the accountId or accountAlias, if set.
    #[serde(rename = "displayName")]
    pub display_name: Option<String>,
    /// Indicates that the account is managed by a financial advisor.
    #[serde(rename = "faClient")]
    pub fa_client: Option<bool>,
    /// IB business entity under which the account resides.
    #[serde(rename = "ibEntity")]
    pub ib_entity: Option<AccountAttributesIbEntity>,
    /// The account's IB accountId.
    pub id: Option<String>,
    /// Indicates that trading by the client is disabled in the account.
    #[serde(rename = "noClientTrading")]
    pub no_client_trading: Option<bool>,
    /// Describes account relations in partitioned or multiplexed (segemented) account structures.
    pub parent: Option<AccountAttributesParent>,
    /// Indicates that virtual forex positions are tracked in the account.
    #[serde(rename = "trackVirtualFXPortfolio")]
    pub track_virtual_fxportfolio: Option<bool>,
    /// Internal identifier used by IB to reflect the trading permissions of the account.
    #[serde(rename = "tradingType")]
    #[default(Some("STKNOPT".to_string()))]
    pub trading_type: Option<String>,
    /// Indicates whether the account exists in production, paper, or demo environments.
    #[serde(rename = "type")]
    #[default(Some("DEMO".to_string()))]
    pub r#type: Option<String>,
}
/// A descriptor of the nature of the account, reflecting the responsible group within IB.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum AccountAttributesBusinessType {
    #[serde(rename = "IB_SALES")]
    #[default]
    IbSales,
    #[serde(rename = "IB_PROSERVE")]
    IbProserve,
}
impl core::fmt::Display for AccountAttributesBusinessType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::IbSales => write!(f, "IB_SALES"),
            Self::IbProserve => write!(f, "IB_PROSERVE"),
        }
    }
}
/// Status of the account with respect to clearing at IB. O is open, P pending, N new, A abandoned, C closed, R rejected.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum AccountAttributesClearingStatus {
    #[default]
    O,
    P,
    N,
    A,
    R,
    C,
}
impl core::fmt::Display for AccountAttributesClearingStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::O => write!(f, "O"),
            Self::P => write!(f, "P"),
            Self::N => write!(f, "N"),
            Self::A => write!(f, "A"),
            Self::R => write!(f, "R"),
            Self::C => write!(f, "C"),
        }
    }
}
/// IB business entity under which the account resides.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum AccountAttributesIbEntity {
    #[serde(rename = "IBLLC-US")]
    #[default]
    IbllcUs,
    #[serde(rename = "IB-CAN")]
    IbCan,
    #[serde(rename = "IB-UK")]
    IbUk,
    #[serde(rename = "IB-IE")]
    IbIe,
}
impl core::fmt::Display for AccountAttributesIbEntity {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::IbllcUs => write!(f, "IBLLC-US"),
            Self::IbCan => write!(f, "IB-CAN"),
            Self::IbUk => write!(f, "IB-UK"),
            Self::IbIe => write!(f, "IB-IE"),
        }
    }
}
/// Describes account relations in partitioned or multiplexed (segemented) account structures.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountAttributesParent {
    /// Account ID of the parent account in a multiplex account structure.
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    /// Indicates that the given account is a multiplex child account.
    #[serde(rename = "isMChild")]
    pub is_mchild: Option<bool>,
    /// Indicates that the given account is itself a multiplex parent account.
    #[serde(rename = "isMParent")]
    pub is_mparent: Option<bool>,
    /// Indicates that the account is a multiplex account.
    #[serde(rename = "isMultiplex")]
    pub is_multiplex: Option<bool>,
    /// Money manager client.
    pub mmc: Option<Vec<serde_json::Value>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountData {
    #[serde(rename = "accountAlias")]
    pub account_alias: Option<String>,
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "accountTitle")]
    pub account_title: Option<String>,
    #[serde(rename = "applicantType")]
    pub applicant_type: Option<String>,
    #[serde(rename = "baseCurrency")]
    pub base_currency: Option<String>,
    #[serde(rename = "businessDescription")]
    pub business_description: Option<String>,
    pub capabilities: Option<std::collections::HashMap<String, Vec<String>>>,
    pub class_action_program: Option<String>,
    #[serde(rename = "clearingStatus")]
    pub clearing_status: Option<String>,
    #[serde(rename = "clearingStatusDescription")]
    pub clearing_status_description: Option<String>,
    #[serde(rename = "countryOfCorporation")]
    pub country_of_corporation: Option<String>,
    #[serde(rename = "dateApproved")]
    pub date_approved: Option<String>,
    #[serde(rename = "dateBegun")]
    pub date_begun: Option<String>,
    #[serde(rename = "dateClosed")]
    pub date_closed: Option<String>,
    #[serde(rename = "dateDelinked")]
    pub date_delinked: Option<String>,
    #[serde(rename = "dateFunded")]
    pub date_funded: Option<String>,
    #[serde(rename = "dateLinked")]
    pub date_linked: Option<String>,
    #[serde(rename = "dateOpened")]
    pub date_opened: Option<String>,
    #[serde(rename = "dividendReinvestment")]
    pub dividend_reinvestment: Option<std::collections::HashMap<String, bool>>,
    #[serde(rename = "emailAddress")]
    pub email_address: Option<String>,
    pub equity: Option<f64>,
    #[serde(rename = "externalId")]
    pub external_id: Option<String>,
    #[serde(rename = "feeTemplate")]
    pub fee_template: Option<std::collections::HashMap<String, String>>,
    pub household: Option<String>,
    #[serde(rename = "investmentObjectives")]
    pub investment_objectives: Option<Vec<String>>,
    #[serde(rename = "limitedOptionTrading")]
    pub limited_option_trading: Option<String>,
    pub mailing: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "mainAccount")]
    pub main_account: Option<String>,
    pub margin: Option<String>,
    #[serde(rename = "masterAccountId")]
    pub master_account_id: Option<String>,
    #[serde(rename = "mifidCategory")]
    pub mifid_category: Option<String>,
    #[serde(rename = "mifirStatus")]
    pub mifir_status: Option<String>,
    #[serde(rename = "officialTitle")]
    pub official_title: Option<String>,
    #[serde(rename = "optionLevel")]
    pub option_level: Option<i32>,
    #[serde(rename = "orgType")]
    pub org_type: Option<String>,
    #[serde(rename = "primaryUser")]
    pub primary_user: Option<String>,
    #[serde(rename = "processType")]
    pub process_type: Option<String>,
    #[serde(rename = "propertyProfile")]
    pub property_profile: Option<String>,
    #[serde(rename = "registeredAddress")]
    pub registered_address: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "riskScore")]
    pub risk_score: Option<i32>,
    pub signatures: Option<Vec<String>>,
    #[serde(rename = "sourceAccountId")]
    pub source_account_id: Option<String>,
    #[serde(rename = "stateCode")]
    pub state_code: Option<String>,
    #[serde(rename = "stockYieldProgram")]
    pub stock_yield_program: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "subType")]
    pub sub_type: Option<String>,
    #[serde(rename = "taxIds")]
    pub tax_ids: Option<Vec<std::collections::HashMap<String, String>>>,
    #[serde(rename = "taxTreatyDetails")]
    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
    #[serde(rename = "tradeIntentionType")]
    pub trade_intention_type: Option<String>,
    #[serde(rename = "trustType")]
    pub trust_type: Option<String>,
    #[serde(rename = "usTaxPurposeType")]
    pub us_tax_purpose_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountDetailsResponse {
    pub account: Option<AccountData>,
    #[serde(rename = "associatedEntities")]
    pub associated_entities: Option<Vec<AssociatedEntity>>,
    #[serde(rename = "associatedPersons")]
    pub associated_persons: Option<Vec<AssociatedPerson>>,
    pub decedents: Option<Vec<std::collections::HashMap<String, String>>>,
    #[serde(rename = "entityIRABeneficiaries")]
    pub entity_irabeneficiaries: Option<Vec<EntityIRABene>>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "financialInformation")]
    pub financial_information: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "individualIRABeneficiaries")]
    pub individual_irabeneficiaries: Option<Vec<IndividualIRABene>>,
    #[serde(rename = "marketData")]
    pub market_data: Option<Vec<std::collections::HashMap<String, String>>>,
    pub restrictions: Option<Vec<RestrictionInfo>>,
    #[serde(rename = "sourcesOfWealth")]
    pub sources_of_wealth: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
    #[serde(rename = "tradeBundles")]
    pub trade_bundles: Option<Vec<String>>,
    #[serde(rename = "withHoldingStatement")]
    pub with_holding_statement: Option<std::collections::HashMap<String, String>>,
}
pub type AccountRequestBody = String;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountStatusBulkResponse {
    pub accounts: Option<Vec<AccountStatusResponse>>,
    pub limit: Option<i32>,
    pub offset: Option<i32>,
    pub total: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct AccountStatusRequest {
    #[serde(rename = "endDate")]
    pub end_date: chrono::NaiveDate,
    #[validate(range(min = 1i32, max = 1_000i32))]
    pub limit: Option<i32>,
    #[validate(range(min = 0i32))]
    pub offset: Option<i32>,
    #[serde(rename = "startDate")]
    pub start_date: chrono::NaiveDate,
    pub status: Option<RequestStatus>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountStatusResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "adminAccountId")]
    pub admin_account_id: Option<String>,
    #[serde(rename = "dateClosed")]
    pub date_closed: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "dateOpened")]
    pub date_opened: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "dateStarted")]
    pub date_started: Option<chrono::DateTime<chrono::Utc>>,
    pub description: Option<String>,
    #[serde(rename = "masterAccountId")]
    pub master_account_id: Option<String>,
    pub message: Option<String>,
    pub state: Option<String>,
    pub status: Option<String>,
}
/// Successful return contianing an array of at-a-glance account details.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountSummaryResponse {
    /// Simple Moving Average of the account.
    #[serde(rename = "SMA")]
    pub sma: Option<f64>,
    /// Describes the unique account type. For standard individual accounts, an empty string is returned.
    #[serde(rename = "accountType")]
    pub account_type: Option<String>,
    /// Accrued interest is the interest accruing on a security since the previous coupon date. If a security is sold between two payment dates, the buyer usually compensates the seller for the interest accrued, either within the price or as a separate payment.
    #[serde(rename = "accruedInterest")]
    pub accrued_interest: Option<f64>,
    /// The amount of equity you have available for trading. For both the Securities and Commodities segments, this is calculated as: Equity with Loan Value – Initial Margin.
    #[serde(rename = "availableFunds")]
    pub available_funds: Option<f64>,
    /// Returns the total account balance.
    pub balance: Option<f64>,
    /// Total buying power available for the account.
    #[serde(rename = "buyingPower")]
    pub buying_power: Option<f64>,
    /// An array containing balance information for all currencies held by the account.
    #[serde(rename = "cashBalances")]
    pub cash_balances: Option<Vec<AccountSummaryResponseCashBalance>>,
    /// The basis for determining whether you have the necessary assets to either initiate or maintain security assets.
    #[serde(rename = "equityWithLoanValue")]
    pub equity_with_loan_value: Option<f64>,
    /// The amount of cash in excess of the usual requirement in your account.
    #[serde(rename = "excessLiquidity")]
    pub excess_liquidity: Option<f64>,
    /// The available initial margin for the account.
    #[serde(rename = "initialMargin")]
    pub initial_margin: Option<f64>,
    /// The available maintenance margin for the account.
    #[serde(rename = "maintenanceMargin")]
    pub maintenance_margin: Option<f64>,
    /// The basis for determining the price of the assets in your account.
    #[serde(rename = "netLiquidationValue")]
    pub net_liquidation_value: Option<f64>,
    /// The Federal Reserve Board regulation governing the amount of credit that broker dealers may extend to clients who borrow money to buy securities on margin.
    #[serde(rename = "regTLoan")]
    pub reg_tloan: Option<f64>,
    /// The initial margin requirements calculated under US Regulation T rules for both the securities and commodities segment of your account.
    #[serde(rename = "regTMargin")]
    pub reg_tmargin: Option<f64>,
    /// Absolute value of the Long Stock Value + Short Stock Value + Long Option Value + Short Option Value + Fund Value.
    #[serde(rename = "securitiesGVP")]
    pub securities_gvp: Option<f64>,
    /// If the account is currently non-tradeable, a status message will be dispalyed.
    pub status: Option<String>,
    /// Cash recognized at the time of trade + futures P&L. This value reflects real-time currency positions, including:
    ///  *  Trades executed directly through the FX market.
    ///  *  Trades executed as a result of automatic IB conversions, which occur when you trade a product in a non-base currency.
    ///  *  Trades deliberately executed to close non-base currency positions using the FXCONV destination.
    #[serde(rename = "totalCashValue")]
    pub total_cash_value: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AccountSummaryResponseCashBalance {
    /// The total available currency held in the account.
    pub balance: Option<f64>,
    /// The currency the values represent. Base currency represented as "Total (in {BaseCurrency})"
    pub currency: Option<String>,
    /// The available settled cash that can be withdrawn from the account.
    #[serde(rename = "settledCash")]
    pub settled_cash: Option<f64>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct AcctIdRequestBody {
    /// Identifier for the unique account to retrieve information from.
    /// - Example: `Some("U1234567".to_string())`
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct AcctIdRequestBody2 {
    /// The account ID that should be set for future requests.
    /// - Example: `"U1234567".to_string()`
    #[serde(rename = "acctId")]
    #[validate(length(min = 1u64))]
    pub acct_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct AcctIdRequestBody3 {
    /// An array of strings containing each account identifier to retrieve performance details for.
    #[serde(rename = "acctIds")]
    pub acct_ids: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct AchInstruction {
    /// - Example: `"U223454".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `"DEBIT_CREDIT"`
    #[serde(rename = "achType")]
    pub ach_type: AchInstructionAchType,
    /// - Example: `"USACH"`
    #[serde(rename = "bankInstructionCode")]
    pub bank_instruction_code: AchInstructionBankInstructionCode,
    /// - Example: `"TestInstr".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 100u64))]
    pub bank_instruction_name: String,
    #[serde(rename = "clientAccountInfo")]
    #[validate(nested)]
    pub client_account_info: AchInstructionClientAccountInfo,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AchInstructionAchType {
    #[serde(rename = "DEBIT")]
    #[default]
    Debit,
    #[serde(rename = "CREDIT")]
    Credit,
    #[serde(rename = "DEBIT_CREDIT")]
    DebitCredit,
}
impl core::fmt::Display for AchInstructionAchType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Debit => write!(f, "DEBIT"),
            Self::Credit => write!(f, "CREDIT"),
            Self::DebitCredit => write!(f, "DEBIT_CREDIT"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AchInstructionBankInstructionCode {
    #[serde(rename = "CAACH")]
    #[default]
    Caach,
    #[serde(rename = "USACH")]
    Usach,
}
impl core::fmt::Display for AchInstructionBankInstructionCode {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Caach => write!(f, "CAACH"),
            Self::Usach => write!(f, "USACH"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct AchInstructionClientAccountInfo {
    /// - Example: `"101267576983".to_string()`
    #[serde(rename = "bankAccountNumber")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub bank_account_number: String,
    /// - Example: `1`
    #[serde(rename = "bankAccountTypeCode")]
    pub bank_account_type_code: AchInstructionClientAccountInfoBankAccountTypeCode,
    /// - Example: `"JPM Chase".to_string()`
    #[serde(rename = "bankName")]
    #[validate(length(min = 1u64, max = 100u64))]
    pub bank_name: String,
    /// - Example: `"202012983".to_string()`
    #[serde(rename = "bankRoutingNumber")]
    #[validate(length(min = 1u64, max = 24u64))]
    pub bank_routing_number: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AchInstructionClientAccountInfoBankAccountTypeCode {
    #[serde(rename = "0")]
    #[default]
    Value0,
    #[serde(rename = "1")]
    Value1,
    #[serde(rename = "2")]
    Value2,
}
impl core::fmt::Display for AchInstructionClientAccountInfoBankAccountTypeCode {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Value0 => write!(f, "0"),
            Self::Value1 => write!(f, "1"),
            Self::Value2 => write!(f, "2"),
        }
    }
}
/// Respond to a server prompt received via ntf websocket message.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct AckServerPromptRequest {
    pub body: NotificationRequestBody,
}
impl AckServerPromptRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<AckServerPromptResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<String>::json_with_diagnostics(req).await?;
            return Ok(AckServerPromptResponse::Ok(data));
        }
        let _ = req.bytes().await?;
        return Ok(AckServerPromptResponse::Unknown);
    }
}
/// Response types for ackServerPrompt
#[derive(Debug, Clone)]
pub enum AckServerPromptResponse {
    ///200: Status of submitted prompt
    Ok(String),
    ///default: Unknown response
    Unknown,
}
/// Activate or Deactivate existing alerts created for this account. This does not delete alerts, but disables notifications until reactivated.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ActivateAlertRequest {
    #[validate(nested)]
    pub path: ActivateAlertRequestPath,
    pub body: AlertActivationRequest,
}
impl ActivateAlertRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ActivateAlertResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlertActivationResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(ActivateAlertResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ActivateAlertResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ActivateAlertResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(ActivateAlertResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct ActivateAlertRequestPath {
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for activateAlert
#[derive(Debug, Clone)]
pub enum ActivateAlertResponse {
    ///200: An object containing details about the activated/deactivated alert.
    Ok(AlertActivationResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    ///500: Internal Server Error; unable to process incoming request due to invalid data in it
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AdvancedOrderReject {
    /// Indicates whether this prompt is dismissable.
    pub dismissable: Option<Vec<serde_json::Value>>,
    /// IB internal identifier for the nature or category of the returned message.
    #[serde(rename = "messageId")]
    pub message_id: Option<String>,
    /// Choices available to the client in response to the rejection message.
    pub options: Option<Vec<String>>,
    /// The order ID assigned by IB to the rejected order ticket.
    #[serde(rename = "orderId")]
    pub order_id: Option<i32>,
    /// Indicates that the message is a prompt offering a set of decisions, one or more of which may permit the rejected order to be resubmitted.
    pub prompt: Option<bool>,
    /// IB's internal identifier assigned to the returned message.
    #[serde(rename = "reqId")]
    pub req_id: Option<String>,
    /// Human-readable text of the messages emitted by IB in response to order submission.
    pub text: Option<String>,
    /// The specific type of message returned.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
/// An array containing all alerts as separate objects.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Alert {
    /// The account the alert was attributed to.
    pub account: Option<String>,
    /// Determines if the alert is active [1] or not [0]
    pub alert_active: Option<AlertActivationRequestAlertActive>,
    /// The requested name for the alert.
    pub alert_name: Option<String>,
    /// Confirms if the alert is enabled to occur more than once.
    pub alert_repeatable: Option<AlertActivationRequestAlertActive>,
    /// Confirms if the order is triggered or not.
    pub alert_triggered: Option<bool>,
    /// The order id (alert id)
    pub order_id: Option<i32>,
    /// UTC-formatted time of the alert's creation.
    pub order_time: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct AlertActivationRequest {
    /// Set whether or not the alert should be active (1) or inactive (0).
    #[serde(rename = "alertActive")]
    pub alert_active: AlertActivationRequestAlertActive,
    /// The alert Identifier
    #[serde(rename = "alertId")]
    pub alert_id: i32,
}
/// Determines if the alert is active [1] or not [0]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum AlertActivationRequestAlertActive {
    #[serde(rename = "1")]
    #[default]
    Value1,
    #[serde(rename = "0")]
    Value0,
}
impl core::fmt::Display for AlertActivationRequestAlertActive {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Value1 => write!(f, "1"),
            Self::Value0 => write!(f, "0"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlertActivationResponse {
    /// If "success" returns false, will list failed order Ids
    pub failure_list: Option<String>,
    /// The tracking number of the alert. Occasssionally referenced as the alertId or alert_id.
    pub order_id: Option<i32>,
    pub request_id: Option<i32>,
    /// Displays result status of alert request
    pub success: Option<bool>,
    /// Response message to clarify success status reason.
    pub text: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlertCondition {
    /// Condition logic_bind value set.
    pub condition_logic_bind: Option<bool>,
    /// Condition operator set for alert.
    pub condition_operator: Option<String>,
    /// Condition timeZone value set.
    pub condition_time_zone: Option<String>,
    /// TriggerMethod value set.
    pub condition_trigger_method: Option<i32>,
    /// The type of condition set.
    pub condition_type: Option<i32>,
    /// Condition value set.
    pub condition_value: Option<String>,
    /// Returns conid and exchange in the format "conid@exchange"
    pub conidex: Option<String>,
    /// Includes relevant descriptions (if applicable).
    pub contract_description_1: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct AlertCreationRequest {
    /// Alert message which will be sent
    #[serde(rename = "alertMessage")]
    #[validate(length(min = 1u64))]
    pub alert_message: String,
    /// Alert name.
    #[serde(rename = "alertName")]
    #[validate(length(min = 1u64))]
    pub alert_name: String,
    /// Boolean number (0, 1) signifies if an alert can be triggered more than once. A value of '1' is required for MTA alerts
    #[serde(rename = "alertRepeatable")]
    pub alert_repeatable: AlertActivationRequestAlertActive,
    /// Container for all conditions applied for an alert to trigger.
    #[validate(nested)]
    pub conditions: Vec<AlertCreationRequestCondition>,
    /// Email address you want to send email alerts to
    pub email: Option<String>,
    /// Used with a tif of "GTD" only. Signifies time when the alert should terminate if no alert is triggered.
    #[serde(rename = "expireTime")]
    pub expire_time: Option<String>,
    /// allow (0) or disallow (1) alerts to trigger alerts through the mobile app
    #[serde(rename = "iTWSOrdersOnly")]
    pub i_twsorders_only: Option<i32>,
    /// optional; used in case of modification and represent Alert Id
    #[serde(rename = "orderId")]
    pub order_id: Option<i64>,
    /// Allow (1) or disallow (0) the alert to be triggered outside of regular trading hours
    #[serde(rename = "outsideRth")]
    pub outside_rth: AlertActivationRequestAlertActive,
    /// allow (1) or disallow (0) alerts to trigger email messages
    #[serde(rename = "sendMessage")]
    pub send_message: Option<AlertActivationRequestAlertActive>,
    /// allow (1) or disallow (0) alerts to trigger TWS Pop-up messages
    #[serde(rename = "showPopup")]
    pub show_popup: Option<i32>,
    /// Time in Force duration of alert.
    pub tif: AlertCreationRequestTif,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct AlertCreationRequestCondition {
    /// Concatenation of conid and exchange. Formatted as "conid@exchange"
    /// - Example: `"265598@SMART".to_string()`
    #[validate(length(min = 1u64))]
    pub conidex: String,
    /// Describes how multiple conditions should behave together. Available logic types:
    ///   * `a` - AND
    ///   * `o` - OR
    ///   * `n` - END
    #[serde(rename = "logicBind")]
    #[default(Some(Default::default()))]
    pub logic_bind: Option<AlertCreationRequestConditionLogicBind>,
    /// Indicates whether the trigger should be above or below the given value. (one of: >=, <=, >, <, ==)
    #[validate(length(min = 1u64))]
    pub operator: String,
    /// Only needed for some MTA alert condition.
    #[serde(rename = "timeZone")]
    pub time_zone: Option<String>,
    /// Pass the string representation of zero, "0"
    #[serde(rename = "triggerMethod")]
    #[validate(length(min = 1u64))]
    pub trigger_method: String,
    /// Designate what condition type to use. Note the "MTA" types listed are only supported if iTWSOrdersOnly=1 Available condition types:
    ///   * `1` - Price
    ///   * `3` - Time
    ///   * `4` - Margin
    ///   * `5` - Trade
    ///   * `6` - Volume
    ///   * `7` - MTA Market
    ///   * `8` - MTA Postion
    ///   * `9` - MTA Account Daily PnL
    #[serde(rename = "type")]
    pub r#type: AlertCreationRequestConditionType,
    /// Trigger value based on Type.
    #[default(Some("*".to_string()))]
    pub value: Option<String>,
}
/// Describes how multiple conditions should behave together. Available logic types:
///   * `a` - AND
///   * `o` - OR
///   * `n` - END
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AlertCreationRequestConditionLogicBind {
    #[serde(rename = "a")]
    #[default]
    A,
    #[serde(rename = "o")]
    O,
    #[serde(rename = "n")]
    N,
}
impl core::fmt::Display for AlertCreationRequestConditionLogicBind {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::A => write!(f, "a"),
            Self::O => write!(f, "o"),
            Self::N => write!(f, "n"),
        }
    }
}
/// Designate what condition type to use. Note the "MTA" types listed are only supported if iTWSOrdersOnly=1 Available condition types:
///   * `1` - Price
///   * `3` - Time
///   * `4` - Margin
///   * `5` - Trade
///   * `6` - Volume
///   * `7` - MTA Market
///   * `8` - MTA Postion
///   * `9` - MTA Account Daily PnL
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AlertCreationRequestConditionType {
    #[serde(rename = "1")]
    #[default]
    Value1,
    #[serde(rename = "3")]
    Value3,
    #[serde(rename = "4")]
    Value4,
    #[serde(rename = "5")]
    Value5,
    #[serde(rename = "6")]
    Value6,
    #[serde(rename = "7")]
    Value7,
    #[serde(rename = "8")]
    Value8,
    #[serde(rename = "9")]
    Value9,
}
impl core::fmt::Display for AlertCreationRequestConditionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Value1 => write!(f, "1"),
            Self::Value3 => write!(f, "3"),
            Self::Value4 => write!(f, "4"),
            Self::Value5 => write!(f, "5"),
            Self::Value6 => write!(f, "6"),
            Self::Value7 => write!(f, "7"),
            Self::Value8 => write!(f, "8"),
            Self::Value9 => write!(f, "9"),
        }
    }
}
/// Time in Force duration of alert.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum AlertCreationRequestTif {
    #[serde(rename = "GTC")]
    #[default]
    Gtc,
    #[serde(rename = "GTD")]
    Gtd,
}
impl core::fmt::Display for AlertCreationRequestTif {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Gtc => write!(f, "GTC"),
            Self::Gtd => write!(f, "GTD"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlertCreationResponse {
    /// The tracking number of the alert. Alert identifier internally referenced as order id.
    pub order_id: Option<i32>,
    /// Not applicable
    pub order_status: Option<String>,
    /// Not applicable
    pub request_id: Option<i32>,
    /// Displays result status of alert request
    pub success: Option<bool>,
    /// Response message to clarify submission status.
    pub text: Option<String>,
    /// Returns 'null'
    pub warning_message: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlertDeletionResponse {
    /// If "success" returns false, will list failed order Ids
    pub failure_list: Option<String>,
    /// The tracking number of the alert. Occasssionally referenced as the alertId or alert_id.
    pub order_id: Option<i32>,
    /// Not applicable
    pub request_id: Option<i32>,
    /// Displays result status of alert request
    pub success: Option<bool>,
    /// Response message to clarify success status reason.
    pub text: Option<String>,
}
/// details of the specified alert
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlertDetails {
    /// Requestor's account ID
    pub account: Option<String>,
    /// Human readable name of the alert.
    #[serde(rename = "alertName")]
    pub alert_name: Option<String>,
    /// Returns if the alert is active [1] or disabled [0].
    pub alert_active: Option<AlertActivationRequestAlertActive>,
    /// Returns default type set for alerts. Configured in Client Portal.
    pub alert_default_type: Option<i32>,
    /// Returns the designated email address for sendMessage functionality.
    pub alert_email: Option<String>,
    /// Returns the body content of what your alert will report once triggered
    pub alert_message: Option<String>,
    /// Returns currency set for MTA alerts. Only valid for alert type 8 & 9.
    pub alert_mta_currency: Option<String>,
    /// Returns current MTA default values.
    pub alert_mta_defaults: Option<String>,
    /// Returns whether or not the alert will play audio
    pub alert_play_audio: Option<i32>,
    /// Returns if the alert can be sent more than once.
    pub alert_repeatable: Option<i32>,
    /// Returns whether or not the alert will send an email.
    pub alert_send_message: Option<i32>,
    /// Returns whether or not the alert will trigger TWS Pop-up messages
    pub alert_show_popup: Option<i32>,
    /// Returns whether or not the alert was triggered yet.
    pub alert_triggered: Option<i32>,
    /// Background color. Not applicable to API.
    pub bg_color: Option<String>,
    /// Returns whether or not the alert will trigger outside of regular trading hours.
    pub condition_outside_rth: Option<i32>,
    /// Returns the total number of conditions in the alert.
    pub condition_size: Option<i32>,
    /// Returns all conditions
    pub conditions: Option<Vec<AlertCondition>>,
    /// Returns the UTC formatted date used in GTD orders.
    pub expire_time: Option<String>,
    /// Foreground color. Not applicable to API.
    pub fg_color: Option<String>,
    /// Returns whether or not the alert will trigger mobile notifications.
    pub itws_orders_only: Option<i32>,
    /// Alert's tracking ID. Can be used for modifying or deleting alerts.
    pub order_id: Option<i32>,
    /// Returns if the order can be edited.
    pub order_not_editable: Option<bool>,
    /// represent order statusAlways returns "Presubmitted".
    pub order_status: Option<AlertDetailsOrderStatus>,
    /// Time in Force effective for the Alert
    pub tif: Option<String>,
    /// Returned for time-specific conditions.
    pub time_zone: Option<String>,
    /// Tracking ID for MTA alerts only. Returns 'null' for standard alerts.
    pub tool_id: Option<i32>,
}
/// represent order statusAlways returns "Presubmitted".
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum AlertDetailsOrderStatus {
    #[default]
    Presubmitted,
    Submitted,
}
impl core::fmt::Display for AlertDetailsOrderStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Presubmitted => write!(f, "Presubmitted"),
            Self::Submitted => write!(f, "Submitted"),
        }
    }
}
pub type Alerts = Vec<Alert>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlgoParam {
    /// Default parameter value. Type defined in valueClassName field
    #[serde(rename = "defaultValue")]
    pub default_value: Option<AlgoParamDefaultValue>,
    pub description: Option<String>,
    /// Positional ranking for the algo. Used for Client Portal.
    #[serde(rename = "guiRank")]
    pub gui_rank: Option<i32>,
    /// Parameter identifier for the algo.
    pub id: Option<String>,
    /// Allowed values for the parameter.
    #[serde(rename = "legalStrings")]
    pub legal_strings: Option<Vec<String>>,
    #[serde(rename = "maxValue")]
    pub max_value: Option<i32>,
    #[serde(rename = "minValue")]
    pub min_value: Option<f64>,
    /// Parameter name.
    pub name: Option<String>,
    /// States whether the parameter is required for the given algo order to place.
    pub required: Option<bool>,
    /// Returns the variable type of the parameter.
    #[serde(rename = "valueClassName")]
    pub value_class_name: Option<AlgoParamValueClassName>,
}
/// Default parameter value. Type defined in valueClassName field
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum AlgoParamDefaultValue {
    #[default]
    String(String),
    Integer(i32),
    Boolean(bool),
    Number(f64),
}
/// Returns the variable type of the parameter.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum AlgoParamValueClassName {
    #[default]
    String,
    Boolean,
    Time,
    Double,
    Integer,
}
impl core::fmt::Display for AlgoParamValueClassName {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::String => write!(f, "String"),
            Self::Boolean => write!(f, "Boolean"),
            Self::Time => write!(f, "Time"),
            Self::Double => write!(f, "Double"),
            Self::Integer => write!(f, "Integer"),
        }
    }
}
/// available algos
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlgosResponse {
    /// Contains all relevant algos for the contract.
    pub algos: Option<Vec<AlgosResponseAlgo>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AlgosResponseAlgo {
    /// Algo identifier used for requests.
    pub id: String,
    /// Common name of the algo
    pub name: String,
    pub parameters: Option<Vec<AlgoParam>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct AllocationGroup {
    /// Contains a series of objects depicting which accounts are involved and, for user-defined allocation methods, the distribution value for each sub-account.
    pub accounts: Option<Vec<AllocationGroupAccount>>,
    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
    ///   * `A` - Available Equity
    ///   * `E` - Equal
    ///   * `N` - Net Liquidation Value
    ///
    /// User-specified allocation methods:
    ///   * `C` - Cash Quantity
    ///   * `P` - Percentage
    ///   * `R` - Ratios
    ///   * `S` - Shares
    #[default(Some(Default::default()))]
    pub default_method: Option<AllocationMethod>,
    /// Name used to refer to your allocation group. This will be used while placing orders.
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AllocationGroupAccount {
    /// The total distribution value for each sub-account for user-defined allocation methods.
    pub amount: Option<f64>,
    /// The accountId of a given sub-account.
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AllocationGroups {
    /// array, which contains all allocation groups under the advisor account
    pub data: Option<Vec<AllocationGroupsDatum>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct AllocationGroupsDatum {
    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
    ///   * `A` - Available Equity
    ///   * `E` - Equal
    ///   * `N` - Net Liquidation Value
    ///
    /// User-specified allocation methods:
    ///   * `C` - Cash Quantity
    ///   * `P` - Percentage
    ///   * `R` - Ratios
    ///   * `S` - Shares
    #[default(Some(Default::default()))]
    pub allocation_method: Option<AllocationMethod>,
    /// The name set for the given allocation group.
    pub name: Option<String>,
    /// Represents the total number of sub-accounts within the group.
    pub size: Option<i32>,
}
/// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
///   * `A` - Available Equity
///   * `E` - Equal
///   * `N` - Net Liquidation Value
///
/// User-specified allocation methods:
///   * `C` - Cash Quantity
///   * `P` - Percentage
///   * `R` - Ratios
///   * `S` - Shares
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum AllocationMethod {
    #[default]
    A,
    E,
    N,
    C,
    P,
    R,
    S,
}
impl core::fmt::Display for AllocationMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::A => write!(f, "A"),
            Self::E => write!(f, "E"),
            Self::N => write!(f, "N"),
            Self::C => write!(f, "C"),
            Self::P => write!(f, "P"),
            Self::R => write!(f, "R"),
            Self::S => write!(f, "S"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AmRequestStatusResponse {
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
    pub message: Option<String>,
    #[serde(rename = "requestId")]
    pub request_id: Option<String>,
    #[serde(rename = "requestType")]
    pub request_type: Option<String>,
    pub status: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AnswerResponse {
    pub answer: Option<String>,
    #[serde(rename = "answerId")]
    pub answer_id: Option<i64>,
    #[serde(rename = "dependentAnswerId")]
    pub dependent_answer_id: Option<i64>,
    #[serde(rename = "dependentQuestionId")]
    pub dependent_question_id: Option<i64>,
    #[serde(rename = "multiAnswerDetail")]
    pub multi_answer_detail: Option<Vec<String>>,
}
/// Applies verified CSV changes. Requires both Bearer token (header) and signed JWT (body). CSV must be verified via /csv/v2/verify first. JWT validity: 1 minute.<br><br>**Scope**: `restrictions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ApplyCsvRequest {
    #[validate(nested)]
    pub header: ApplyCsvRequestHeader,
    /// Signed JWT token (format: header.payload.signature). Generate using: oauth2_cli sign -C userName={user} -C requestId={id} -C payload={csv} -C iss={user} -k {key}
    pub body: RestrictionRequestBody,
}
impl ApplyCsvRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ApplyCsvResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<CSVResponse>::json_with_diagnostics(req).await?;
            return Ok(ApplyCsvResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(ApplyCsvResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct ApplyCsvRequestHeader {
    /// OAuth 2.0 Bearer token. Format: Bearer {access_token}. Token contains accountId claim. Validity: ~50 minutes.
    /// - Example: `"Bearer eyJ0eXAiOiJhdCtKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjFkOTEx...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&ApplyCsvRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: &ApplyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<ApplyCsvRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: ApplyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for applyCSV
#[derive(Debug, Clone)]
pub enum ApplyCsvResponse {
    ///200: CSV application result
    Ok(CSVResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    ///403: Insufficient permissions or JWT validation failed
    Forbidden,
    ///500: Internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
pub type ArrayNode = serde_json::Value;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AssociatedEntity {
    #[serde(rename = "AssociatedPersons")]
    pub associated_persons: Option<Vec<AssociatedPerson>>,
    pub associations: Option<Vec<String>>,
    pub email: Option<String>,
    #[serde(rename = "entityId")]
    pub entity_id: Option<i32>,
    #[serde(rename = "externalCode")]
    pub external_code: Option<String>,
    #[serde(rename = "identityDocuments")]
    pub identity_documents: Option<Vec<std::collections::HashMap<String, String>>>,
    pub mailing: Option<std::collections::HashMap<String, String>>,
    pub name: Option<String>,
    #[serde(rename = "organizationCountry")]
    pub organization_country: Option<String>,
    pub phones: Option<std::collections::HashMap<String, String>>,
    pub residence: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "taxTreatyDetails")]
    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AssociatedPerson {
    pub associations: Option<Vec<String>>,
    pub commercial: Option<String>,
    #[serde(rename = "countryOfBirth")]
    pub country_of_birth: Option<String>,
    #[serde(rename = "countryOfCitizenship")]
    pub country_of_citizenship: Option<String>,
    #[serde(rename = "countryOfLegalResidence")]
    pub country_of_legal_residence: Option<String>,
    #[serde(rename = "dateOfBirth")]
    pub date_of_birth: Option<String>,
    pub email: Option<String>,
    #[serde(rename = "employmentDetails")]
    pub employment_details: Option<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "employmentType")]
    pub employment_type: Option<String>,
    #[serde(rename = "entityId")]
    pub entity_id: Option<i32>,
    #[serde(rename = "externalCode")]
    pub external_code: Option<String>,
    #[serde(rename = "firstName")]
    pub first_name: Option<String>,
    pub gender: Option<String>,
    #[serde(rename = "identityDocuments")]
    pub identity_documents: Option<Vec<std::collections::HashMap<String, String>>>,
    #[serde(rename = "lastLogin")]
    pub last_login: Option<String>,
    #[serde(rename = "lastName")]
    pub last_name: Option<String>,
    pub mailing: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "maritalStatus")]
    pub marital_status: Option<String>,
    #[serde(rename = "mdSubscriberStatus")]
    pub md_subscriber_status: Option<String>,
    #[serde(rename = "middleInitial")]
    pub middle_initial: Option<String>,
    #[serde(rename = "middleName")]
    pub middle_name: Option<String>,
    #[serde(rename = "motersMaidenName")]
    pub moters_maiden_name: Option<String>,
    #[serde(rename = "numberOfDependents")]
    pub number_of_dependents: Option<i32>,
    #[serde(rename = "passwordDate")]
    pub password_date: Option<String>,
    pub phones: Option<std::collections::HashMap<String, String>>,
    pub residence: Option<std::collections::HashMap<String, String>>,
    pub salutation: Option<String>,
    #[serde(rename = "securityDevice")]
    pub security_device: Option<String>,
    #[serde(rename = "stateOfLegalResidence")]
    pub state_of_legal_residence: Option<String>,
    #[serde(rename = "subscribedServices")]
    pub subscribed_services: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
    pub suffix: Option<String>,
    #[serde(rename = "taxTreatyDetails")]
    pub tax_treaty_details: Option<Vec<std::collections::HashMap<String, String>>>,
    #[serde(rename = "userStatus")]
    pub user_status: Option<String>,
    #[serde(rename = "userStatusTrading")]
    pub user_status_trading: Option<String>,
    pub username: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AsynchronousInstructionResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<InstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AsynchronousInstructionSetResponse {
    #[serde(rename = "instructionResults")]
    pub instruction_results: Option<Vec<AsynchronousInstructionSetResponseInstructionResult>>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202i32`
    pub status: i32,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AsynchronousInstructionSetResponseInstructionResult {
    #[serde(rename = "instructionResult")]
    pub instruction_result: InstructionResult,
    /// - Example: `9094.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202i32`
    pub status: i32,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Au10TixDetailResponse {
    #[serde(rename = "entityId")]
    pub entity_id: Option<i32>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "expiryDate")]
    pub expiry_date: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "externalId")]
    pub external_id: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "startDate")]
    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
    pub state: Option<String>,
    pub url: Option<String>,
}
/// Contains a combined overview of Commidity, Security and Crypto fund values.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableFundsResponse {
    /// Contains commodities specific fund values.
    #[serde(rename = "Crypto at Paxos")]
    pub crypto_at_paxos: Option<Funds>,
    /// Contains commodities specific fund values.
    pub commodities: Option<Funds>,
    /// Contains an overview of Security specific fund values.
    pub securities: Option<AvailableFundsResponseSecurities>,
    /// total values
    pub total: Option<AvailableFundsResponseTotal>,
}
/// Contains an overview of Security specific fund values.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableFundsResponseSecurities {
    /// This value reflects your available funds at the next margin change.
    #[serde(rename = "Lk Ahd Avlbl Fnds")]
    pub lk_ahd_avlbl_fnds: Option<String>,
    /// * `Securities` - Equity with loan value. Look ahead maintenance margin.
    ///  * `Commodities` - Net Liquidation value. Look ahead maintenance margin.
    #[serde(rename = "Lk Ahd Excss Lqdty")]
    pub lk_ahd_excss_lqdty: Option<String>,
    /// Displays predicted post-expiration account value.
    #[serde(rename = "Prdctd Pst-xpry Excss")]
    pub prdctd_pst_xpry_excss: Option<String>,
    #[serde(rename = "SMA")]
    pub sma: Option<String>,
    /// Describes currently avialable funds in your account for trading.
    pub current_available: Option<String>,
    /// Describes total value of the account.
    pub current_excess: Option<String>,
    /// Describes the total combined leverage.
    pub leverage: Option<String>,
    /// Describes available funds for overnight trading.
    pub overnight_available: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` - Equivalent to regular trading hours.
    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
    pub overnight_excess: Option<String>,
}
/// total values
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableFundsResponseTotal {
    /// This value reflects your available funds at the next margin change.
    #[serde(rename = "Lk Ahd Avlbl Fnds")]
    pub lk_ahd_avlbl_fnds: Option<String>,
    /// * `Securities` - Equity with loan value. Look ahead maintenance margin.
    ///  * `Commodities` - Net Liquidation value. Look ahead maintenance margin.
    #[serde(rename = "Lk Ahd Excss Lqdty")]
    pub lk_ahd_excss_lqdty: Option<String>,
    /// Describes when the next 'Look Ahead' calculation will take place.
    #[serde(rename = "Lk Ahd Nxt Chng")]
    pub lk_ahd_nxt_chng: Option<String>,
    /// Displays predicted post-expiration account value.
    #[serde(rename = "Prdctd Pst-xpry Excss")]
    pub prdctd_pst_xpry_excss: Option<String>,
    /// Describes the total buying power of the account including existing balance with margin.
    pub buying_power: Option<String>,
    /// Describes currently avialable funds in your account for trading.
    pub current_available: Option<String>,
    /// Describes total value of the account.
    pub current_excess: Option<String>,
    /// Describes the number of trades remaining before flagging the Pattern Day Trader status. "Unlimited" is used for existing Pattern Day Traders.
    pub day_trades_left: Option<String>,
    /// Describes the total combined leverage.
    pub leverage: Option<String>,
    /// Describes available funds for overnight trading.
    pub overnight_available: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` - Equivalent to regular trading hours.
    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
    pub overnight_excess: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableStatementDatesData {
    /// - Example: `Some("String".to_string())`
    #[serde(rename = "dataType")]
    pub data_type: Option<String>,
    pub value: Option<AvailableStatementDatesDataValue>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableStatementDatesDataValue {
    /// annual available reports
    pub annual: Option<Vec<String>>,
    pub daily: Option<AvailableStatementDatesDataValueDaily>,
    /// monthly available reports
    pub monthly: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableStatementDatesDataValueDaily {
    /// daily report end date
    #[serde(rename = "endDate")]
    pub end_date: Option<String>,
    /// daily report start date
    #[serde(rename = "startDate")]
    pub start_date: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableTaxFormsData {
    /// - Example: `Some("String".to_string())`
    #[serde(rename = "dataType")]
    pub data_type: Option<String>,
    pub value: Option<AvailableTaxFormsDataValue>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct AvailableTaxFormsDataValue {
    /// available tax forms
    pub forms: Option<Vec<TaxFormType>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BNResponse {
    /// Returns the number of unread notifications.
    #[serde(rename = "BN")]
    pub bn: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum BankInstructionMethod {
    #[serde(rename = "ACH")]
    #[default]
    Ach,
    #[serde(rename = "WIRE")]
    Wire,
    #[serde(rename = "USACH")]
    Usach,
    #[serde(rename = "CAACH")]
    Caach,
    #[serde(rename = "SEPA")]
    Sepa,
    #[serde(rename = "eDDA")]
    EDDA,
    #[serde(rename = "eGIRO")]
    EGIRO,
    #[serde(rename = "OPEN_BANKING")]
    OpenBanking,
}
impl core::fmt::Display for BankInstructionMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Ach => write!(f, "ACH"),
            Self::Wire => write!(f, "WIRE"),
            Self::Usach => write!(f, "USACH"),
            Self::Caach => write!(f, "CAACH"),
            Self::Sepa => write!(f, "SEPA"),
            Self::EDDA => write!(f, "eDDA"),
            Self::EGIRO => write!(f, "eGIRO"),
            Self::OpenBanking => write!(f, "OPEN_BANKING"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct BankInstructionsBulkRequestBody {
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionRequestBodyInstructionType,
    pub instructions: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BondFiltersResponse {
    /// Contains all filters pertaining to the given issuerId
    #[serde(rename = "bondFilters")]
    pub bond_filters: Option<Vec<BondFiltersResponseFilter>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BondFiltersResponseFilter {
    /// Used for user interfaces. Internal use only.
    #[serde(rename = "columnId")]
    pub column_id: Option<i32>,
    /// An identifier used to document returned options/values. This can be thought of as a key value.
    #[serde(rename = "displayText")]
    pub display_text: Option<BondFiltersResponseFilterDisplayText>,
    /// Contains all objects with values corresponding to the parent displayText key.
    pub options: Option<Vec<BondFiltersResponseFilterOption>>,
}
/// An identifier used to document returned options/values. This can be thought of as a key value.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum BondFiltersResponseFilterDisplayText {
    #[serde(rename = "Maturity Date")]
    #[default]
    MaturityDate,
    #[serde(rename = "Issue Date")]
    IssueDate,
    Coupon,
    Currency,
}
impl core::fmt::Display for BondFiltersResponseFilterDisplayText {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::MaturityDate => write!(f, "Maturity Date"),
            Self::IssueDate => write!(f, "Issue Date"),
            Self::Coupon => write!(f, "Coupon"),
            Self::Currency => write!(f, "Currency"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BondFiltersResponseFilterOption {
    /// In some instances, a text value will be returned, which indicates the standardized value format such as plaintext dates, rather than solely numerical values.
    pub text: Option<String>,
    /// Returns value directly correlating to the displayText key. This may include exchange, maturity date, issue date, coupon, or currency.
    pub value: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct BrokerageSessionInitRequest {
    /// Determines if other brokerage sessions should be disconnected to prioritize this connection.
    pub compete: Option<bool>,
    /// publish brokerage session token at the same time when brokerage session initialized. If set false, then session token should be published before calling init. Setting true is preferred way.
    pub publish: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BrokerageSessionStatus {
    /// Device MAC information.
    #[serde(rename = "MAC")]
    pub mac: Option<String>,
    /// Returns whether your brokerage session is authenticated or not.
    pub authenticated: Option<bool>,
    /// Returns whether you have a competing brokerage session in another connection.
    pub competing: Option<bool>,
    /// Returns whether you are connected to the gateway or not.
    pub connected: Option<bool>,
    /// Returns whether your brokerage session is fully established and ready to handle requests. Set to true when the login message is received from underlying brokerage infrastructure, indicating authentication is complete and account information is loaded.
    pub established: Option<bool>,
    /// Returns the reason for failing to retrieve authentication status.
    pub fail: Option<String>,
    /// Client Portal use only.
    pub hardware_info: Option<String>,
    /// A message about your authenticate status if any.
    pub message: Option<String>,
    #[serde(rename = "serverInfo")]
    pub server_info: Option<BrokerageSessionStatusServerInfo>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BrokerageSessionStatusServerInfo {
    /// IBKR server information. Internal use only.
    #[serde(rename = "serverName")]
    pub server_name: Option<String>,
    /// IBKR version information. Internal use only.
    #[serde(rename = "serverVersion")]
    pub server_version: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct BulkMultiStatusResponse {
    #[serde(rename = "instructionResults")]
    pub instruction_results: Option<Vec<serde_json::Value>>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `207i32`
    pub status: i32,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CSVResponse {
    /// Result message: 'OK' or error description
    /// - Example: `"OK".to_string()`
    pub message: String,
    /// Request ID echo
    /// - Example: `127i32`
    #[serde(rename = "requestId")]
    pub request_id: i32,
    /// Operation success status
    pub success: bool,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct CancelBulkRequestBody {
    #[serde(rename = "instructionType")]
    #[default("CANCEL_INSTRUCTION".to_string())]
    pub instruction_type: String,
    pub instructions: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct CancelInstruction {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `43085477.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"Testing".to_string()`
    #[validate(length(min = 1u64, max = 256u64))]
    pub reason: String,
}
/// Cancel an existing, unfilled order.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CancelOpenOrderRequest {
    #[validate(nested)]
    pub path: CancelOpenOrderRequestPath,
    pub query: CancelOpenOrderRequestQuery,
}
impl CancelOpenOrderRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CancelOpenOrderResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Order200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(CancelOpenOrderResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(CancelOpenOrderResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CancelOpenOrderResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CancelOpenOrderResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CancelOpenOrderResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CancelOpenOrderResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct CancelOpenOrderRequestPath {
    /// The account to which the order will clear.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// The IB-assigned order ID of the desired order ticket.
    /// - Example: `"1799796559".to_string()`
    #[validate(length(min = 1u64))]
    pub order_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct CancelOpenOrderRequestQuery {
    /// ExtOperator is used to identify external operator.
    #[serde(rename = "extOperator")]
    pub ext_operator: Option<String>,
    /// For all orders for US Futures products, clients must submit this flag to indicate whether the order was originated manually (by a natural person) or automatically (by an automated trading system transmitting orders without human intervention). Submit a True value to indicate a manually originated order, and submit a False value to indicate an automated order. Orders for USFUT products that do not include this field will be rejected.
    #[serde(rename = "manualIndicator")]
    pub manual_indicator: Option<bool>,
    /// Time of manual cancel.
    /// - Example: `Some(1_799_796_559i32)`
    #[serde(rename = "manualCancelTime")]
    pub manual_cancel_time: Option<i32>,
}
/// Response types for cancelOpenOrder
#[derive(Debug, Clone)]
pub enum CancelOpenOrderResponse {
    ///200: Status of submission
    Ok(Order200Response2),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct CancelRequestBody {
    #[validate(nested)]
    pub instruction: CancelInstruction,
    #[serde(rename = "instructionType")]
    #[default("CANCEL_INSTRUCTION".to_string())]
    pub instruction_type: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CategoryTreeResponse {
    /// A JSON object containing all category IDs and their relevant information.
    pub categories: Option<CategoryTreeResponseCategories>,
}
/// A JSON object containing all category IDs and their relevant information.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CategoryTreeResponseCategories {
    /// Category identifier.
    #[serde(rename = "categoryId")]
    pub category_id: Option<CategoryTreeResponseCategoriesCategoryId>,
}
/// Category identifier.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CategoryTreeResponseCategoriesCategoryId {
    /// List of affiliated markets (if applicable).
    pub markets: Option<Vec<serde_json::Value>>,
    /// Category name.
    pub name: Option<String>,
    /// Identifier of parent category (if applicable).
    pub parent_id: Option<String>,
}
/// Instruct IServer to close all of its open backend data streams for all instruments.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CloseAllMdStreamsRequest {}
impl CloseAllMdStreamsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<CloseAllMdStreamsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<UnsubscribedResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(CloseAllMdStreamsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CloseAllMdStreamsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CloseAllMdStreamsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CloseAllMdStreamsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CloseAllMdStreamsResponse::Unknown);
    }
}
/// Response types for closeAllMdStreams
#[derive(Debug, Clone)]
pub enum CloseAllMdStreamsResponse {
    ///200: Indicates a successful request to unsubscribe all streams.
    Ok(UnsubscribedResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Instruct IServer to close its backend stream for the instrument when real-time snapshots are no longer needed.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CloseMdStreamRequest {
    pub body: ConidRequestBody,
}
impl CloseMdStreamRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CloseMdStreamResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SuccessResponse3>::json_with_diagnostics(req)
                    .await?;
            return Ok(CloseMdStreamResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(CloseMdStreamResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CloseMdStreamResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CloseMdStreamResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CloseMdStreamResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CloseMdStreamResponse::Unknown);
    }
}
/// Response types for closeMdStream
#[derive(Debug, Clone)]
pub enum CloseMdStreamResponse {
    ///200: Acknowledges a successful request
    Ok(SuccessResponse3),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Array of objects each containing a single combo position.
pub type ComboPositionResponse = Vec<ComboPositionResponseComboPositionResponse>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ComboPositionResponseComboPositionResponse {
    /// The ratio and conids included in the position.
    pub description: Option<String>,
    /// List of the legs that make up a position.
    pub legs: Option<Vec<ComboPositionResponseComboPositionResponseLeg>>,
    /// Internal identifier of a combination position.
    pub name: Option<String>,
    /// List of the positions that make up a combination.
    pub positions: Option<Vec<IndividualComboPosition>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ComboPositionResponseComboPositionResponseLeg {
    /// Contract identifier of the given leg.
    pub conid: Option<String>,
    /// Ratio of the leg compared to the quantity.
    pub ratio: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct ComplexAssetTransferInstruction {
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `Some("7NXXXX0".to_string())`
    #[serde(rename = "accountIdAtCurrentBroker")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub account_id_at_current_broker: Option<String>,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    #[serde(rename = "contraBrokerInfo")]
    #[validate(nested)]
    pub contra_broker_info: ContraBrokerInfo,
    /// - Example: `"IN"`
    pub direction: InstructionDirection,
    #[serde(rename = "nonDisclosedDetail")]
    #[validate(nested)]
    pub non_disclosed_detail: Option<NonDisclosedDetail>,
    /// - Example: `1000.0`
    pub quantity: f64,
    #[serde(rename = "tradingInstrument")]
    pub trading_instrument: TradingInstrument,
}
/// Confirm an order reply message and continue with submission of order ticket.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ConfirmOrderReplyRequest {
    #[validate(nested)]
    pub path: ConfirmOrderReplyRequestPath,
    pub body: ConfirmedRequestBody,
}
impl ConfirmOrderReplyRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ConfirmOrderReplyResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Reply200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(ConfirmOrderReplyResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ConfirmOrderReplyResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ConfirmOrderReplyResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ConfirmOrderReplyResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ConfirmOrderReplyResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct ConfirmOrderReplyRequestPath {
    /// The UUID of the reply message to be confirmed, obtained from an order submission response. This is delivered from the POST /iserver/account/{accountId}/orders endpoint when triggering certain warning messages.
    /// - Example: `"99097238-9824-4830-84ef-46979aa22593".to_string()`
    #[validate(length(min = 1u64))]
    pub reply_id: String,
}
/// Response types for confirmOrderReply
#[derive(Debug, Clone)]
pub enum ConfirmOrderReplyResponse {
    ///200: Status of reply
    Ok(Reply200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ConfirmedRequestBody {
    /// Value of true answers the question in the affirmative and proceeds with order submission.
    pub confirmed: Option<bool>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ConidRequestBody {
    /// The IB contract ID of the instrument whose market data feed is to be unsubscribed.
    /// - Example: `Some(265_598i32)`
    pub conid: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct ContraBrokerInfo {
    /// - Example: `Some("Equatex U.S. Inc. For the Benefit of the Plan Participants of UBS AG".to_string())`
    #[serde(rename = "accountTitle")]
    #[validate(length(min = 1u64, max = 128u64))]
    pub account_title: Option<String>,
    /// - Example: `"ORG".to_string()`
    #[serde(rename = "accountType")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_type: String,
    /// - Example: `"as3456567678578N".to_string()`
    #[serde(rename = "brokerAccountId")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub broker_account_id: String,
    /// - Example: `"JP MORGAN".to_string()`
    #[serde(rename = "brokerName")]
    #[validate(length(min = 1u64, max = 128u64))]
    pub broker_name: String,
    /// - Example: `"a@gmail.com".to_string()`
    #[serde(rename = "contactEmail")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub contact_email: String,
    /// - Example: `Some("as".to_string())`
    #[serde(rename = "contactName")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub contact_name: Option<String>,
    /// - Example: `"2039126155".to_string()`
    #[serde(rename = "contactPhone")]
    #[validate(length(min = 1u64, max = 16u64))]
    pub contact_phone: String,
    /// - Example: `"United States".to_string()`
    #[validate(length(min = 1u64, max = 64u64))]
    pub country: String,
    /// - Example: `"1234".to_string()`
    #[serde(rename = "depositoryId")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub depository_id: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractInfo {
    /// Allowed to sell shares you own.
    pub allow_sell_long: Option<bool>,
    /// Indicates the industry category of the instrument.
    pub category: Option<String>,
    /// Classification of Financial Instrument codes
    pub cfi_code: Option<String>,
    pub classifier: Option<String>,
    /// Indicates the name of the company or index.
    pub company_name: Option<String>,
    /// Indicates the contract identifier of the given contract.
    pub con_id: Option<i32>,
    pub contract_clarification_type: Option<String>,
    /// Indicates the year and month the contract expires.
    pub contract_month: Option<String>,
    /// Base currency contract is traded in.
    pub currency: Option<String>,
    /// Returns the CUSIP for the given instrument. Only used in BOND trading.
    pub cusip: Option<String>,
    /// Indicates the primary exchange for which the contract can be traded.
    pub exchange: Option<String>,
    /// Returns the expiration month of the contract.
    pub expiry_full: Option<String>,
    /// Specific group of companies or businesses.
    pub industry: Option<String>,
    /// Asset class of the instrument.
    pub instrument_type: Option<String>,
    /// Indicates if the contract supports zero commission trading.
    pub is_zero_commission_security: Option<bool>,
    /// Contract's symbol from primary exchange. For options it is the OCC symbol.
    pub local_symbol: Option<String>,
    /// Indicates the final maturity date of the given contract.
    pub maturity_date: Option<String>,
    /// Indicates the multiplier of the contract.
    pub multiplier: Option<String>,
    /// Indicates if the contract can be traded outside regular trading hours or not.
    pub r_t_h: Option<bool>,
    /// Indicates if the contract can be smart routed or not.
    pub smart_available: Option<bool>,
    /// Underlying symbol
    pub symbol: Option<String>,
    /// Indicates the display name of the contract, as shown with Client Portal.
    pub text: Option<String>,
    /// Designated trading class of the contract.
    pub trading_class: Option<String>,
    /// Underlying contract identifier for the requested contract.
    pub underlying_con_id: Option<i32>,
    /// Indicates the issuer of the underlying.
    pub underlying_issuer: Option<String>,
    /// Comma separated list of support exchanges or trading venues.
    pub valid_exchanges: Option<String>,
}
/// detailed contract information
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractRules {
    /// Indicates if the contract can trade algos or not.
    #[serde(rename = "algoEligible")]
    pub algo_eligible: Option<bool>,
    /// indicates all or non option is eligible for given contract.
    #[serde(rename = "allOrNoneEligible")]
    pub all_or_none_eligible: Option<bool>,
    /// Indicates permitted accountIDs that may trade the contract.
    #[serde(rename = "canTradeAcctIds")]
    pub can_trade_acct_ids: Option<Vec<String>>,
    /// Indicates base currency for the instrument.
    #[serde(rename = "cashCcy")]
    pub cash_ccy: Option<String>,
    /// Indicates cash quantity increment rules.
    #[serde(rename = "cashQtyIncr")]
    pub cash_qty_incr: Option<i32>,
    /// Default cash value quantity.
    #[serde(rename = "cashSize")]
    pub cash_size: Option<f64>,
    /// Indicates whether or not a cost report has been requested (Client Portal only).
    #[serde(rename = "costReport")]
    pub cost_report: Option<bool>,
    /// Indicates accepted order types for use with cash quantity.
    #[serde(rename = "cqtTypes")]
    pub cqt_types: Option<Vec<ContractRulesCqtType>>,
    /// Default total quantity value for orders.
    #[serde(rename = "defaultSize")]
    pub default_size: Option<i32>,
    /// Standard display increment rule for the instrument.
    #[serde(rename = "displaySize")]
    pub display_size: Option<i32>,
    /// If rules information can not be received for any reason, it will be expressed here.
    pub error: Option<String>,
    /// Indicates if the order preview is forced upon the user before submission.
    #[serde(rename = "forceOrderPreview")]
    pub force_order_preview: Option<bool>,
    /// Indicates decimal places for fractional order size.
    #[serde(rename = "fraqInt")]
    pub fraq_int: Option<i32>,
    /// Indicates permitted order types for use with fractional trading.
    #[serde(rename = "fraqTypes")]
    pub fraq_types: Option<Vec<ContractRulesCqtType>>,
    #[serde(rename = "hasSecondary")]
    pub has_secondary: Option<bool>,
    /// Indicates permitted algo types for use with the given contract.
    #[serde(rename = "ibAlgoTypes")]
    pub ib_algo_types: Option<Vec<ContractRulesIbAlgoType>>,
    /// Minimum increment values for prices
    pub increment: Option<f64>,
    /// Number of decimal places to indicate the increment value.
    #[serde(rename = "incrementDigits")]
    pub increment_digits: Option<i32>,
    /// Indicates increment rule values including lowerEdge and increment value.
    #[serde(rename = "incrementRules")]
    pub increment_rules: Option<Vec<ContractRulesIncrementRule>>,
    /// Indicates the type of increment style.
    #[serde(rename = "incrementType")]
    pub increment_type: Option<i32>,
    /// Default limit price for the given contract.
    #[serde(rename = "limitPrice")]
    pub limit_price: Option<f64>,
    /// Lists the available order types supported when modifying the order.
    #[serde(rename = "modTypes")]
    pub mod_types: Option<Vec<serde_json::Value>>,
    /// Indicates if the value of the contract can be negative (true) or if it is always positive (false).
    #[serde(rename = "negativeCapable")]
    pub negative_capable: Option<bool>,
    /// Indicates default order type for the given security type.
    #[serde(rename = "orderDefaults")]
    pub order_defaults: Option<ContractRulesOrderDefaults>,
    /// Order origin designation for US securities options and Options Clearing Corporation
    #[serde(rename = "orderOrigination")]
    pub order_origination: Option<String>,
    /// Indicates permitted order types for use with standard quantity trading.
    #[serde(rename = "orderTypes")]
    pub order_types: Option<Vec<ContractRulesOrderType>>,
    /// Indicates permitted order types for use outside of regular trading hours.
    #[serde(rename = "orderTypesOutside")]
    pub order_types_outside: Option<Vec<ContractRulesOrderTypesOutside>>,
    /// Indicates if the order preview is required (for client portal only)
    pub preview: Option<bool>,
    /// Signifies the magnifier of a given contract. This is separate from the price multiplier, and will typically return 'null'
    #[serde(rename = "priceMagnifier")]
    pub price_magnifier: Option<i32>,
    /// Indicates quantity increase for the contract.
    #[serde(rename = "sizeIncrement")]
    pub size_increment: Option<i32>,
    /// Default stop price for the given contract.
    #[serde(rename = "stopPrice")]
    pub stop_price: Option<f64>,
    /// Object containing details about your TIF value defaults. These defaults can be viewed and modified in TWS's within the Global Configuration.
    #[serde(rename = "tifDefaults")]
    pub tif_defaults: Option<ContractRulesTifDefaults>,
    /// Indicates allowed tif types supported for the contract.
    #[serde(rename = "tifTypes")]
    pub tif_types: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum ContractRulesCqtType {
    #[serde(rename = "limit")]
    #[default]
    Limit,
    #[serde(rename = "market")]
    Market,
    #[serde(rename = "stop")]
    Stop,
    #[serde(rename = "stop_limit")]
    StopLimit,
    #[serde(rename = "mit")]
    Mit,
    #[serde(rename = "lit")]
    Lit,
    #[serde(rename = "trailing_stop")]
    TrailingStop,
    #[serde(rename = "trailing_stop_limit")]
    TrailingStopLimit,
}
impl core::fmt::Display for ContractRulesCqtType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Limit => write!(f, "limit"),
            Self::Market => write!(f, "market"),
            Self::Stop => write!(f, "stop"),
            Self::StopLimit => write!(f, "stop_limit"),
            Self::Mit => write!(f, "mit"),
            Self::Lit => write!(f, "lit"),
            Self::TrailingStop => write!(f, "trailing_stop"),
            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum ContractRulesIbAlgoType {
    #[serde(rename = "limit")]
    #[default]
    Limit,
    #[serde(rename = "stop_limit")]
    StopLimit,
    #[serde(rename = "lit")]
    Lit,
    #[serde(rename = "trailing_stop_limit")]
    TrailingStopLimit,
    #[serde(rename = "relative")]
    Relative,
    #[serde(rename = "marketonclose")]
    Marketonclose,
    #[serde(rename = "limitonclose")]
    Limitonclose,
}
impl core::fmt::Display for ContractRulesIbAlgoType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Limit => write!(f, "limit"),
            Self::StopLimit => write!(f, "stop_limit"),
            Self::Lit => write!(f, "lit"),
            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
            Self::Relative => write!(f, "relative"),
            Self::Marketonclose => write!(f, "marketonclose"),
            Self::Limitonclose => write!(f, "limitonclose"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractRulesIncrementRule {
    /// The price of the instrument must be submitted as a mulitple of the increment value.
    pub increment: Option<f64>,
    /// If the current mark price of the instrument is at or above the lower edge, the given increment value is used for order prices.
    #[serde(rename = "lowerEdge")]
    pub lower_edge: Option<f64>,
}
/// Indicates default order type for the given security type.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractRulesOrderDefaults {
    #[serde(rename = "LMT")]
    pub lmt: Option<ContractRulesOrderDefaultsLmt>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractRulesOrderDefaultsLmt {
    /// Indicates a Limit Price default value.
    #[serde(rename = "LP")]
    pub lp: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum ContractRulesOrderType {
    #[serde(rename = "limit")]
    #[default]
    Limit,
    #[serde(rename = "midprice")]
    Midprice,
    #[serde(rename = "market")]
    Market,
    #[serde(rename = "stop")]
    Stop,
    #[serde(rename = "stop_limit")]
    StopLimit,
    #[serde(rename = "mit")]
    Mit,
    #[serde(rename = "lit")]
    Lit,
    #[serde(rename = "trailing_stop")]
    TrailingStop,
    #[serde(rename = "trailing_stop_limit")]
    TrailingStopLimit,
    #[serde(rename = "relative")]
    Relative,
    #[serde(rename = "marketonclose")]
    Marketonclose,
    #[serde(rename = "limitonclose")]
    Limitonclose,
}
impl core::fmt::Display for ContractRulesOrderType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Limit => write!(f, "limit"),
            Self::Midprice => write!(f, "midprice"),
            Self::Market => write!(f, "market"),
            Self::Stop => write!(f, "stop"),
            Self::StopLimit => write!(f, "stop_limit"),
            Self::Mit => write!(f, "mit"),
            Self::Lit => write!(f, "lit"),
            Self::TrailingStop => write!(f, "trailing_stop"),
            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
            Self::Relative => write!(f, "relative"),
            Self::Marketonclose => write!(f, "marketonclose"),
            Self::Limitonclose => write!(f, "limitonclose"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum ContractRulesOrderTypesOutside {
    #[serde(rename = "limit")]
    #[default]
    Limit,
    #[serde(rename = "stop_limit")]
    StopLimit,
    #[serde(rename = "lit")]
    Lit,
    #[serde(rename = "trailing_stop_limit")]
    TrailingStopLimit,
    #[serde(rename = "relative")]
    Relative,
}
impl core::fmt::Display for ContractRulesOrderTypesOutside {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Limit => write!(f, "limit"),
            Self::StopLimit => write!(f, "stop_limit"),
            Self::Lit => write!(f, "lit"),
            Self::TrailingStopLimit => write!(f, "trailing_stop_limit"),
            Self::Relative => write!(f, "relative"),
        }
    }
}
/// Object containing details about your TIF value defaults. These defaults can be viewed and modified in TWS's within the Global Configuration.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ContractRulesTifDefaults {
    /// default account (multi account only)
    #[serde(rename = "DEFAULT_ACCT")]
    pub default_acct: Option<String>,
    #[serde(rename = "PMALGO")]
    pub pmalgo: Option<bool>,
    /// The default size value for orders.
    #[serde(rename = "SIZE")]
    pub size: Option<String>,
    /// The default TIF type for orders.
    #[serde(rename = "TIF")]
    pub tif: Option<String>,
}
/// Endpoint used to create a new alert, or modify an existing alert.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CreateAlertRequest {
    #[validate(nested)]
    pub path: CreateAlertRequestPath,
    #[validate(nested)]
    pub body: AlertCreationRequest,
}
impl CreateAlertRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<CreateAlertResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlertCreationResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(CreateAlertResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(CreateAlertResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CreateAlertResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CreateAlertResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CreateAlertResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CreateAlertResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct CreateAlertRequestPath {
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for createAlert
#[derive(Debug, Clone)]
pub enum CreateAlertResponse {
    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
    Ok(AlertCreationResponse),
    ///400: bad request; body is empty
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: Internal Server Error. Unable to process request if incoming values are not valid. For example operator is "abc" Or if modification request contains unmodified fields
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Add a new allocation group. This group can be used to trade in place of the {accountId} for the /iserver/account/{accountId}/orders endpoint.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct CreateAllocationGroupRequest {
    #[validate(nested)]
    pub body: GroupRequestBody2,
}
impl CreateAllocationGroupRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<CreateAllocationGroupResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
                .await?;
            return Ok(CreateAllocationGroupResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CreateAllocationGroupResponse::Unknown);
    }
}
/// Response types for createAllocationGroup
#[derive(Debug, Clone)]
pub enum CreateAllocationGroupResponse {
    ///200: Returns a confirmation that the modification was successful.
    Ok(SuccessResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CreateBrowserSessionResponse {
    pub active: Option<bool>,
    /// - Example: `Some("https://www.interactivebrokers.com/sso/...".to_string())`
    pub url: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CreateSessionResponse {
    /// - Example: `"eyJ0eXAiOiJKV1...".to_string()`
    pub access_token: String,
    pub active: Option<bool>,
    /// - Example: `Some("Bearer".to_string())`
    pub token_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct CurrencyPairs {
    /// Additional properties not defined in the schema.
    #[serde(flatten)]
    pub additional_properties: std::collections::HashMap<String, Vec<serde_json::Value>>,
}
/// Permanently delete an existing alert. Deleting an MTA alert will reset it to the default state.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteAlertRequest {
    #[validate(nested)]
    pub path: DeleteAlertRequestPath,
    pub body: ArrayNode,
}
impl DeleteAlertRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteAlertResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlertDeletionResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(DeleteAlertResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(DeleteAlertResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(DeleteAlertResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(DeleteAlertResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteAlertRequestPath {
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// order_id returned from the original alert creation, or from the list of available alerts.
    /// - Example: `"9876543210".to_string()`
    #[validate(length(min = 1u64))]
    pub alert_id: String,
}
/// Response types for deleteAlert
#[derive(Debug, Clone)]
pub enum DeleteAlertResponse {
    ///200: An object containing details on the deleted endpoint.
    Ok(AlertDeletionResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    ///500: Internal Server Error; Unable to delete alert in case when provided alert id doesn't exist
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Deletes a previously created allocation group. This endpoint is only supported for Financial Advisors and IBroker Accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteAllocationGroupRequest {
    #[validate(nested)]
    pub body: NameRequestBody,
}
impl DeleteAllocationGroupRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<CreateAllocationGroupResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
                .await?;
            return Ok(CreateAllocationGroupResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CreateAllocationGroupResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteBankInstruction {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `"WIRE"`
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: DeleteBankInstructionBankInstructionMethod,
    /// - Example: `"Test-instruction".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 150u64))]
    pub bank_instruction_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum DeleteBankInstructionBankInstructionMethod {
    #[serde(rename = "WIRE")]
    #[default]
    Wire,
    #[serde(rename = "ACH")]
    Ach,
}
impl core::fmt::Display for DeleteBankInstructionBankInstructionMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Wire => write!(f, "WIRE"),
            Self::Ach => write!(f, "ACH"),
        }
    }
}
/// Delete a specific device from our saved list of notification devices.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteFyiDeviceRequest {
    pub path: DeleteFyiDeviceRequestPath,
}
impl DeleteFyiDeviceRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteFyiDeviceResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let _ = req.bytes().await?;
            return Ok(DeleteFyiDeviceResponse::Ok);
        }
        let _ = req.bytes().await?;
        return Ok(DeleteFyiDeviceResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct DeleteFyiDeviceRequestPath {
    /// Display the device identifier to delete from IB's saved list. Can be retrieved from /fyi/deliveryoptions.
    pub device_id: serde_json::Value,
}
/// Response types for deleteFyiDevice
#[derive(Debug, Clone)]
pub enum DeleteFyiDeviceResponse {
    ///200: No response message is returned. Instead, you will only receive an empty string with a 200 OK status code indicating a successfully deleted account.
    Ok,
    ///default: Unknown response
    Unknown,
}
/// Delete a specified watchlist from the username's settings.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteWatchlistRequest {
    #[validate(nested)]
    pub query: DeleteWatchlistRequestQuery,
}
impl DeleteWatchlistRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<DeleteWatchlistResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<WatchlistDeleteSuccess>::json_with_diagnostics(req)
                    .await?;
            return Ok(DeleteWatchlistResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(DeleteWatchlistResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(DeleteWatchlistResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(DeleteWatchlistResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(DeleteWatchlistResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(DeleteWatchlistResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct DeleteWatchlistRequestQuery {
    /// Watchlist ID of the watchlist to be deleted.
    /// - Example: `"1234".to_string()`
    #[validate(length(min = 1u64))]
    pub id: String,
}
/// Response types for deleteWatchlist
#[derive(Debug, Clone)]
pub enum DeleteWatchlistResponse {
    ///200: Successful deletion of specified watchlist.
    Ok(WatchlistDeleteSuccess),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DeliveryOptions {
    /// Returns an array of device information.
    #[serde(rename = "E")]
    pub e: Option<Vec<DeliveryOptionsE>>,
    /// Email option is enabled or not.
    #[serde(rename = "M")]
    pub m: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DeliveryOptionsE {
    /// Device is enabled or not.
    #[serde(rename = "A")]
    pub a: Option<String>,
    /// Returns the deice identifier.
    #[serde(rename = "I")]
    pub i: Option<String>,
    /// Returns the human readable device name.
    #[serde(rename = "NM")]
    pub nm: Option<String>,
    /// Returns the unique device ID.
    #[serde(rename = "UI")]
    pub ui: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct DepositFundsInstruction {
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `100.0`
    pub amount: f64,
    /// - Example: `"WIRE"`
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: DepositFundsInstructionBankInstructionMethod,
    /// - Example: `Some("Instruction".to_string())`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 0u64, max = 150u64))]
    pub bank_instruction_name: Option<String>,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
    /// - Example: `Some("identifier".to_string())`
    #[validate(length(min = 0u64, max = 64u64))]
    pub identifier: Option<String>,
    #[serde(rename = "iraDepositDetail")]
    pub ira_deposit_detail: Option<DepositFundsInstructionIraDepositDetail>,
    #[serde(rename = "openBanking")]
    #[validate(nested)]
    pub open_banking: Option<DepositFundsInstructionOpenBanking>,
    #[serde(rename = "recurringInstructionDetail")]
    #[validate(nested)]
    pub recurring_instruction_detail: Option<RecurringInstructionDetail>,
    /// - Example: `Some("Senders Institution name".to_string())`
    #[serde(rename = "senderInstitutionName")]
    #[validate(length(min = 0u64, max = 128u64))]
    pub sender_institution_name: Option<String>,
    /// - Example: `Some("Sending Institution name".to_string())`
    #[serde(rename = "sendingInstitution")]
    #[validate(length(min = 0u64, max = 128u64))]
    pub sending_institution: Option<String>,
    /// - Example: `Some("U46377".to_string())`
    #[serde(rename = "specialInstruction")]
    #[validate(length(min = 0u64, max = 128u64))]
    pub special_instruction: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum DepositFundsInstructionBankInstructionMethod {
    #[serde(rename = "ACH")]
    #[default]
    Ach,
    #[serde(rename = "WIRE")]
    Wire,
    #[serde(rename = "eDDA")]
    EDDA,
    #[serde(rename = "OPEN_BANKING")]
    OpenBanking,
}
impl core::fmt::Display for DepositFundsInstructionBankInstructionMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Ach => write!(f, "ACH"),
            Self::Wire => write!(f, "WIRE"),
            Self::EDDA => write!(f, "eDDA"),
            Self::OpenBanking => write!(f, "OPEN_BANKING"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct DepositFundsInstructionIraDepositDetail {
    /// - Example: `"TRADITIONAL"`
    #[serde(rename = "fromIraType")]
    pub from_ira_type: DepositFundsInstructionIraDepositDetailFromIraType,
    /// - Example: `"ROLLOVER"`
    #[serde(rename = "iraContributionType")]
    pub ira_contribution_type: DepositFundsInstructionIraDepositDetailIraContributionType,
    /// - Example: `"CURRENT"`
    #[serde(rename = "iraTaxYearType")]
    pub ira_tax_year_type: DepositFundsInstructionIraDepositDetailIraTaxYearType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum DepositFundsInstructionIraDepositDetailFromIraType {
    #[serde(rename = "NONE")]
    #[default]
    None,
    #[serde(rename = "TRADITIONAL")]
    Traditional,
    #[serde(rename = "ROLLOVER")]
    Rollover,
    #[serde(rename = "ROTH")]
    Roth,
    #[serde(rename = "SEP")]
    Sep,
    #[serde(rename = "EDUCATION")]
    Education,
    #[serde(rename = "TRADITIONAL_INHERITED")]
    TraditionalInherited,
    #[serde(rename = "ROTH_INHERITED")]
    RothInherited,
    #[serde(rename = "SEP_INHERITED")]
    SepInherited,
    #[serde(rename = "RETIREMENT_SAVING_PLAN")]
    RetirementSavingPlan,
    #[serde(rename = "SPOUSAL_RETIREMENT_SAVING_PLAN")]
    SpousalRetirementSavingPlan,
    #[serde(rename = "TAX_FREE_SAVING_ACCOUNT")]
    TaxFreeSavingAccount,
}
impl core::fmt::Display for DepositFundsInstructionIraDepositDetailFromIraType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::None => write!(f, "NONE"),
            Self::Traditional => write!(f, "TRADITIONAL"),
            Self::Rollover => write!(f, "ROLLOVER"),
            Self::Roth => write!(f, "ROTH"),
            Self::Sep => write!(f, "SEP"),
            Self::Education => write!(f, "EDUCATION"),
            Self::TraditionalInherited => write!(f, "TRADITIONAL_INHERITED"),
            Self::RothInherited => write!(f, "ROTH_INHERITED"),
            Self::SepInherited => write!(f, "SEP_INHERITED"),
            Self::RetirementSavingPlan => write!(f, "RETIREMENT_SAVING_PLAN"),
            Self::SpousalRetirementSavingPlan => {
                write!(f, "SPOUSAL_RETIREMENT_SAVING_PLAN")
            }
            Self::TaxFreeSavingAccount => write!(f, "TAX_FREE_SAVING_ACCOUNT"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum DepositFundsInstructionIraDepositDetailIraContributionType {
    #[serde(rename = "ROLLOVER")]
    #[default]
    Rollover,
    #[serde(rename = "LATE_ROLLOVER")]
    LateRollover,
    #[serde(rename = "DIRECT_ROLLOVER")]
    DirectRollover,
    #[serde(rename = "CONTRIBUTION")]
    Contribution,
    #[serde(rename = "SPOUSAL_CONTRIBUTION")]
    SpousalContribution,
    #[serde(rename = "EMPLOYER_SEP_CONTRIBUTION")]
    EmployerSepContribution,
}
impl core::fmt::Display for DepositFundsInstructionIraDepositDetailIraContributionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Rollover => write!(f, "ROLLOVER"),
            Self::LateRollover => write!(f, "LATE_ROLLOVER"),
            Self::DirectRollover => write!(f, "DIRECT_ROLLOVER"),
            Self::Contribution => write!(f, "CONTRIBUTION"),
            Self::SpousalContribution => write!(f, "SPOUSAL_CONTRIBUTION"),
            Self::EmployerSepContribution => write!(f, "EMPLOYER_SEP_CONTRIBUTION"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum DepositFundsInstructionIraDepositDetailIraTaxYearType {
    #[serde(rename = "CURRENT")]
    #[default]
    Current,
    #[serde(rename = "PRIOR")]
    Prior,
}
impl core::fmt::Display for DepositFundsInstructionIraDepositDetailIraTaxYearType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Current => write!(f, "CURRENT"),
            Self::Prior => write!(f, "PRIOR"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct DepositFundsInstructionOpenBanking {
    #[serde(rename = "plaidOptions")]
    #[validate(nested)]
    pub plaid_options: Option<DepositFundsInstructionOpenBankingPlaidOptions>,
    /// - Example: `"PLAID".to_string()`
    #[serde(rename = "serviceProvider")]
    #[default("PLAID".to_string())]
    pub service_provider: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct DepositFundsInstructionOpenBankingPlaidOptions {
    /// This should be a URI with a custom scheme and this can be any value you'd like, as long as it isn't a reserved one such as http or tel. By convention, it's often one associated with the name of your application.
    /// - Example: `Some("wonderwallet://hosted-link-complete".to_string())`
    #[serde(rename = "completionRedirectUri")]
    #[validate(length(min = 0u64))]
    pub completion_redirect_uri: Option<String>,
    #[serde(rename = "isMobileApp")]
    pub is_mobile_app: Option<bool>,
    /// Client Name displayed on Plaid Link UI
    /// - Example: `Some("WonderWallet".to_string())`
    #[serde(rename = "linkDisplayName")]
    pub link_display_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DepositFundsPollingResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<DepositFundsPollingResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DepositFundsPollingResult {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    #[serde(rename = "depositDetails")]
    pub deposit_details: Option<DepositFundsPollingResultDepositDetails>,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DepositFundsPollingResultDepositDetails {
    pub amount: Option<f64>,
    pub currency: Option<String>,
    #[serde(rename = "openBanking")]
    pub open_banking: Option<DepositFundsPollingResultDepositDetailsOpenBanking>,
    #[serde(rename = "whenAvailable")]
    pub when_available: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DepositFundsPollingResultDepositDetailsOpenBanking {
    #[serde(rename = "providerResponse")]
    pub provider_response: Option<serde_json::Value>,
    #[serde(rename = "serviceProvider")]
    pub service_provider: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Detail200Response {
    /// Collection of accounts held in the model.
    #[serde(rename = "accountInfoList")]
    pub account_info_list: Option<Vec<Detail200ResponseAccountInfoList>>,
    /// Base currency of the model.
    #[serde(rename = "baseCcyMaster")]
    pub base_ccy_master: Option<String>,
    /// Model retrieving accounts from.
    pub model: Option<String>,
    /// Unique identifier for the request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Detail200ResponseAccountInfoList {
    /// Account identifier.
    pub account: Option<String>,
    /// Account's imbalance from the target allocation.
    #[serde(rename = "accountImbalance")]
    pub account_imbalance: Option<String>,
    /// Account alias.
    pub alias: Option<String>,
    /// Base currency of the account.
    #[serde(rename = "baseCcyAccount")]
    pub base_ccy_account: Option<String>,
    /// Cost basis.
    #[serde(rename = "costBasis")]
    pub cost_basis: Option<String>,
    /// Exchange rate of the account base currency to the model base currency.
    #[serde(rename = "exchangeRate")]
    pub exchange_rate: Option<f64>,
    /// The net liquidation value of the instrument.
    pub nlv: Option<String>,
    /// The number of instruments held by the account outside of the alloted range from the presets.
    #[serde(rename = "numInstrumentsOutsideRange")]
    pub num_instruments_outside_range: Option<i32>,
    /// The unrealized profit and loss of the model within the account.
    #[serde(rename = "unrealizedPnL")]
    pub unrealized_pn_l: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct DetailRequestBody {
    /// Determine if Profit and Loss values
    #[serde(rename = "calcPnls")]
    pub calc_pnls: Option<bool>,
    /// Request model to pull account details from.
    pub model: Option<String>,
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_608i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DetailedContractInformation {
    /// Confirms if the currency type. If trading exclusively in your base currency, "base" will be returned.
    #[serde(rename = "currencyType")]
    pub currency_type: Option<String>,
    /// Returns the request identifier, getPerformanceAllPeriods.
    pub id: Option<String>,
    /// Returns an array containing accounts reviewed.
    pub included: Option<Vec<String>>,
    /// Returns the total data points.
    pub nd: Option<i32>,
    /// Portfolio Measure. Used to indicate TWR or MWR values returned.
    pub pm: Option<String>,
    /// Returns the data identifier (Internal Use Only).
    pub rc: Option<i32>,
    /// Returns the accountIds being viewed and returned.
    pub view: Option<Vec<String>>,
    /// Additional properties not defined in the schema.
    #[serde(flatten)]
    pub additional_properties: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DisclaimerInfo {
    /// Returns the Disclaimer message.
    #[serde(rename = "DT")]
    pub dt: Option<String>,
    /// Returns the Typecode for the given disclaimer.
    #[serde(rename = "FC")]
    pub fc: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct DwacInstruction {
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `Some("Title".to_string())`
    #[serde(rename = "accountTitle")]
    #[validate(length(min = 0u64, max = 140u64))]
    pub account_title: Option<String>,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"12345678A".to_string()`
    #[serde(rename = "contraBrokerAccountId")]
    #[validate(length(min = 1u64, max = 20u64))]
    pub contra_broker_account_id: String,
    /// - Example: `"123456789".to_string()`
    #[serde(rename = "contraBrokerTaxId")]
    #[validate(length(min = 1u64, max = 25u64))]
    pub contra_broker_tax_id: String,
    /// - Example: `"IN".to_string()`
    #[default("IN".to_string())]
    pub direction: String,
    /// - Example: `1000.0`
    pub quantity: f64,
    /// - Example: `Some("refId".to_string())`
    #[serde(rename = "referenceId")]
    #[validate(length(min = 0u64, max = 20u64))]
    pub reference_id: Option<String>,
    #[serde(rename = "tradingInstrument")]
    pub trading_instrument: TradingInstrument,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DynAccountSearchResponse {
    /// Contains a series of objects that pertain to the account information requested.
    #[serde(rename = "matchedAccounts")]
    pub matched_accounts: Option<Vec<DynAccountSearchResponseMatchedAccount>>,
    /// Displays the searchPattern used for the request.
    pub pattern: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct DynAccountSearchResponseMatchedAccount {
    /// Returns a matching account ID that corresponds to the matching value.
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    /// Returns the corresponding alias or alternative name for the specific account ID. May be a duplicate of the accountId value in most cases.
    pub alias: Option<String>,
    /// Returns the allocation identifier used internally for the account.
    #[serde(rename = "allocationId")]
    pub allocation_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct EchoResponse {
    /// - Example: `Some({})`
    #[serde(rename = "queryParameters")]
    pub query_parameters: Option<serde_json::Value>,
    /// - Example: `"GET"`
    #[serde(rename = "requestMethod")]
    pub request_method: EchoResponseRequestMethod,
    /// - Example: `"HTTPS"`
    #[serde(rename = "securityPolicy")]
    pub security_policy: EchoResponseSecurityPolicy,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum EchoResponseRequestMethod {
    #[serde(rename = "GET")]
    #[default]
    Get,
    #[serde(rename = "POST")]
    Post,
    #[serde(rename = "PATCH")]
    Patch,
    #[serde(rename = "PUT")]
    Put,
}
impl core::fmt::Display for EchoResponseRequestMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Get => write!(f, "GET"),
            Self::Post => write!(f, "POST"),
            Self::Patch => write!(f, "PATCH"),
            Self::Put => write!(f, "PUT"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum EchoResponseSecurityPolicy {
    #[serde(rename = "HTTPS")]
    #[default]
    Https,
    #[serde(rename = "SIGNED_JWT")]
    SignedJwt,
    #[serde(rename = "ENCRYPTED_JWE")]
    EncryptedJwe,
}
impl core::fmt::Display for EchoResponseSecurityPolicy {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Https => write!(f, "HTTPS"),
            Self::SignedJwt => write!(f, "SIGNED_JWT"),
            Self::EncryptedJwe => write!(f, "ENCRYPTED_JWE"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct EddaInstruction {
    /// - Example: `"U2323232".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `"132456".to_string()`
    #[serde(rename = "bankAccountNumber")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub bank_account_number: String,
    /// - Example: `"003".to_string()`
    #[serde(rename = "bankBranchCode")]
    #[validate(length(min = 1u64, max = 3u64))]
    pub bank_branch_code: String,
    /// - Example: `"003".to_string()`
    #[serde(rename = "bankClearingCode")]
    #[validate(length(min = 1u64, max = 3u64))]
    pub bank_clearing_code: String,
    /// - Example: `"Instruction Name".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 100u64))]
    pub bank_instruction_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"CNH".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
    /// - Example: `"hkId"`
    #[serde(rename = "debtorIdentificationDocumentType")]
    pub debtor_identification_document_type: EddaInstructionDebtorIdentificationDocumentType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum EddaInstructionDebtorIdentificationDocumentType {
    #[serde(rename = "hkId")]
    #[default]
    HkId,
    #[serde(rename = "passport")]
    Passport,
    #[serde(rename = "chinaId")]
    ChinaId,
    #[serde(rename = "hkMacaoEntryPermit")]
    HkMacaoEntryPermit,
}
impl core::fmt::Display for EddaInstructionDebtorIdentificationDocumentType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::HkId => write!(f, "hkId"),
            Self::Passport => write!(f, "passport"),
            Self::ChinaId => write!(f, "chinaId"),
            Self::HkMacaoEntryPermit => write!(f, "hkMacaoEntryPermit"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct EnabledRequestBody {
    /// the notification should be enabled or disabled.
    pub enabled: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct EntityIRABene {
    #[serde(rename = "articleOfWill")]
    pub article_of_will: Option<String>,
    #[serde(rename = "entityType")]
    pub entity_type: Option<String>,
    pub location: Option<std::collections::HashMap<String, String>>,
    pub name: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct EnumerationResponse {
    #[serde(rename = "enumerationsType")]
    pub enumerations_type: Option<String>,
    #[serde(rename = "formNumber")]
    pub form_number: Option<String>,
    #[serde(rename = "jsonData")]
    pub json_data: Option<serde_json::Value>,
}
/// <ul><li>exchange-bundles - query most up to date list of exchange-bundles for tradingPermissions</li><li>business-and-occupation - list of occupation and employerBusiness for employmentDetails</li><li>employee-track - query most up to date companyId for account. For affiliation details, if company has an existing IBKR Employee Track account</li><li>fin-info-ranges - query most up to date range IDs by currency for annualNetIncome, netWorth, liquidNetWorth</li><li>acats - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>aton - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>market-data - query most up to date values for brokerId and brokerName. Used if funding via ATON Canada extPositionsTransfers</li><li>edd-avt - query questions associated with EDD (Enhanced Due Diligence) or AVT (Additional Verification) tasks assigned to an account</li><li>prohibited-country - view list of prohibited countries. Applicants that reside in prohibited country are restricted from opening an account with IBKR. Error will be thrown IF legalResidenceCountry, OR country (included within Residence, mailingAddress and employerAddress, taxResidency node) is a prohibited country</li><li>employee-plans - view EPA that are linked to master account (applicable IF offering SEP IRA accounts)</li><li>questionnaires - obtain list of questionnaires</li><li>security-questions - obtain list of questions supported for IBKR security questions</li><li>quiz-questions - obtain list of questions associated with IBKR knowledge assessment</li><li>wire-instructions - obtain list of wire instructions</li><li>product-country-bundles - obtain list of product country bundles</li></ul>
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum EnumerationType {
    #[serde(rename = "exchange-bundles")]
    #[default]
    ExchangeBundles,
    #[serde(rename = "business-and-occupation")]
    BusinessAndOccupation,
    #[serde(rename = "employee-track")]
    EmployeeTrack,
    #[serde(rename = "fin-info-ranges")]
    FinInfoRanges,
    #[serde(rename = "acats")]
    Acats,
    #[serde(rename = "aton")]
    Aton,
    #[serde(rename = "market-data")]
    MarketData,
    #[serde(rename = "edd-avt")]
    EddAvt,
    #[serde(rename = "prohibited-country")]
    ProhibitedCountry,
    #[serde(rename = "employee-plans")]
    EmployeePlans,
    #[serde(rename = "questionnaires")]
    Questionnaires,
    #[serde(rename = "security-questions")]
    SecurityQuestions,
    #[serde(rename = "quiz-questions")]
    QuizQuestions,
    #[serde(rename = "wire-instructions")]
    WireInstructions,
    #[serde(rename = "product-country-bundles")]
    ProductCountryBundles,
}
impl core::fmt::Display for EnumerationType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::ExchangeBundles => write!(f, "exchange-bundles"),
            Self::BusinessAndOccupation => write!(f, "business-and-occupation"),
            Self::EmployeeTrack => write!(f, "employee-track"),
            Self::FinInfoRanges => write!(f, "fin-info-ranges"),
            Self::Acats => write!(f, "acats"),
            Self::Aton => write!(f, "aton"),
            Self::MarketData => write!(f, "market-data"),
            Self::EddAvt => write!(f, "edd-avt"),
            Self::ProhibitedCountry => write!(f, "prohibited-country"),
            Self::EmployeePlans => write!(f, "employee-plans"),
            Self::Questionnaires => write!(f, "questionnaires"),
            Self::SecurityQuestions => write!(f, "security-questions"),
            Self::QuizQuestions => write!(f, "quiz-questions"),
            Self::WireInstructions => write!(f, "wire-instructions"),
            Self::ProductCountryBundles => write!(f, "product-country-bundles"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ErrorResponse {
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ExternalAssetTransfersBulkRequestBody {
    #[serde(rename = "instructionType")]
    pub instruction_type: TransferRequestBody2InstructionType,
    pub instructions: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ExternalCashTransfersBulkRequestBody {
    #[serde(rename = "instructionType")]
    pub instruction_type: TransferRequestBody3InstructionType,
    pub instructions: Vec<serde_json::Value>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct ExternalPositionTransfer {
    /// - Example: `"SOL12345".to_string()`
    #[serde(rename = "accountAtBroker")]
    #[validate(length(min = 1u64, max = 34u64))]
    pub account_at_broker: String,
    /// - Example: `"U2323232".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `"0226".to_string()`
    #[serde(rename = "brokerId")]
    #[validate(length(min = 1u64, max = 20u64))]
    pub broker_id: String,
    /// - Example: `"Wall Street Financial Group".to_string()`
    #[serde(rename = "brokerName")]
    #[validate(length(min = 1u64, max = 256u64))]
    pub broker_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"sample signature".to_string()`
    #[validate(length(min = 1u64, max = 140u64))]
    pub signature: String,
    /// - Example: `Some("RO")`
    #[serde(rename = "sourceIRAType")]
    pub source_iratype: Option<ExternalPositionTransferSourceIratype>,
    /// - Example: `"ACATS"`
    #[serde(rename = "subType")]
    pub sub_type: SubType,
    /// - Example: `"FULL".to_string()`
    #[serde(rename = "type")]
    #[default("FULL".to_string())]
    pub r#type: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum ExternalPositionTransferSourceIratype {
    #[serde(rename = "RO")]
    #[default]
    Ro,
    #[serde(rename = "RI")]
    Ri,
    #[serde(rename = "RT")]
    Rt,
    #[serde(rename = "SP")]
    Sp,
    #[serde(rename = "ED")]
    Ed,
    #[serde(rename = "TH")]
    Th,
    #[serde(rename = "RH")]
    Rh,
    #[serde(rename = "SH")]
    Sh,
}
impl core::fmt::Display for ExternalPositionTransferSourceIratype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Ro => write!(f, "RO"),
            Self::Ri => write!(f, "RI"),
            Self::Rt => write!(f, "RT"),
            Self::Sp => write!(f, "SP"),
            Self::Ed => write!(f, "ED"),
            Self::Th => write!(f, "TH"),
            Self::Rh => write!(f, "RH"),
            Self::Sh => write!(f, "SH"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FailedTickleResponse {
    /// reason why tickle was accepted by not processed
    pub error: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Features {
    /// Displayed as the string of your symbol Contains a series of objects for each symbol that matches the requested.
    pub symbol: Option<Vec<FeaturesSymbol>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FeaturesSymbol {
    /// Contract identifier for the specific symbol
    pub conid: Option<i32>,
    /// Expiration date of the specific future contract.
    #[serde(rename = "expirationDate")]
    pub expiration_date: Option<i32>,
    /// Represents the final day for contract rollover for long futures.
    #[serde(rename = "longFuturesCutOff")]
    pub long_futures_cut_off: Option<i32>,
    /// Last trade date of the future contract.
    pub ltd: Option<i32>,
    /// Represents the final day for contract rollover for shorted futures.
    #[serde(rename = "shortFuturesCutOff")]
    pub short_futures_cut_off: Option<i32>,
    /// The requested symbol value.
    pub symbol: Option<String>,
    /// Contract identifier for the future's underlying contract.
    #[serde(rename = "underlyingConid")]
    pub underlying_conid: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FileData {
    pub data: Option<serde_json::Value>,
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FileDetailsResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "requestFileName")]
    pub request_file_name: Option<String>,
    #[serde(rename = "responseFileName")]
    pub response_file_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct FopInstruction {
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"12345678A".to_string()`
    #[serde(rename = "contraBrokerAccountId")]
    #[validate(length(min = 1u64, max = 20u64))]
    pub contra_broker_account_id: String,
    /// - Example: `"534".to_string()`
    #[serde(rename = "contraBrokerDtcCode")]
    #[validate(length(min = 1u64, max = 20u64))]
    pub contra_broker_dtc_code: String,
    /// - Example: `"IN"`
    pub direction: InstructionDirection,
    /// - Example: `1000.0`
    pub quantity: f64,
    #[serde(rename = "tradingInstrument")]
    pub trading_instrument: TradingInstrument,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastDetailsResponse {
    /// The affiliated market category declared in /forecast/category/tree.
    pub category: Option<String>,
    /// Contract identifier of "no" contract
    pub conid_no: Option<i32>,
    /// Contract identifier of "yes" contract
    pub conid_yes: Option<i32>,
    /// Contract exchange.
    pub exchange: Option<String>,
    /// Contract expiration date in YYYYMMDD format.
    pub expiration: Option<String>,
    /// Logo category to use in logo service to get image.
    pub logo_category: Option<String>,
    /// name of contract's market.
    pub market_name: Option<String>,
    /// measured period
    pub measured_period: Option<String>,
    /// Ratio of payout scaling.
    pub payout: Option<f64>,
    /// Contract question (i.e. "Will this happen on this date?")
    pub question: Option<String>,
    /// "Y" or "N", yes or no contract.
    pub side: Option<String>,
    /// Contract strike.
    pub strike: Option<f64>,
    /// Strike label to display.
    pub strike_label: Option<String>,
    /// Contract symbol.
    pub symbol: Option<String>,
    /// Immediate underlier to contract (i.e. future conid for FOPs)
    pub underlying_conid: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastMarketResponse {
    /// List of contracts matching the requested market.
    pub contracts: Option<Vec<ForecastMarketResponseContract>>,
    /// Exchange that was passed in request or determined internally.
    pub exchange: Option<String>,
    /// Indicates whether UI should or should not display underlying chart.
    pub exclude_historical_data: Option<bool>,
    /// Logo category to use in logo service to retrieve image.
    pub logo_category: Option<String>,
    /// Market contract identifier.
    pub market_name: Option<String>,
    /// Ratio of payout scaling.
    pub payout: Option<f64>,
    /// Market symbol.
    pub symbol: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastMarketResponseContract {
    /// Market contract identifier.
    pub conid: Option<i32>,
    /// Contract expiration date in YYYYMMDD format.
    pub expiration: Option<String>,
    /// Label UI to show for the expiration tabs.
    pub expiry_label: Option<String>,
    /// "Y" or "N" denoting a Yes or No contract.
    pub side: Option<String>,
    /// Contract strike price.
    pub strike: Option<f64>,
    /// Strike label to display.
    pub strike_label: Option<String>,
    /// Specified date of expiration.
    pub time_specifier: Option<String>,
    /// Immediate underlier to contract (i.e. future conid for FOPs).
    pub underlying_conid: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastRulesResponse {
    /// Product asset class.
    pub asset_class: Option<String>,
    /// Link to data from source agency.
    pub data_and_resolution_link: Option<String>,
    /// Long product description.
    pub description: Option<String>,
    /// Exchange timezone.
    pub exchange_timezone: Option<String>,
    /// last trade time in epoch seconds.
    pub last_trade_time: Option<i32>,
    /// Name of the contract's market.
    pub market_name: Option<String>,
    /// Link to market rules document.
    pub market_rules_link: Option<String>,
    /// Measured period of the contract.
    pub measured_period: Option<String>,
    /// Formatted payout amount.
    pub payout: Option<String>,
    /// Payout time in epoch seconds.
    pub payout_time: Option<i32>,
    /// Formatted price increment amount.
    pub price_increment: Option<String>,
    /// Product code (symbol).
    pub product_code: Option<String>,
    /// Release time in epoch seconds.
    pub release_time: Option<i32>,
    /// Name of the contract's source agency.
    pub source_agency: Option<String>,
    /// Either strike or strike label depending on contract type.
    pub threshold: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastSchedulesResponse {
    /// Exchange timezone of event contract.
    pub timezone: Option<String>,
    /// List containing trading objects for each date.
    pub trading_schedules: Option<Vec<ForecastSchedulesResponseTradingSchedule>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastSchedulesResponseTradingSchedule {
    /// Provides the day of the week corresponding to the trading schedule.
    pub day_of_week: Option<String>,
    /// List containing the opening times for the event contract. Multiple trading blocks may be returned if the contract has an intraday trading closure.
    pub trading_times: Option<Vec<ForecastSchedulesResponseTradingScheduleTradingTime>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ForecastSchedulesResponseTradingScheduleTradingTime {
    /// The closing time for the given trading session.
    pub close: Option<String>,
    /// The opening time for the given trading session.
    pub open: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FormDetails {
    #[serde(rename = "acceptableDocs")]
    pub acceptable_docs: Option<Vec<String>>,
    pub action: Option<String>,
    #[serde(rename = "apiSupportedTask")]
    pub api_supported_task: Option<bool>,
    #[serde(rename = "dateModified")]
    pub date_modified: Option<chrono::DateTime<chrono::Utc>>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "fileLength")]
    pub file_length: Option<i64>,
    #[serde(rename = "fileName")]
    pub file_name: Option<String>,
    #[serde(rename = "formName")]
    pub form_name: Option<String>,
    #[serde(rename = "formNumber")]
    pub form_number: Option<i32>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    pub language: Option<String>,
    pub payload: Option<FormPayload>,
    pub questionnaire: Option<Vec<QuestionnaireResponse>>,
    #[serde(rename = "sha1Checksum")]
    pub sha1checksum: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FormFileResponse {
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "fileData")]
    pub file_data: Option<FileData>,
    #[serde(rename = "formDetails")]
    pub form_details: Option<Vec<FormDetails>>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    pub timestamp: Option<chrono::DateTime<chrono::Utc>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FormPayload {
    pub data: Option<String>,
    #[serde(rename = "mimeType")]
    pub mime_type: Option<String>,
}
/// Contains commodities specific fund values.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Funds {
    /// This value reflects your available funds at the next margin change.
    #[serde(rename = "Lk Ahd Avlbl Fnds")]
    pub lk_ahd_avlbl_fnds: Option<String>,
    /// Displays predicted post-expiration account value.
    #[serde(rename = "Prdctd Pst-xpry Excss")]
    pub prdctd_pst_xpry_excss: Option<String>,
    /// Describes currently avialable funds in your account for trading.
    pub current_available: Option<String>,
    /// Describes total value of the account.
    pub current_excess: Option<String>,
    /// Describes available funds for overnight trading.
    pub overnight_available: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` - Equivalent to regular trading hours.
    ///    * `Commodities` - Commodities Net Liquidation value. Overnight Maintenance margin.
    pub overnight_excess: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct FyiEnableDeviceOption {
    #[serde(rename = "deviceId")]
    pub device_id: Option<String>,
    #[serde(rename = "deviceName")]
    pub device_name: Option<String>,
    /// enable or disable device
    pub enabled: Option<bool>,
    #[serde(rename = "uiName")]
    pub ui_name: Option<String>,
}
pub type FyiSettings = Vec<FyiSettingsFyiSetting>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FyiSettingsFyiSetting {
    /// Returns ony if the subscription can be disabled/enabled manually. See /fyi/settings/{typecode} for how to enable/disable.
    #[serde(rename = "A")]
    pub a: Option<i32>,
    /// Fyi code for enabling or disabling the notification.
    #[serde(rename = "FC")]
    pub fc: Option<String>,
    /// Returns a detailed description of the topic.
    #[serde(rename = "FD")]
    pub fd: Option<String>,
    /// Returns a human readable title for the notification.
    #[serde(rename = "FN")]
    pub r#fn: Option<String>,
    /// Disclaimer if the notification was read.
    #[serde(rename = "H")]
    pub h: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct FyiVT {
    /// Returns the time in ms to complete the edit.
    #[serde(rename = "T")]
    pub t: Option<i32>,
    /// Returns 1 to state message was acknowledged.
    #[serde(rename = "V")]
    pub v: Option<i32>,
}
/// Generate OAuth 2.0 access tokens based on request parameters.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GenerateTokenRequest {
    pub body: TokenRequest,
}
impl GenerateTokenRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GenerateTokenResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TokenResponse>::json_with_diagnostics(req).await?;
            return Ok(GenerateTokenResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GenerateTokenResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GenerateTokenResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GenerateTokenResponse::Unknown);
    }
}
/// Response types for generateToken
#[derive(Debug, Clone)]
pub enum GenerateTokenResponse {
    ///200: Returns a token response.
    Ok(TokenResponse),
    ///400: Returns a [Problem detail](https://datatracker.ietf.org/doc/html/rfc9457) instance representing a bad request.
    BadRequest,
    ///500: Returns a [Problem detail](https://datatracker.ietf.org/doc/html/rfc9457) instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Returns a summary of an account's market value, by currency and asset class.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountMarketSummaryRequest {
    #[validate(nested)]
    pub path: GetAccountMarketSummaryRequestPath,
}
impl GetAccountMarketSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAccountMarketSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SummaryMarketValueResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetAccountMarketSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAccountMarketSummaryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAccountMarketSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAccountMarketSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAccountMarketSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountMarketSummaryRequestPath {
    /// Pass the account identifier to receive information for.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getAccountMarketSummary
#[derive(Debug, Clone)]
pub enum GetAccountMarketSummaryResponse {
    ///200: Indicates a successful market value request.
    Ok(SummaryMarketValueResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Receive a list of all applicant names on the account and for which account and entity is represented.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountOwnersRequest {
    #[validate(nested)]
    pub path: GetAccountOwnersRequestPath,
}
impl GetAccountOwnersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAccountOwnersResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SignatureAndOwners>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAccountOwnersResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAccountOwnersResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAccountOwnersResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAccountOwnersResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAccountOwnersResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountOwnersRequestPath {
    /// The account identifier to receive information for
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getAccountOwners
#[derive(Debug, Clone)]
pub enum GetAccountOwnersResponse {
    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
    Ok(SignatureAndOwners),
    ///400: bad request; accountId is empty
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Provides a general overview of the account details such as balance values.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountSummaryRequest {
    #[validate(nested)]
    pub path: GetAccountSummaryRequestPath,
}
impl GetAccountSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAccountSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountSummaryResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAccountSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAccountSummaryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAccountSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAccountSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAccountSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountSummaryRequestPath {
    /// Pass the account identifier to receive information for.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getAccountSummary
#[derive(Debug, Clone)]
pub enum GetAccountSummaryResponse {
    ///200: Provides a general overview of the account details such as balance values.
    Ok(AccountSummaryResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request all accounts held within a model.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAccountsInModelRequest {
    pub body: DetailRequestBody,
}
impl GetAccountsInModelRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAccountsInModelResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Detail200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAccountsInModelResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAccountsInModelResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAccountsInModelResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAccountsInModelResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAccountsInModelResponse::Unknown);
    }
}
/// Response types for getAccountsInModel
#[derive(Debug, Clone)]
pub enum GetAccountsInModelResponse {
    ///200: Successfully retrieve account details of in a model.
    Ok(Detail200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request details of a specific alert by providing the assigned alertId Id.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAlertDetailsRequest {
    pub path: GetAlertDetailsRequestPath,
    pub query: GetAlertDetailsRequestQuery,
}
impl GetAlertDetailsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAlertDetailsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlertDetails>::json_with_diagnostics(req).await?;
            return Ok(GetAlertDetailsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAlertDetailsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAlertDetailsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAlertDetailsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAlertDetailsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAlertDetailsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetAlertDetailsRequestPath {
    /// alert identifier, internally referenced as order id
    pub alert_id: i64,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetAlertDetailsRequestQuery {
    /// queryType
    #[serde(rename = "type")]
    #[default("Q".to_string())]
    pub r#type: String,
}
/// Response types for getAlertDetails
#[derive(Debug, Clone)]
pub enum GetAlertDetailsResponse {
    ///200: An object containing all unique details of the specified alert.
    Ok(AlertDetails),
    ///400: bad request if orderId is empty or type is invalid
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    ///500: orderId is not parsable; unable to process request
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns supported IB Algos for an instrument. A pre-flight request must be submitted before retrieving information.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAlgosByInstrumentRequest {
    #[validate(nested)]
    pub path: GetAlgosByInstrumentRequestPath,
    pub query: GetAlgosByInstrumentRequestQuery,
}
impl GetAlgosByInstrumentRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAlgosByInstrumentResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlgosResponse>::json_with_diagnostics(req).await?;
            return Ok(GetAlgosByInstrumentResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAlgosByInstrumentResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAlgosByInstrumentResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAlgosByInstrumentResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAlgosByInstrumentResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAlgosByInstrumentRequestPath {
    /// Contract identifier for the requested contract of interest.
    #[validate(length(min = 1u64))]
    pub conid: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetAlgosByInstrumentRequestQuery {
    /// List of algo ids delimited by ";" to filter by. Max of 8 algos ids can be specified. Case sensitive to algo id.
    pub algos: Option<GetAlgosByInstrumentRequestQueryAlgos>,
    /// Whether or not to add algo descriptions to response. Set to 1 for yes, 0 for no.
    #[serde(rename = "addDescription")]
    #[default(Some(Default::default()))]
    pub add_description: Option<AlertActivationRequestAlertActive>,
    /// Whether or not to show algo parameters. Set to 1 for yes, 0 for no.
    #[serde(rename = "addParams")]
    #[default(Some(Default::default()))]
    pub add_params: Option<AlertActivationRequestAlertActive>,
}
/// List of algo ids delimited by ";" to filter by. Max of 8 algos ids can be specified. Case sensitive to algo id.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetAlgosByInstrumentRequestQueryAlgos {
    #[default]
    Adaptive,
    Vwap,
}
impl core::fmt::Display for GetAlgosByInstrumentRequestQueryAlgos {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Adaptive => write!(f, "Adaptive"),
            Self::Vwap => write!(f, "Vwap"),
        }
    }
}
/// Response types for getAlgosByInstrument
#[derive(Debug, Clone)]
pub enum GetAlgosByInstrumentResponse {
    ///200: Returns a list of available algos and a description of their behavior.
    Ok(AlgosResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get positions in accounts for a given instrument (no secDef await control)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllAccountsForConidRequest {
    pub path: GetAllAccountsForConidRequestPath,
}
impl GetAllAccountsForConidRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllAccountsForConidResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Position200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllAccountsForConidResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsForConidResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsForConidResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsForConidResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsForConidResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllAccountsForConidResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetAllAccountsForConidRequestPath {
    /// Conid of the instrument for which positions are requested.
    /// - Example: `8_314i32`
    pub conid: i32,
}
/// Response types for getAllAccountsForConid
#[derive(Debug, Clone)]
pub enum GetAllAccountsForConidResponse {
    ///200: Object containing positions in the requested conid broken out by account.
    Ok(Position200Response),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// return accounts
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllAccountsRequest {}
impl GetAllAccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllAccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Account200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllAccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllAccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllAccountsResponse::Unknown);
    }
}
/// Response types for getAllAccounts
#[derive(Debug, Clone)]
pub enum GetAllAccountsResponse {
    ///200: returned array with user account
    Ok(Account200Response2),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve a list of all alerts attached to the provided account.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllAlertsRequest {
    #[validate(nested)]
    pub path: GetAllAlertsRequestPath,
}
impl GetAllAlertsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllAlertsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Alerts>::json_with_diagnostics(req).await?;
            return Ok(GetAllAlertsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllAlertsResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllAlertsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllAlertsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllAlertsRequestPath {
    /// Identifier for the unique account to retrieve information from.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getAllAlerts
#[derive(Debug, Clone)]
pub enum GetAllAlertsResponse {
    ///200: An array of objects detailing contract information.
    Ok(Alerts),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get a list of available notifications.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllFyisRequest {
    pub query: GetAllFyisRequestQuery,
}
impl GetAllFyisRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllFyisResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Notifications>::json_with_diagnostics(req).await?;
            return Ok(GetAllFyisResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAllFyisResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllFyisResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllFyisResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllFyisResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllFyisResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetAllFyisRequestQuery {
    /// Specify the maximum number of notifications to receive. Can request a maximum of 10 notifications.
    /// - Example: `10i32`
    pub max: i32,
    /// Include only the specified typecode notifications in the request.
    pub include: Option<serde_json::Value>,
    /// Include all subscribed notifications except the typecodes passed here.
    pub exclude: Option<serde_json::Value>,
    /// if more required, notifcationId of last notification should be used to define next batch border
    pub id: Option<serde_json::Value>,
}
/// Response types for getAllFyis
#[derive(Debug, Clone)]
pub enum GetAllFyisResponse {
    ///200: Successfully enabled or disabled your email notifications.
    Ok(Notifications),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request all positions held within the model.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllModelPositionsRequest {
    pub body: PositionRequestBody2,
}
impl GetAllModelPositionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllModelPositionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ModelPositionResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllModelPositionsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllModelPositionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllModelPositionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllModelPositionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllModelPositionsResponse::Unknown);
    }
}
/// Response types for getAllModelPositions
#[derive(Debug, Clone)]
pub enum GetAllModelPositionsResponse {
    ///200: Successfully retrieve position details
    Ok(ModelPositionResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve attributes of the subaccounts in the account structure.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllSubaccountsRequest {}
impl GetAllSubaccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllSubaccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Subaccount200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllSubaccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllSubaccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllSubaccountsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllSubaccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllSubaccountsResponse::Unknown);
    }
}
/// Response types for getAllSubaccounts
#[derive(Debug, Clone)]
pub enum GetAllSubaccountsResponse {
    ///200: Array of objects representing accounts in the structure.
    Ok(Subaccount200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns all saved watchlists stored on IB backend for the username in use in the current Web API session.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllWatchlistsRequest {
    pub query: GetAllWatchlistsRequestQuery,
}
impl GetAllWatchlistsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllWatchlistsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<WatchlistsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllWatchlistsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllWatchlistsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllWatchlistsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllWatchlistsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllWatchlistsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetAllWatchlistsRequestQuery {
    /// Can only be used with value USER_WATCHLIST, which returns only user-created watchlists and excludes those created by IB.
    /// - Example: `Some("USER_WATCHLIST".to_string())`
    #[serde(rename = "SC")]
    #[default(Some("USER_WATCHLIST".to_string()))]
    pub sc: Option<String>,
}
/// Response types for getAllWatchlists
#[derive(Debug, Clone)]
pub enum GetAllWatchlistsResponse {
    ///200: Historical data query successfully returned data.
    Ok(WatchlistsResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve summaries for all models under the advisor account.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllmodelsRequest {
    pub body: ReqIDRequestBody,
}
impl GetAllmodelsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetAllmodelsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ModelListResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllmodelsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllmodelsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllmodelsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllmodelsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllmodelsResponse::Unknown);
    }
}
/// Response types for getAllmodels
#[derive(Debug, Clone)]
pub enum GetAllmodelsResponse {
    ///200: Successfully retrieve the model list
    Ok(ModelListResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieves a list of all sub-accounts and returns their net liquidity and available equity for advisors to make decisions on what accounts should be allocated and how. This endpoint is only supported for Financial Advisors and IBroker Accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllocatableSubaccountsRequest {}
impl GetAllocatableSubaccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllocatableSubaccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SubAccounts>::json_with_diagnostics(req).await?;
            return Ok(GetAllocatableSubaccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllocatableSubaccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllocatableSubaccountsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllocatableSubaccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllocatableSubaccountsResponse::Unknown);
    }
}
/// Response types for getAllocatableSubaccounts
#[derive(Debug, Clone)]
pub enum GetAllocatableSubaccountsResponse {
    ///200: Indicates data is being returned successfully.
    Ok(SubAccounts),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieves a list of all of the advisor's allocation groups. This describes the name of the allocation group, number of subaccounts within the group, and the method in use for the group. This endpoint is only supported for Financial Advisors and IBroker Accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllocationGroupsRequest {}
impl GetAllocationGroupsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllocationGroupsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AllocationGroups>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAllocationGroupsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllocationGroupsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllocationGroupsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllocationGroupsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllocationGroupsResponse::Unknown);
    }
}
/// Response types for getAllocationGroups
#[derive(Debug, Clone)]
pub enum GetAllocationGroupsResponse {
    ///200: Returns the "data" array, which contains all allocation groups under the advisor account.
    Ok(AllocationGroups),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve the preset behavior for allocation groups for specific events. This endpoint is only supported for Financial Advisors and IBroker Accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAllocationPresetsRequest {}
impl GetAllocationPresetsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAllocationPresetsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Presets>::json_with_diagnostics(req).await?;
            return Ok(GetAllocationPresetsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAllocationPresetsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAllocationPresetsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAllocationPresetsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAllocationPresetsResponse::Unknown);
    }
}
/// Response types for getAllocationPresets
#[derive(Debug, Clone)]
pub enum GetAllocationPresetsResponse {
    ///200: Successfully retrieve preset details
    Ok(Presets),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get an account's allocations by asset class, sector group, and sector.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetAssetAllocationRequest {
    #[validate(nested)]
    pub path: GetAssetAllocationRequestPath,
    pub query: GetAssetAllocationRequestQuery,
}
impl GetAssetAllocationRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetAssetAllocationResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<PortfolioAllocations>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetAssetAllocationResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetAssetAllocationResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetAssetAllocationResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetAssetAllocationResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetAssetAllocationResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetAssetAllocationResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetAssetAllocationRequestPath {
    /// Account ID whose allocations are requested.
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetAssetAllocationRequestQuery {
    /// model
    pub model: Option<serde_json::Value>,
}
/// Response types for getAssetAllocation
#[derive(Debug, Clone)]
pub enum GetAssetAllocationResponse {
    ///200: response with allocations
    Ok(PortfolioAllocations),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetAvailableStmtDatesResponse {
    pub data: Option<AvailableStatementDatesData>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetAvailableTaxFormsResponse {
    pub data: Option<AvailableTaxFormsData>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetAvailableTradeConfirmationDatesResponse {
    pub data: Option<GetAvailableTradeConfirmationDatesResponseData>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetAvailableTradeConfirmationDatesResponseData {
    /// - Example: `Some("String".to_string())`
    #[serde(rename = "dataType")]
    pub data_type: Option<String>,
    /// available trade confirmation dates
    pub value: Option<Vec<String>>,
}
/// Returns a summary of an account's equity and cash balances, in total and by account segment.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetBalanceSummaryRequest {
    #[validate(nested)]
    pub path: GetBalanceSummaryRequestPath,
}
impl GetBalanceSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetBalanceSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                SummaryOfAccountBalancesResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetBalanceSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetBalanceSummaryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetBalanceSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetBalanceSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetBalanceSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetBalanceSummaryRequestPath {
    /// Pass the account identifier to receive information for.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getBalanceSummary
#[derive(Debug, Clone)]
pub enum GetBalanceSummaryResponse {
    ///200: Indicates a successful return of available funds.
    Ok(SummaryOfAccountBalancesResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request a list of filters relating to a given Bond issuerID. The issuerId is retrieved from /iserver/secdef/search and can be used in /iserver/secdef/info?issuerId={issuerId} for retrieving conIds.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetBondFiltersRequest {
    #[validate(nested)]
    pub query: GetBondFiltersRequestQuery,
}
impl GetBondFiltersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetBondFiltersResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<BondFiltersResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetBondFiltersResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetBondFiltersResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetBondFiltersResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetBondFiltersResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetBondFiltersResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetBondFiltersRequestQuery {
    /// This should always be set to "BOND"
    /// - Example: `"BOND".to_string()`
    #[validate(length(min = 1u64))]
    pub symbol: String,
    /// Specifies the issuerId of the bond issuer type. IssuerId can be retrieved from the /iserver/secdef/search endpoint searching for a genric bond symbol and using the BOND secType.
    /// - Example: `"e1400715".to_string()`
    #[serde(rename = "issuerId")]
    #[validate(length(min = 1u64))]
    pub issuer_id: String,
}
/// Response types for getBondFilters
#[derive(Debug, Clone)]
pub enum GetBondFiltersResponse {
    ///200: Successful requests return the currency exchange rate of the target currency value divided by the source currency.
    Ok(BondFiltersResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetBrokerListResponse {
    pub brokers: Vec<String>,
    /// - Example: `"COMPLEX_ASSET_TRANSFER".to_string()`
    #[serde(rename = "instructionType")]
    pub instruction_type: String,
}
/// Returns a list of accounts the user has trading access to, their respective aliases and the currently selected account. Note this endpoint must be called before modifying an order or querying open orders.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetBrokerageAccountsRequest {}
impl GetBrokerageAccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetBrokerageAccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<UserAccountsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetBrokerageAccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetBrokerageAccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetBrokerageAccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetBrokerageAccountsResponse::Unknown);
    }
}
/// Response types for getBrokerageAccounts
#[derive(Debug, Clone)]
pub enum GetBrokerageAccountsResponse {
    ///200: An object containing valid accounts and the account properties regarding trading access. This endpoint is also used to confirm account validation.
    Ok(UserAccountsResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Current Authentication status to the Brokerage system. Market Data and Trading is not possible if not authenticated.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetBrokerageStatusRequest {}
impl GetBrokerageStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetBrokerageStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<BrokerageSessionStatus>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetBrokerageStatusResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetBrokerageStatusResponse::Unauthorized);
        }
        let _ = req.bytes().await?;
        return Ok(GetBrokerageStatusResponse::Unknown);
    }
}
/// Response types for getBrokerageStatus
#[derive(Debug, Clone)]
pub enum GetBrokerageStatusResponse {
    ///200: Detailed status of the Brokerage session
    Ok(BrokerageSessionStatus),
    ///401: Invalid or expired access token
    Unauthorized,
    ///default: Unknown response
    Unknown,
}
/// Provides all positions held in the account acquired as a combination, including values such as ratios, size, and market value.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetComboPositionsRequest {
    #[validate(nested)]
    pub path: GetComboPositionsRequestPath,
    pub query: GetComboPositionsRequestQuery,
}
impl GetComboPositionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetComboPositionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ComboPositionResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetComboPositionsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetComboPositionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetComboPositionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetComboPositionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetComboPositionsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetComboPositionsRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetComboPositionsRequestQuery {
    /// Set if request should be made without caching.
    #[default(Some(false))]
    pub nocache: Option<bool>,
}
/// Response types for getComboPositions
#[derive(Debug, Clone)]
pub enum GetComboPositionsResponse {
    ///200: response with combo position definitions
    Ok(ComboPositionResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Send out a request to retrieve all contracts made available on a requested exchange. This returns all contracts that are tradable on the exchange, even those that are not using the exchange as their primary listing.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetConidsByExchangeRequest {
    #[validate(nested)]
    pub query: GetConidsByExchangeRequestQuery,
}
impl GetConidsByExchangeRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetConidsByExchangeResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Vec<serde_json::Value>>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetConidsByExchangeResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetConidsByExchangeResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetConidsByExchangeResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetConidsByExchangeResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetConidsByExchangeResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetConidsByExchangeRequestQuery {
    /// Exchange from which derivatives should be retrieved from.
    /// - Example: `"AMEX".to_string()`
    #[validate(length(min = 1u64))]
    pub exchange: String,
    /// asset class
    #[serde(rename = "assetClass")]
    #[default(Some(Default::default()))]
    pub asset_class: Option<serde_json::Value>,
}
/// Response types for getConidsByExchange
#[derive(Debug, Clone)]
pub enum GetConidsByExchangeResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(Vec<serde_json::Value>),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the attributes of the instrument.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractInfoRequest {
    pub query: GetContractInfoRequestQuery,
}
impl GetContractInfoRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetContractInfoResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SecDefInfoResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetContractInfoResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetContractInfoResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetContractInfoResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetContractInfoResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetContractInfoResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetContractInfoResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetContractInfoRequestQuery {
    /// Contract identifier of the underlying. May also pass the final derivative conid directly.
    /// - Example: `Some("265598".to_string())`
    pub conid: Option<String>,
    /// Security type of the requested contract of interest.
    pub sectype: Option<serde_json::Value>,
    /// Expiration month for the given derivative.
    pub month: Option<serde_json::Value>,
    /// Designate the exchange you wish to receive information for in relation to the contract.
    pub exchange: Option<serde_json::Value>,
    /// Set the strike price for the requested contract details
    pub strike: Option<serde_json::Value>,
    /// Set the right for the given contract. * `C` - for Call options. * `P` - for Put options.
    pub right: Option<IndividualPositionPutOrCall>,
    /// Set the issuerId for the given bond issuer type.
    /// - Example: `Some("e1234567".to_string())`
    #[serde(rename = "issuerId")]
    pub issuer_id: Option<String>,
    /// comma separted list of additional filters. Applicable when SecTyp is BOND
    pub filters: Option<serde_json::Value>,
}
/// Response types for getContractInfo
#[derive(Debug, Clone)]
pub enum GetContractInfoResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(SecDefInfoResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns trading related rules for a specific contract and side.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractRulesRequest {
    pub body: RuleRequestBody,
}
impl GetContractRulesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetContractRulesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ContractRules>::json_with_diagnostics(req).await?;
            return Ok(GetContractRulesResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetContractRulesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetContractRulesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetContractRulesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetContractRulesResponse::Unknown);
    }
}
/// Response types for getContractRules
#[derive(Debug, Clone)]
pub enum GetContractRulesResponse {
    ///200: An array of objects detailing contract information.
    Ok(ContractRules),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns lists of valid strikes for options contracts on a given underlier, for all currently trading expirations. The /iserver/secdef/search endpoint must be called prior for the underlying. Otherwise empty arrays will return for "puts" and "calls".
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractStrikesRequest {
    #[validate(nested)]
    pub query: GetContractStrikesRequestQuery,
}
impl GetContractStrikesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetContractStrikesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Strike200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetContractStrikesResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetContractStrikesResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetContractStrikesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetContractStrikesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetContractStrikesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetContractStrikesResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractStrikesRequestQuery {
    /// Contract identifier of the underlying. May also pass the final derivative conid directly.
    /// - Example: `"265598".to_string()`
    #[validate(length(min = 1u64))]
    pub conid: String,
    /// Security type of the requested contract of interest. Valid asset classes are:
    ///  * `FOP` - Futures Option
    ///  * `OPT` - Option
    ///  * `WAR` - Warrant
    pub sectype: GetContractStrikesRequestQuerySectype,
    /// Expiration month for the given derivative. Expiration months can be retrieved from /iserver/secdef/search under an {object}/sections/{object}/months
    /// - Example: `"JAN24".to_string()`
    #[validate(length(min = 1u64))]
    pub month: String,
    /// Exchange from which derivatives should be retrieved from. This field is mandatory when requesting Futures Options strikes.
    /// - Example: `Some("CME".to_string())`
    #[default(Some("SMART".to_string()))]
    pub exchange: Option<String>,
}
/// Security type of the requested contract of interest. Valid asset classes are:
///  * `FOP` - Futures Option
///  * `OPT` - Option
///  * `WAR` - Warrant
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetContractStrikesRequestQuerySectype {
    #[serde(rename = "OPT")]
    #[default]
    Opt,
    #[serde(rename = "FOP")]
    Fop,
    #[serde(rename = "WAR")]
    War,
}
impl core::fmt::Display for GetContractStrikesRequestQuerySectype {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Opt => write!(f, "OPT"),
            Self::Fop => write!(f, "FOP"),
            Self::War => write!(f, "WAR"),
        }
    }
}
/// Response types for getContractStrikes
#[derive(Debug, Clone)]
pub enum GetContractStrikesResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(Strike200Response),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a list of contracts based on the search symbol provided as a query param.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractSymbolsFromBodyRequest {
    #[validate(nested)]
    pub body: SearchRequestBody,
}
impl GetContractSymbolsFromBodyRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetContractSymbolsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SecdefSearchResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetContractSymbolsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetContractSymbolsResponse::Unknown);
    }
}
/// Returns a list of contracts based on the search symbol provided as a query param.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetContractSymbolsRequest {
    pub query: GetContractSymbolsRequestQuery,
}
impl GetContractSymbolsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetContractSymbolsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SecdefSearchResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetContractSymbolsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetContractSymbolsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetContractSymbolsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetContractSymbolsRequestQuery {
    /// The ticker symbol, bond issuer type, or company name of the equity you are looking to trade.
    /// - Example: `Some("AAPL".to_string())`
    pub symbol: Option<String>,
    /// Available underlying security types:
    ///   * `STK` - Represents an underlying as a Stock security type.
    ///   * `IND` - Represents an underlying as an Index security type.
    ///   * `BOND` - Represents an underlying as a Bond security type.
    #[serde(rename = "secType")]
    #[default(Some(Default::default()))]
    pub sec_type: Option<GetContractSymbolsRequestQuerySecType>,
    /// Denotes if the symbol value is the ticker symbol or part of the company's name.
    pub name: Option<bool>,
    pub more: Option<bool>,
    /// fund search
    pub fund: Option<bool>,
    #[serde(rename = "fundFamilyConidEx")]
    pub fund_family_conid_ex: Option<String>,
    /// pattern search
    pub pattern: Option<bool>,
    pub referrer: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetContractSymbolsRequestQuerySecType {
    #[serde(rename = "STK")]
    #[default]
    Stk,
    #[serde(rename = "IND")]
    Ind,
    #[serde(rename = "BOND")]
    Bond,
}
impl core::fmt::Display for GetContractSymbolsRequestQuerySecType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Stk => write!(f, "STK"),
            Self::Ind => write!(f, "IND"),
            Self::Bond => write!(f, "BOND"),
        }
    }
}
/// Response types for getContractSymbols
#[derive(Debug, Clone)]
pub enum GetContractSymbolsResponse {
    ///200: An array of objects detailing contract information.
    Ok(SecdefSearchResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Obtains available currency pairs corresponding to the given target currency.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetCurrencyPairsRequest {
    #[validate(nested)]
    pub query: GetCurrencyPairsRequestQuery,
}
impl GetCurrencyPairsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetCurrencyPairsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<CurrencyPairs>::json_with_diagnostics(req).await?;
            return Ok(GetCurrencyPairsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetCurrencyPairsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetCurrencyPairsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetCurrencyPairsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetCurrencyPairsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetCurrencyPairsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetCurrencyPairsRequestQuery {
    /// Specify the target currency you would like to receive official pairs of.
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64))]
    pub currency: String,
}
/// Response types for getCurrencyPairs
#[derive(Debug, Clone)]
pub enum GetCurrencyPairsResponse {
    ///200: Returns a list of valid forex pairs for the given currency. The currency can apply as both the target or base currency.
    Ok(CurrencyPairs),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a list of accounts matching a query pattern set in the request. Broker accounts configured with the DYNACCT property will not receive account information at login. Instead, they must dynamically query then set their account number. Customers without the DYNACCT property will receive a 503 error.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetDynamicAccountsRequest {
    #[validate(nested)]
    pub path: GetDynamicAccountsRequestPath,
}
impl GetDynamicAccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetDynamicAccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<DynAccountSearchResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetDynamicAccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetDynamicAccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetDynamicAccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetDynamicAccountsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetDynamicAccountsRequestPath {
    /// The pattern used to describe credentials to search for. Including part of part of an account ID will return the full value.
    /// - Example: `"U123".to_string()`
    #[validate(length(min = 1u64))]
    pub search_pattern: String,
}
/// Response types for getDynamicAccounts
#[derive(Debug, Clone)]
pub enum GetDynamicAccountsResponse {
    ///200: Returns all accounts that match the searchPattern string.
    Ok(DynAccountSearchResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Obtains the exchange rates of the currency pair.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetExchangeRatesRequest {
    #[validate(nested)]
    pub query: GetExchangeRatesRequestQuery,
}
impl GetExchangeRatesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetExchangeRatesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<RateResponse>::json_with_diagnostics(req).await?;
            return Ok(GetExchangeRatesResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetExchangeRatesResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetExchangeRatesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetExchangeRatesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetExchangeRatesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetExchangeRatesResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetExchangeRatesRequestQuery {
    /// Specify the quote currency to request data for.
    /// - Example: `"EUR".to_string()`
    #[validate(length(min = 1u64))]
    pub target: String,
    /// Specify the base currency to request data for.
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64))]
    pub source: String,
}
/// Response types for getExchangeRates
#[derive(Debug, Clone)]
pub enum GetExchangeRatesResponse {
    ///200: Successful requests return the currency exchange rate of the target currency value divided by the source currency.
    Ok(RateResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the category names, parent ids, and markets for Event Contracts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastCategoriesRequest {}
impl GetForecastCategoriesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetForecastCategoriesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<CategoryTreeResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetForecastCategoriesResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetForecastCategoriesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetForecastCategoriesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetForecastCategoriesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetForecastCategoriesResponse::Unknown);
    }
}
/// Response types for getForecastCategories
#[derive(Debug, Clone)]
pub enum GetForecastCategoriesResponse {
    ///200: Returns a list of category identifiers and name to be used for more granular contract discovery.
    Ok(CategoryTreeResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Provides instrument details for the specific forecast contract.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastContractRequest {
    #[validate(nested)]
    pub query: GetForecastContractRequestQuery,
}
impl GetForecastContractRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetForecastContractResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ForecastDetailsResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetForecastContractResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetForecastContractResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetForecastContractResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetForecastContractResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetForecastContractResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastContractRequestQuery {
    /// Provide the contract identifier to retrieve the information for.
    #[validate(length(min = 1u64))]
    pub conid: String,
}
/// Response types for getForecastContract
#[derive(Debug, Clone)]
pub enum GetForecastContractResponse {
    ///200: Returns the expanded list of the event contract containing both Yes and No side identifier information.
    Ok(ForecastDetailsResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns all high level contract details affiliated with the underlying market conid provided.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastMarketsRequest {
    #[validate(nested)]
    pub query: GetForecastMarketsRequestQuery,
}
impl GetForecastMarketsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetForecastMarketsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ForecastMarketResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetForecastMarketsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetForecastMarketsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetForecastMarketsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetForecastMarketsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetForecastMarketsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastMarketsRequestQuery {
    /// Underlying event index contract identifier.
    #[serde(rename = "underlyingConid")]
    #[validate(length(min = 1u64))]
    pub underlying_conid: String,
    /// Exchange to filter contract by.
    pub exchange: Option<String>,
}
/// Response types for getForecastMarkets
#[derive(Debug, Clone)]
pub enum GetForecastMarketsResponse {
    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
    Ok(ForecastMarketResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Provides trading rules for specific event contracts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastRulesRequest {
    #[validate(nested)]
    pub query: GetForecastRulesRequestQuery,
}
impl GetForecastRulesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetForecastRulesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ForecastRulesResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetForecastRulesResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetForecastRulesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetForecastRulesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetForecastRulesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetForecastRulesResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastRulesRequestQuery {
    /// Provide the contract identifier to retrieve rules for.
    #[validate(length(min = 1u64))]
    pub conid: String,
}
/// Response types for getForecastRules
#[derive(Debug, Clone)]
pub enum GetForecastRulesResponse {
    ///200: Returns the corresponding contracts rules.
    Ok(ForecastRulesResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Provides forecast trading schedules.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastScheduleRequest {
    #[validate(nested)]
    pub query: GetForecastScheduleRequestQuery,
}
impl GetForecastScheduleRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetForecastScheduleResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ForecastSchedulesResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetForecastScheduleResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetForecastScheduleResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetForecastScheduleResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetForecastScheduleResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetForecastScheduleResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetForecastScheduleRequestQuery {
    /// Provide the contract identifier to retrieve the trading schedule for.
    #[validate(length(min = 1u64))]
    pub conid: String,
}
/// Response types for getForecastSchedule
#[derive(Debug, Clone)]
pub enum GetForecastScheduleResponse {
    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
    Ok(ForecastSchedulesResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Provides a summary specific for avilable funds giving more depth than the standard /summary endpoint.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFundSummaryRequest {
    #[validate(nested)]
    pub path: GetFundSummaryRequestPath,
}
impl GetFundSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFundSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AvailableFundsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetFundSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetFundSummaryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetFundSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetFundSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetFundSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetFundSummaryRequestPath {
    /// Pass the account identifier to receive information for.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getFundSummary
#[derive(Debug, Clone)]
pub enum GetFundSummaryResponse {
    ///200: Indicates a successful return of available funds.
    Ok(AvailableFundsResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a list of non-expired future contracts for given symbol(s)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFutureBySymbolRequest {
    #[validate(nested)]
    pub query: GetFutureBySymbolRequestQuery,
}
impl GetFutureBySymbolRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetFutureBySymbolResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Features>::json_with_diagnostics(req).await?;
            return Ok(GetFutureBySymbolResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetFutureBySymbolResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetFutureBySymbolResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetFutureBySymbolResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetFutureBySymbolResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetFutureBySymbolRequestQuery {
    /// Indicate the symbol(s) of the underlier you are trying to retrieve futures on. Accepts comma delimited string of symbols.
    /// - Example: `"ES,MES".to_string()`
    #[validate(length(min = 1u64))]
    pub symbols: String,
    /// Primary listing exchange for the Future.
    /// - Example: `Some("CME".to_string())`
    pub exchange: Option<String>,
}
/// Response types for getFutureBySymbol
#[derive(Debug, Clone)]
pub enum GetFutureBySymbolResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(Features),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Options for sending fyis to email and other devices.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFyiDeliveryRequest {}
impl GetFyiDeliveryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFyiDeliveryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<DeliveryOptions>::json_with_diagnostics(req)
                .await?;
            return Ok(GetFyiDeliveryResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetFyiDeliveryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetFyiDeliveryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetFyiDeliveryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetFyiDeliveryResponse::Unknown);
    }
}
/// Response types for getFyiDelivery
#[derive(Debug, Clone)]
pub enum GetFyiDeliveryResponse {
    ///200: Successfully retrieve preset details
    Ok(DeliveryOptions),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Receive additional disclaimers based on the specified typecode.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFyiDisclaimerssRequest {
    pub path: GetFyiDisclaimerssRequestPath,
}
impl GetFyiDisclaimerssRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetFyiDisclaimerssResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<DisclaimerInfo>::json_with_diagnostics(req).await?;
            return Ok(GetFyiDisclaimerssResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetFyiDisclaimerssResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetFyiDisclaimerssResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetFyiDisclaimerssResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetFyiDisclaimerssResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetFyiDisclaimerssRequestPath {
    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
    ///   * `BA` - Borrow Availability
    ///   * `CA` - Comparable Algo
    ///   * `DA` - Dividends Advisory
    ///   * `EA` - Upcoming Earnings
    ///   * `MF` - Mutual Fund Advisory
    ///   * `OE` - Option Expiration
    ///   * `PR` - Portfolio Builder Rebalance
    ///   * `SE` - Suspend Order on Economic Event
    ///   * `SG` - Short Term Gain turning Long Term
    ///   * `SM` - System Messages
    ///   * `T2` - Assignment Realizing Long-Term Gains
    ///   * `TO` - Takeover
    ///   * `UA` - User Alert
    ///   * `M8` - M871 Trades
    ///   * `PS` - Platform Use Suggestions
    ///   * `DL` - Unexercised Option Loss Prevention Reminder
    ///   * `PT` - Position Transfer
    ///   * `CB` - Missing Cost Basis
    ///   * `MS` - Milestones
    ///   * `TD` - MiFID || 10% Deprecation Notice
    ///   * `ST` - Save Taxes
    ///   * `TI` - Trade Idea
    ///   * `CT` - Cash Transfer
    pub typecode: Typecodes,
}
/// Response types for getFyiDisclaimerss
#[derive(Debug, Clone)]
pub enum GetFyiDisclaimerssResponse {
    ///200: Successfully disclaimer details
    Ok(DisclaimerInfo),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Return the current choices of subscriptions for notifications.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetFyiSettingsRequest {}
impl GetFyiSettingsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetFyiSettingsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<FyiSettings>::json_with_diagnostics(req).await?;
            return Ok(GetFyiSettingsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetFyiSettingsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetFyiSettingsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetFyiSettingsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetFyiSettingsResponse::Unknown);
    }
}
/// Response types for getFyiSettings
#[derive(Debug, Clone)]
pub enum GetFyiSettingsResponse {
    ///200: Indicates data is being returned successfully.
    Ok(FyiSettings),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidDetailsRequest {
    #[validate(nested)]
    pub path: GetGwApiV1AccountsAccountidDetailsRequestPath,
}
impl GetGwApiV1AccountsAccountidDetailsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsAccountidDetailsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountDetailsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidDetailsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsAccountidDetailsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidDetailsRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for get_gw_api_v1_accounts_accountid_details
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsAccountidDetailsResponse {
    ///200: View information associated with account including contact data, financial information and trading configuration.
    Ok(AccountDetailsResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Generate URL address to complete real-time KYC verification using Au10Tix<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidKycRequest {
    #[validate(nested)]
    pub path: GetGwApiV1AccountsAccountidKycRequestPath,
}
impl GetGwApiV1AccountsAccountidKycRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsAccountidKycResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Au10TixDetailResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidKycResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsAccountidKycResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidKycRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for get_gw_api_v1_accounts_accountid_kyc
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsAccountidKycResponse {
    ///200: Generate URL address to complete real-time KYC verification using Au10Tix
    Ok(Au10TixDetailResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Query login messages assigned by accountId<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidLoginMessagesRequest {
    #[validate(nested)]
    pub path: GetGwApiV1AccountsAccountidLoginMessagesRequestPath,
    pub query: GetGwApiV1AccountsAccountidLoginMessagesRequestQuery,
}
impl GetGwApiV1AccountsAccountidLoginMessagesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsLoginMessagesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<LoginMessageResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidLoginMessagesRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidLoginMessagesRequestQuery {
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
/// Query status of account by accountId<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidStatusRequest {
    #[validate(nested)]
    pub path: GetGwApiV1AccountsAccountidStatusRequestPath,
}
impl GetGwApiV1AccountsAccountidStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsAccountidStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountStatusResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidStatusRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for get_gw_api_v1_accounts_accountid_status
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsAccountidStatusResponse {
    ///200: Query status of account by accountId.
    Ok(AccountStatusResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Query registration tasks assigned to account and pending tasks that are required for account approval<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidTasksRequest {
    #[validate(nested)]
    pub path: GetGwApiV1AccountsAccountidTasksRequestPath,
    pub query: GetGwApiV1AccountsAccountidTasksRequestQuery,
}
impl GetGwApiV1AccountsAccountidTasksRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsAccountidTasksResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Task200Response>::json_with_diagnostics(req)
                .await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidTasksResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsAccountidTasksResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidTasksRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsAccountidTasksRequestQuery {
    #[serde(rename = "type")]
    #[default(Some(Default::default()))]
    pub r#type: Option<GetGwApiV1AccountsAccountidTasksRequestQueryType>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetGwApiV1AccountsAccountidTasksRequestQueryType {
    #[serde(rename = "pending")]
    #[default]
    Pending,
    #[serde(rename = "registration")]
    Registration,
}
impl core::fmt::Display for GetGwApiV1AccountsAccountidTasksRequestQueryType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Pending => write!(f, "pending"),
            Self::Registration => write!(f, "registration"),
        }
    }
}
/// Response types for get_gw_api_v1_accounts_accountid_tasks
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsAccountidTasksResponse {
    ///200: Query registration tasks assigned to account and pending tasks that are required for account approval
    Ok(Task200Response),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Query all accounts associated with ‘Client ID’ that have incomplete login message<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsLoginMessagesRequest {
    pub query: GetGwApiV1AccountsLoginMessagesRequestQuery,
}
impl GetGwApiV1AccountsLoginMessagesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsLoginMessagesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<LoginMessageResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsLoginMessagesResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsLoginMessagesResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsLoginMessagesRequestQuery {
    #[serde(rename = "loginMessageRequest")]
    pub login_message_request: serde_json::Value,
}
/// Response types for get_gw_api_v1_accounts_login_messages
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsLoginMessagesResponse {
    ///200: Query all accounts associated with ‘Client ID’ that have incomplete login message
    Ok(LoginMessageResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Retrieve the application request and IBKR response data based on IBKR accountId or externalId. Only available for accounts that originate via API<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsRequest {
    pub query: GetGwApiV1AccountsRequestQuery,
}
impl GetGwApiV1AccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Account200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsRequestQuery {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "externalId")]
    pub external_id: Option<String>,
}
/// Response types for get_gw_api_v1_accounts
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsResponse {
    ///200: Retrieve the application request and IBKR response data based on IBKR accountId or externalId. Only available for accounts that originate via API
    Ok(Account200Response),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Query status of all accounts associated with ‘Client ID'<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsStatusRequest {
    pub query: GetGwApiV1AccountsStatusRequestQuery,
}
impl GetGwApiV1AccountsStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountStatusBulkResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetGwApiV1AccountsStatusResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsStatusResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsStatusResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsStatusResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsStatusResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsStatusResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsStatusResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1AccountsStatusRequestQuery {
    #[serde(rename = "accountStatusRequest")]
    pub account_status_request: serde_json::Value,
}
/// Response types for get_gw_api_v1_accounts_status
#[derive(Debug, Clone)]
pub enum GetGwApiV1AccountsStatusResponse {
    ///200: Query status of all accounts associated with ‘Client ID'
    Ok(AccountStatusBulkResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Retrieve status of request by clientInstructionId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1ClientInstructionsClientinstructionidRequest {
    pub path: GetGwApiV1ClientInstructionsClientinstructionidRequestPath,
    pub query: GetGwApiV1ClientInstructionsClientinstructionidRequestQuery,
}
impl GetGwApiV1ClientInstructionsClientinstructionidRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1InstructionsInstructionidResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Instruction200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::Ok(data));
        }
        if status == http::StatusCode::NOT_FOUND {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::NotFound);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1InstructionsInstructionidResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetGwApiV1ClientInstructionsClientinstructionidRequestPath {
    /// The target instruction id.
    /// - Example: `-1_988_905_739i32`
    pub client_instruction_id: i32,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1ClientInstructionsClientinstructionidRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `echo.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1EchoHttpsRequest {}
impl GetGwApiV1EchoHttpsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1EchoHttpsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<EchoResponse>::json_with_diagnostics(req).await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1EchoHttpsResponse::Unknown);
    }
}
/// Response types for get_gw_api_v1_echo_https
#[derive(Debug, Clone)]
pub enum GetGwApiV1EchoHttpsResponse {
    ///200: Returns a JSON object containing the request parameters.
    Ok(EchoResponse),
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Get list of brokers supported for given asset transfer type<br><br>**Scope**: `enumerations.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1EnumerationsComplexAssetTransferRequest {
    #[validate(nested)]
    pub query: GetGwApiV1EnumerationsComplexAssetTransferRequestQuery,
}
impl GetGwApiV1EnumerationsComplexAssetTransferRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1EnumerationsComplexAssetTransferResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<GetBrokerListResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1EnumerationsComplexAssetTransferResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1EnumerationsComplexAssetTransferRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
    /// Asset transfer type to get the list of supported brokers
    #[serde(rename = "instructionType")]
    #[validate(length(min = 1u64))]
    pub instruction_type: String,
}
/// Response types for get_gw_api_v1_enumerations_complex_asset_transfer
#[derive(Debug, Clone)]
pub enum GetGwApiV1EnumerationsComplexAssetTransferResponse {
    ///200: Returns list of brokers supported for given asset type
    Ok(GetBrokerListResponse),
    ///400: Returns a Problem detail instance representing a not found request.
    BadRequest,
    ///500: Unable to process request due to an Internal Error. Please try again later.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Used to query list of enumerations for attributes included within extPositionsTransfers, occupation, employerBusiness, financialInformation, affiliationDetails, tradingPermissions, etc.<br><br>**Scope**: `accounts.read` OR `enumerations.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1EnumerationsEnumerationtypeRequest {
    #[validate(nested)]
    pub path: GetGwApiV1EnumerationsEnumerationtypeRequestPath,
    pub query: GetGwApiV1EnumerationsEnumerationtypeRequestQuery,
}
impl GetGwApiV1EnumerationsEnumerationtypeRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1EnumerationsEnumerationtypeResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<EnumerationResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1EnumerationsEnumerationtypeResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1EnumerationsEnumerationtypeRequestPath {
    #[validate(length(min = 1u64))]
    pub enumeration_type: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1EnumerationsEnumerationtypeRequestQuery {
    /// <ul><li>exchange-bundles - query most up to date list of exchange-bundles for tradingPermissions</li><li>business-and-occupation - list of occupation and employerBusiness for employmentDetails</li><li>employee-track - query most up to date companyId for account. For affiliation details, if company has an existing IBKR Employee Track account</li><li>fin-info-ranges - query most up to date range IDs by currency for annualNetIncome, netWorth, liquidNetWorth</li><li>acats - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>aton - query most up to date values for brokerId and brokerName. Used if funding via US ACATS extPositionsTransfers</li><li>market-data - query most up to date values for brokerId and brokerName. Used if funding via ATON Canada extPositionsTransfers</li><li>edd-avt - query questions associated with EDD (Enhanced Due Diligence) or AVT (Additional Verification) tasks assigned to an account</li><li>prohibited-country - view list of prohibited countries. Applicants that reside in prohibited country are restricted from opening an account with IBKR. Error will be thrown IF legalResidenceCountry, OR country (included within Residence, mailingAddress and employerAddress, taxResidency node) is a prohibited country</li><li>employee-plans - view EPA that are linked to master account (applicable IF offering SEP IRA accounts)</li><li>questionnaires - obtain list of questionnaires</li><li>security-questions - obtain list of questions supported for IBKR security questions</li><li>quiz-questions - obtain list of questions associated with IBKR knowledge assessment</li><li>wire-instructions - obtain list of wire instructions</li><li>product-country-bundles - obtain list of product country bundles</li></ul>
    #[serde(rename = "type")]
    pub r#type: Option<EnumerationType>,
    pub currency: Option<String>,
    #[serde(rename = "ibEntity")]
    pub ib_entity: Option<String>,
    #[serde(rename = "mdStatusNonPro")]
    pub md_status_non_pro: Option<String>,
    #[serde(rename = "form-number")]
    pub form_number: Option<String>,
    pub language: Option<GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage>,
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "userName")]
    pub user_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage {
    #[serde(rename = "en")]
    #[default]
    En,
    #[serde(rename = "ar")]
    Ar,
    #[serde(rename = "de")]
    De,
    #[serde(rename = "es")]
    Es,
    #[serde(rename = "fr")]
    Fr,
    #[serde(rename = "he")]
    He,
    #[serde(rename = "hu")]
    Hu,
    #[serde(rename = "it")]
    It,
    #[serde(rename = "ja")]
    Ja,
    #[serde(rename = "nl")]
    Nl,
    #[serde(rename = "pt")]
    Pt,
    #[serde(rename = "ru")]
    Ru,
    #[serde(rename = "zh_CN")]
    ZhCn,
    #[serde(rename = "zh_TW")]
    ZhTw,
}
impl core::fmt::Display for GetGwApiV1EnumerationsEnumerationtypeRequestQueryLanguage {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::En => write!(f, "en"),
            Self::Ar => write!(f, "ar"),
            Self::De => write!(f, "de"),
            Self::Es => write!(f, "es"),
            Self::Fr => write!(f, "fr"),
            Self::He => write!(f, "he"),
            Self::Hu => write!(f, "hu"),
            Self::It => write!(f, "it"),
            Self::Ja => write!(f, "ja"),
            Self::Nl => write!(f, "nl"),
            Self::Pt => write!(f, "pt"),
            Self::Ru => write!(f, "ru"),
            Self::ZhCn => write!(f, "zh_CN"),
            Self::ZhTw => write!(f, "zh_TW"),
        }
    }
}
/// Response types for get_gw_api_v1_enumerations_enumerationtype
#[derive(Debug, Clone)]
pub enum GetGwApiV1EnumerationsEnumerationtypeResponse {
    ///200: Get enumerations
    Ok(EnumerationResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Get forms<br><br>**Scope**: `accounts.read` OR `forms.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1FormsRequest {
    pub query: GetGwApiV1FormsRequestQuery,
}
impl GetGwApiV1FormsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetGwApiV1FormsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<FormFileResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1FormsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1FormsResponse::Unknown);
    }
}
#[serde_with::serde_as]
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1FormsRequestQuery {
    #[serde_as(as = "Option<oas3_gen_support::StringWithCommaSeparator>")]
    #[serde(rename = "formNo")]
    pub form_no: Option<Vec<String>>,
    #[serde(rename = "getDocs")]
    pub get_docs: Option<String>,
    #[serde(rename = "fromDate")]
    pub from_date: Option<String>,
    #[serde(rename = "toDate")]
    pub to_date: Option<String>,
    pub language: Option<String>,
    #[default(Some(Default::default()))]
    pub projection: Option<GetGwApiV1FormsRequestQueryProjection>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetGwApiV1FormsRequestQueryProjection {
    #[serde(rename = "PAYLOAD")]
    #[default]
    Payload,
    #[serde(rename = "DOCS")]
    Docs,
    #[serde(rename = "NONE")]
    None,
}
impl core::fmt::Display for GetGwApiV1FormsRequestQueryProjection {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Payload => write!(f, "PAYLOAD"),
            Self::Docs => write!(f, "DOCS"),
            Self::None => write!(f, "NONE"),
        }
    }
}
/// Get required forms<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1FormsRequiredFormsRequest {
    pub query: GetGwApiV1FormsRequiredFormsRequestQuery,
}
impl GetGwApiV1FormsRequiredFormsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1FormsRequiredFormsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<RequiredFormsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1FormsRequiredFormsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1FormsRequiredFormsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1FormsRequiredFormsRequestQuery {
    #[serde(rename = "requiredFormsRequest")]
    pub required_forms_request: serde_json::Value,
}
/// Response types for get_gw_api_v1_forms_required_forms
#[derive(Debug, Clone)]
pub enum GetGwApiV1FormsRequiredFormsResponse {
    ///200: Get required forms
    Ok(RequiredFormsResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Response types for get_gw_api_v1_forms
#[derive(Debug, Clone)]
pub enum GetGwApiV1FormsResponse {
    ///200: Get forms
    Ok(FormFileResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Retrieve status of all requests associated with instructionSetId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionSetsInstructionsetidRequest {
    pub path: GetGwApiV1InstructionSetsInstructionsetidRequestPath,
    pub query: GetGwApiV1InstructionSetsInstructionsetidRequestQuery,
}
impl GetGwApiV1InstructionSetsInstructionsetidRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1InstructionSetsInstructionsetidResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<BulkMultiStatusResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::Ok(data));
        }
        if status == http::StatusCode::NOT_FOUND {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::NotFound);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1InstructionSetsInstructionsetidResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionSetsInstructionsetidRequestPath {
    /// The target instruction set id.
    /// - Example: `-1_988_905_739i32`
    pub instruction_set_id: i32,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionSetsInstructionsetidRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for get_gw_api_v1_instruction_sets_instructionsetid
#[derive(Debug, Clone)]
pub enum GetGwApiV1InstructionSetsInstructionsetidResponse {
    ///200: Returns the status multiple instructions.
    Ok(BulkMultiStatusResponse),
    ///404: Returns a Problem detail instance representing a not found request.
    NotFound,
    ///500: Unable to process request due to an Internal Error. Please try again later.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Retrieve status of request by instructionId<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionsInstructionidRequest {
    pub path: GetGwApiV1InstructionsInstructionidRequestPath,
    pub query: GetGwApiV1InstructionsInstructionidRequestQuery,
}
impl GetGwApiV1InstructionsInstructionidRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1InstructionsInstructionidResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Instruction200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::Ok(data));
        }
        if status == http::StatusCode::NOT_FOUND {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::NotFound);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1InstructionsInstructionidResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1InstructionsInstructionidResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionsInstructionidRequestPath {
    /// The target instruction id.
    /// - Example: `-1_988_905_739i32`
    pub instruction_id: i32,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1InstructionsInstructionidRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for get_gw_api_v1_instructions_instructionid
#[derive(Debug, Clone)]
pub enum GetGwApiV1InstructionsInstructionidResponse {
    ///200: Returns the status of an instruction.
    Ok(Instruction200Response),
    ///404: Returns a Problem detail instance representing a not found request.
    NotFound,
    ///500: Unable to process request due to an Internal Error. Please try again later.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Get list of banks which support banking connection with Interactive Brokers.<br><br>**Scope**: `enumerations.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1ParticipatingBanksRequest {
    #[validate(nested)]
    pub query: GetGwApiV1ParticipatingBanksRequestQuery,
}
impl GetGwApiV1ParticipatingBanksRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1ParticipatingBanksResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                GetParticipatingListResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetGwApiV1ParticipatingBanksResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ParticipatingBanksResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ParticipatingBanksResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1ParticipatingBanksResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1ParticipatingBanksRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
    /// Parameter for which the list of participating banks is fetched
    #[serde(rename = "type")]
    #[validate(length(min = 1u64))]
    pub r#type: String,
}
/// Response types for get_gw_api_v1_participating_banks
#[derive(Debug, Clone)]
pub enum GetGwApiV1ParticipatingBanksResponse {
    ///200: Returns the list of participating banks.
    Ok(GetParticipatingListResponse),
    ///400: Returns a Problem detail instance representing a not found request.
    BadRequest,
    ///500: Unable to process request due to an Internal Error. Please try again later.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Fetch Requests' Details By Timeframe<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1RequestsRequest {
    pub query: GetGwApiV1RequestsRequestQuery,
}
impl GetGwApiV1RequestsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1RequestsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<RequestDetailsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1RequestsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1RequestsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1RequestsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1RequestsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1RequestsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1RequestsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1RequestsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetGwApiV1RequestsRequestQuery {
    #[serde(rename = "requestDetails")]
    pub request_details: serde_json::Value,
}
/// Response types for get_gw_api_v1_requests
#[derive(Debug, Clone)]
pub enum GetGwApiV1RequestsResponse {
    ///200: Fetch Requests' Details By Timeframe
    Ok(RequestDetailsResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1StatementsAvailableRequest {
    #[validate(nested)]
    pub query: GetGwApiV1StatementsAvailableRequestQuery,
    #[validate(nested)]
    pub header: GetGwApiV1StatementsAvailableRequestHeader,
}
impl GetGwApiV1StatementsAvailableRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1StatementsAvailableResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                GetAvailableStmtDatesResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1StatementsAvailableResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1StatementsAvailableResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1StatementsAvailableRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&GetGwApiV1StatementsAvailableRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &GetGwApiV1StatementsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<GetGwApiV1StatementsAvailableRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: GetGwApiV1StatementsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1StatementsAvailableRequestQuery {
    /// Specifies the account id to retrieve information
    /// - Example: `"UXXXX".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for get_gw_api_v1_statements_available
#[derive(Debug, Clone)]
pub enum GetGwApiV1StatementsAvailableResponse {
    ///200: Returns a JSON object containing the available report dates.
    Ok(GetAvailableStmtDatesResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TaxDocumentsAvailableRequest {
    #[validate(nested)]
    pub query: GetGwApiV1TaxDocumentsAvailableRequestQuery,
    #[validate(nested)]
    pub header: GetGwApiV1TaxDocumentsAvailableRequestHeader,
}
impl GetGwApiV1TaxDocumentsAvailableRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1TaxDocumentsAvailableResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                GetAvailableTaxFormsResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TaxDocumentsAvailableResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1TaxDocumentsAvailableResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TaxDocumentsAvailableRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&GetGwApiV1TaxDocumentsAvailableRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &GetGwApiV1TaxDocumentsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<GetGwApiV1TaxDocumentsAvailableRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: GetGwApiV1TaxDocumentsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TaxDocumentsAvailableRequestQuery {
    /// Specifies the account id to retrieve information
    /// - Example: `"UXXXX".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// Specifies the tax year to retrieve information
    /// - Example: `2_024i32`
    pub year: i32,
}
/// Response types for get_gw_api_v1_tax_documents_available
#[derive(Debug, Clone)]
pub enum GetGwApiV1TaxDocumentsAvailableResponse {
    ///200: Returns a JSON object containing the available report dates.
    Ok(GetAvailableTaxFormsResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.read` OR `reports.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TradeConfirmationsAvailableRequest {
    #[validate(nested)]
    pub query: GetGwApiV1TradeConfirmationsAvailableRequestQuery,
    #[validate(nested)]
    pub header: GetGwApiV1TradeConfirmationsAvailableRequestHeader,
}
impl GetGwApiV1TradeConfirmationsAvailableRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1TradeConfirmationsAvailableResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                GetAvailableTradeConfirmationDatesResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1TradeConfirmationsAvailableResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TradeConfirmationsAvailableRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&GetGwApiV1TradeConfirmationsAvailableRequestHeader>
    for http::HeaderMap
{
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &GetGwApiV1TradeConfirmationsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<GetGwApiV1TradeConfirmationsAvailableRequestHeader>
    for http::HeaderMap
{
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: GetGwApiV1TradeConfirmationsAvailableRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1TradeConfirmationsAvailableRequestQuery {
    /// Specifies the account id to retrieve information
    /// - Example: `"UXXXX".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for get_gw_api_v1_trade_confirmations_available
#[derive(Debug, Clone)]
pub enum GetGwApiV1TradeConfirmationsAvailableResponse {
    ///200: Returns a JSON object containing the available user-traded dates.
    Ok(GetAvailableTradeConfirmationDatesResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Verify whether user is valid and available<br><br>**Scope**: `accounts.read` OR `validations.read`<br>**Security Policy**: `HTTPS`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1ValidationsUsernamesUsernameRequest {
    #[validate(nested)]
    pub path: GetGwApiV1ValidationsUsernamesUsernameRequestPath,
}
impl GetGwApiV1ValidationsUsernamesUsernameRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1ValidationsUsernamesUsernameResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<UserNameAvailableResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1ValidationsUsernamesUsernameResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetGwApiV1ValidationsUsernamesUsernameRequestPath {
    #[validate(length(min = 1u64))]
    pub username: String,
}
/// Response types for get_gw_api_v1_validations_usernames_username
#[derive(Debug, Clone)]
pub enum GetGwApiV1ValidationsUsernamesUsernameResponse {
    ///200: Verify whether user is valid and available
    Ok(UserNameAvailableResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Requests full contract details and trading rules for the given conid. A follow-up request will provide additional trading rules.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetInfoAndRulesRequest {
    #[validate(nested)]
    pub path: GetInfoAndRulesRequestPath,
}
impl GetInfoAndRulesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetInfoAndRulesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Rule200Response>::json_with_diagnostics(req)
                .await?;
            return Ok(GetInfoAndRulesResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetInfoAndRulesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetInfoAndRulesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetInfoAndRulesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetInfoAndRulesResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetInfoAndRulesRequestPath {
    /// Contract identifier for the requested contract of interest.
    /// - Example: `"265598".to_string()`
    #[validate(length(min = 1u64))]
    pub conid: String,
}
/// Response types for getInfoAndRules
#[derive(Debug, Clone)]
pub enum GetInfoAndRulesResponse {
    ///200: Returns all contract information and trading rules for the contract.
    Ok(Rule200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a list of security definitions for the given conids.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetInstrumentDefinitionRequest {
    #[validate(nested)]
    pub query: GetInstrumentDefinitionRequestQuery,
}
impl GetInstrumentDefinitionRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetInstrumentDefinitionResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TrsrvSecDefResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetInstrumentDefinitionResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentDefinitionResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentDefinitionResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentDefinitionResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentDefinitionResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetInstrumentDefinitionResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetInstrumentDefinitionRequestQuery {
    /// A comma separated series of contract IDs.
    /// - Example: `"265598,8314".to_string()`
    #[validate(length(min = 1u64))]
    pub conids: String,
}
/// Response types for getInstrumentDefinition
#[derive(Debug, Clone)]
pub enum GetInstrumentDefinitionResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(TrsrvSecDefResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Requests full contract details for the given conid.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetInstrumentInfoRequest {
    #[validate(nested)]
    pub path: GetInstrumentInfoRequestPath,
}
impl GetInstrumentInfoRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetInstrumentInfoResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ContractInfo>::json_with_diagnostics(req).await?;
            return Ok(GetInstrumentInfoResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentInfoResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentInfoResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetInstrumentInfoResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetInstrumentInfoResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetInstrumentInfoRequestPath {
    /// Contract identifier for the requested contract of interest.
    /// - Example: `"265598".to_string()`
    #[validate(length(min = 1u64))]
    pub conid: String,
}
/// Response types for getInstrumentInfo
#[derive(Debug, Clone)]
pub enum GetInstrumentInfoResponse {
    ///200: Returns detailed information for the passed contract.
    Ok(ContractInfo),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request the list of all accounts already invested in the provided model and a summary of their investment.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetInvestedAccountsInModelRequest {
    pub body: PositionRequestBody,
}
impl GetInvestedAccountsInModelRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetInvestedAccountsInModelResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<GetInvestedAccountsSummary>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetInvestedAccountsInModelResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetInvestedAccountsInModelResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetInvestedAccountsInModelResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetInvestedAccountsInModelResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetInvestedAccountsInModelResponse::Unknown);
    }
}
/// Response types for getInvestedAccountsInModel
#[derive(Debug, Clone)]
pub enum GetInvestedAccountsInModelResponse {
    ///200: Successfully retrieve preset details
    Ok(GetInvestedAccountsSummary),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetInvestedAccountsSummary {
    /// Array of account details with net liquidation values and currency information
    #[serde(rename = "accountList")]
    pub account_list: Option<Vec<GetInvestedAccountsSummaryAccountList>>,
    /// Base currency for the master account (ISO 4217 currency code)
    #[serde(rename = "baseCcyMaster")]
    pub base_ccy_master: Option<String>,
    /// Precision for the master account base currency (decimal places)
    #[serde(rename = "baseCcyMasterPrecision")]
    pub base_ccy_master_precision: Option<String>,
    /// Model portfolio identifier associated with this account list
    pub model: Option<String>,
    /// Unique request identifier for tracking API calls
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Market data subscription status (1 = active, 0 = inactive)
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<AlertActivationRequestAlertActive>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetInvestedAccountsSummaryAccountList {
    /// Account identifier (account number)
    pub account: Option<String>,
    /// Net liquidation value for positions in the current model portfolio
    #[serde(rename = "accountModelNlv")]
    pub account_model_nlv: Option<String>,
    /// Net liquidation value for positions in other model portfolios
    #[serde(rename = "accountOtherModelsNlv")]
    pub account_other_models_nlv: Option<String>,
    /// User-defined alias for the account (empty string if not set)
    pub alias: Option<String>,
    /// Base currency for this account (ISO 4217 currency code)
    #[serde(rename = "baseCcyAccount")]
    pub base_ccy_account: Option<String>,
    /// Precision for the account base currency (decimal places)
    #[serde(rename = "baseCcyAccountPrecision")]
    pub base_ccy_account_precision: Option<String>,
    /// Individual cash net liquidation value in base currency
    #[serde(rename = "cashInIndependentNlv")]
    pub cash_in_independent_nlv: Option<String>,
    /// Exchange rate from account base currency to master base currency
    #[serde(rename = "exchangeRate")]
    pub exchange_rate: Option<f64>,
    /// Total net liquidation value (cash + positions) in base currency
    pub nlv: Option<String>,
    /// Individual position net liquidation value in base currency
    #[serde(rename = "positionsInIndependentNlv")]
    pub positions_in_independent_nlv: Option<String>,
}
/// Used in tiered account structures (such as Financial Advisor and IBroker Accounts) to return a list of sub-accounts, paginated up to 20 accounts per page, for which the user can view position and account-related information.  This endpoint must be called prior to calling other /portfolio endpoints for those sub-accounts. If you have less than 100 sub-accounts use /portfolio/subaccounts.  To query a list of accounts the user can trade, see /iserver/accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetManySubaccountsRequest {
    pub query: GetManySubaccountsRequestQuery,
}
impl GetManySubaccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetManySubaccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Subaccounts2Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetManySubaccountsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetManySubaccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetManySubaccountsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetManySubaccountsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetManySubaccountsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetManySubaccountsRequestQuery {
    /// accountId
    /// - Example: `Some("DU123456".to_string())`
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    /// Set if request should be made without caching.
    #[default(Some(false))]
    pub nocache: Option<bool>,
}
/// Response types for getManySubaccounts
#[derive(Debug, Clone)]
pub enum GetManySubaccountsResponse {
    ///200: response with subaccount definitions
    Ok(Subaccounts2Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a summary of an account's margin, in total and by account segment.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetMarginSummaryRequest {
    #[validate(nested)]
    pub path: GetMarginSummaryRequestPath,
}
impl GetMarginSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetMarginSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                SummaryOfAccountMarginResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetMarginSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetMarginSummaryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetMarginSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetMarginSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetMarginSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetMarginSummaryRequestPath {
    /// Pass the account identifier to receive information for.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getMarginSummary
#[derive(Debug, Clone)]
pub enum GetMarginSummaryResponse {
    ///200: Indicates a success request to receive margin balance values.
    Ok(SummaryOfAccountMarginResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request historical data for an instrument in the form of OHLC bars.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetMdHistoryRequest {
    #[validate(nested)]
    pub query: GetMdHistoryRequestQuery,
}
impl GetMdHistoryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMdHistoryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<History200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetMdHistoryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetMdHistoryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetMdHistoryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetMdHistoryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetMdHistoryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetMdHistoryResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetMdHistoryRequestQuery {
    /// IB contract ID of the requested instrument.
    /// - Example: `265_598i32`
    pub conid: i32,
    /// A time duration away from startTime into the future to be divided into bars of the specified width. Supported Period Sizes
    ///   * `min` - Minutes
    ///   * `h` - Hour(s)
    ///   * `d` - Day(s)
    ///   * `w` - Week(s)
    ///   * `m` - Month(s)
    ///   * `y` - Year(s)
    /// - Example: `"6d".to_string()`
    #[validate(length(min = 1u64))]
    #[default("1d".to_string())]
    pub period: String,
    /// The width of the bars into which the interval determined by period and startTime will be divided. It is not required that bar evenly divide period; partial bars can be returned. Supported Bar Sizes
    ///   * `S` - Second(s)
    ///   * `min` - Minute(s)
    ///   * `h` - Hour(s)
    ///   * `d` - Day(s)
    ///   * `w` - Week(s)
    ///   * `m` - Month(s)
    /// - Example: `"5min".to_string()`
    #[validate(length(min = 1u64))]
    #[default("1min".to_string())]
    pub bar: String,
    /// Exchange (or SMART) from which data is requested.
    /// - Example: `Some("NASDAQ".to_string())`
    pub exchange: Option<String>,
    /// Indicates whether data outside of regular trading hours should be included in response.
    #[serde(rename = "outsideRth")]
    #[default(Some(false))]
    pub outside_rth: Option<bool>,
    /// A fixed UTC date-time reference point for the historical data request, from which the specified period extends. Format is YYYYMMDD-hh:mm:ss. If omitted, the current time is used, and direction must be omitted or 1.
    /// - Example: `Some("20231018-16:00:00".to_string())`
    #[serde(rename = "startTime")]
    pub start_time: Option<String>,
    /// Indicates whether data should begin or end at the start time.
    ///   * `-1` - Historical data will begin away from the start time, ending at the current time/startTime.
    ///   * `1` - Historical data begins at the start time, moving towards the current time. Only supported when startTime is included.
    #[default(Some(Default::default()))]
    pub direction: Option<GetMdHistoryRequestQueryDirection>,
    /// The type of data to be returned in the historical bars. Supported Bar Sizes
    ///   * `Bid_Ask` - The OHLC bid/ask values.
    ///   * `Last` - The OHLC trade values.
    ///   * `Midpoint` - The OHLC of the Bid-Ask midpoint.
    /// - Example: `Some("Midpoint".to_string())`
    #[default(Some("Last".to_string()))]
    pub source: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetMdHistoryRequestQueryDirection {
    #[serde(rename = "-1")]
    #[default]
    Value_1,
    #[serde(rename = "1")]
    Value1,
}
impl core::fmt::Display for GetMdHistoryRequestQueryDirection {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Value_1 => write!(f, "-1"),
            Self::Value1 => write!(f, "1"),
        }
    }
}
/// Response types for getMdHistory
#[derive(Debug, Clone)]
pub enum GetMdHistoryResponse {
    ///200: Historical data query successfully returned data.
    Ok(History200Response),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get Market Data for the given conid(s). A pre-flight request must be made prior to ever receiving data. For some fields, it may take more than a few moments to receive information. See response fields for a list of available fields that can be request via fields argument. The endpoint /iserver/accounts must be called prior to /iserver/marketdata/snapshot. For derivative contracts the endpoint /iserver/secdef/search must be called first.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetMdSnapshotRequest {
    pub query: GetMdSnapshotRequestQuery,
}
impl GetMdSnapshotRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMdSnapshotResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<IserverSnapshot>::json_with_diagnostics(req)
                .await?;
            return Ok(GetMdSnapshotResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetMdSnapshotResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetMdSnapshotResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetMdSnapshotResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetMdSnapshotResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetMdSnapshotResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetMdSnapshotRequestQuery {
    /// Contract identifier for the contract of interest. May provide a comma-separated series of contract identifiers.
    /// - Example: `265_598i32`
    pub conids: i32,
    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
    ///   * `31` - Last Price. The last price at which the contract traded. May contain one of the following prefixes: C - Previous day's closing price. H - Trading has halted.
    ///   * `55` - Symbol.
    ///   * `58` - Text.
    ///   * `70` - High. Current day high price
    ///   * `71` - Low. Current day low price
    ///   * `73` - Market Value. The current market value of your position in the security. Market Value is calculated with real time market data (even when not subscribed to market data).
    ///   * `74` - Avg Price. The average price of the position.
    ///   * `75` - Unrealized PnL. Unrealized profit or loss. Unrealized PnL is calculated with real time market data (even when not subscribed to market data).
    ///   * `76` - Formatted position.
    ///   * `77` - Formatted Unrealized PnL.
    ///   * `78` - Daily PnL. Your profit or loss of the day since prior close. Daily PnL is calculated with real time market data (even when not subscribed to market data).
    ///   * `79` - Realized PnL. Realized profit or loss. Realized PnL is calculated with real time market data (even when not subscribed to market data).
    ///   * `80` - Unrealized PnL %. Unrealized profit or loss expressed in percentage.
    ///   * `82` - Change. The difference between the last price and the close on the previous trading day
    ///   * `83` - Change %. The difference between the last price and the close on the previous trading day in percentage.
    ///   * `84` - Bid Price. The highest-priced bid on the contract.
    ///   * `85` - Ask Size. The number of contracts or shares offered at the ask price. For US stocks
    ///   * `86` - Ask Price. The lowest-priced offer on the contract.
    ///   * `87` - Volume. Volume for the day
    ///   * `88` - Bid Size. The number of contracts or shares bid for at the bid price. For US stocks
    ///   * `201` - Right. Declares the Right of the Option, Call or Put.
    ///   * `6004` - Exchange.
    ///   * `6008` - Conid. Contract identifier from IBKR's database.
    ///   * `6070` - SecType. The asset class of the instrument.
    ///   * `6072` - Months.
    ///   * `6073` - Regular Expiry.
    ///   * `6119` - Marker for market data delivery method (similar to request id).
    ///   * `6457` - Underlying Conid. Use /trsrv/secdef to get more information about the security.
    ///   * `6508` - Service Params..
    ///   * `6509` - Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed, i - incomplete, v - VDR Exempt (Vendor Display Rule 603c). Second char defines: P = Snapshot, p = Consolidated. Third char defines: B = Book. RealTime Data is relayed back in real time without delay, market data subscription(s) are required. Delayed - Data is relayed back 15-20 min delayed. Frozen - Last recorded data at market close.  relayed back in real time. Frozen Delayed - Last recorded data at market close, relayed back delayed. Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data. Snapshot - Snapshot request is available for contract. Consolidated - Market data is aggregated across multiple exchanges or venues. Book - Top of the book data is available for contract.
    ///   * `7051` - Company name.
    ///   * `7057` - Ask Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
    ///   * `7058` - Last Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
    ///   * `7059` - Last Size. The number of unites traded at the last price
    ///   * `7068` - Bid Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
    ///   * `7084` - Implied Vol./Hist. Vol %. The ratio of the implied volatility over the historical volatility, expressed as a percentage.
    ///   * `7085` - Put/Call Interest. Put option open interest/call option open interest for the trading day.
    ///   * `7086` - Put/Call Volume. Put option volume/call option volume for the trading day.
    ///   * `7087` - Hist. Vol. %. 30-day real-time historical volatility.
    ///   * `7088` - Hist. Vol. Close %. Shows the historical volatility based on previous close price.
    ///   * `7089` - Opt. Volume. Option Volume
    ///   * `7094` - Conid + Exchange.
    ///   * `7184` - canBeTraded. If contract is a trade-able instrument. Returns 1(true) or 0(false).
    ///   * `7219` - Contract Description.
    ///   * `7220` - Contract Description.
    ///   * `7221` - Listing Exchange.
    ///   * `7280` - Industry. Displays the type of industry under which the underlying company can be categorized.
    ///   * `7281` - Category. Displays a more detailed level of description within the industry under which the underlying company can be categorized.
    ///   * `7282` - Average Volume. The average daily trading volume over 90 days.
    ///   * `7283` - Option Implied Vol. %. A prediction of how volatile an underlying will be in the future.At the market volatility estimated for a maturity thirty calendar days forward of the current trading day, and based on option prices from two consecutive expiration months. To query the Implied Vol. % of a specific strike refer to field 7633.
    ///   * `7284` - Historical volatility %. Deprecated
    ///   * `7285` - Put/Call Ratio.
    ///   * `7292` - Cost Basis. Your current position in this security multiplied by the average price and multiplier.
    ///   * `7293` - 52 Week High. The highest price for the past 52 weeks.
    ///   * `7294` - 52 Week Low. The lowest price for the past 52 weeks.
    ///   * `7295` - Open. Today's opening price.
    ///   * `7296` - Close. Today's closing price.
    ///   * `7308` - Delta. The ratio of the change in the price of the option to the corresponding change in the price of the underlying.
    ///   * `7309` - Gamma. The rate of change for the delta with respect to the underlying asset's price.
    ///   * `7310` - Theta. A measure of the rate of decline the value of an option due to the passage of time.
    ///   * `7311` - Vega. The amount that the price of an option changes compared to a 1% change in the volatility.
    ///   * `7607` - Opt. Volume Change %. Today's option volume as a percentage of the average option volume.
    ///   * `7633` - Implied Vol. %. The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283.
    ///   * `7635` - Mark. The mark price is
    ///   * `7636` - Shortable Shares. Number of shares available for shorting.
    ///   * `7637` - Fee Rate. Interest rate charged on borrowed shares.
    ///   * `7638` - Option Open Interest.
    ///   * `7639` - % of Mark Value. Displays the market value of the contract as a percentage of the total market value of the account. Mark Value is calculated with real time market data (even when not subscribed to market data).
    ///   * `7644` - Shortable. Describes the level of difficulty with which the security can be sold short.
    ///   * `7671` - Dividends. This value is the total of the expected dividend payments over the next twelve months per share.
    ///   * `7672` - Dividends TTM. This value is the total of the expected dividend payments over the last twelve months per share.
    ///   * `7674` - EMA(200). Exponential moving average (N=200).
    ///   * `7675` - EMA(100). Exponential moving average (N=100).
    ///   * `7676` - EMA(50). Exponential moving average (N=50).
    ///   * `7677` - EMA(20). Exponential moving average (N=20).
    ///   * `7678` - Price/EMA(200). Price to Exponential moving average (N=200) ratio -1
    ///   * `7679` - Price/EMA(100). Price to Exponential moving average (N=100) ratio -1
    ///   * `7724` - Price/EMA(50). Price to Exponential moving average (N=50) ratio -1
    ///   * `7681` - Price/EMA(20). Price to Exponential moving average (N=20) ratio -1
    ///   * `7682` - Change Since Open. The difference between the last price and the open price.
    ///   * `7683` - Upcoming Event. Shows the next major company event. Requires Wall Street Horizon subscription.
    ///   * `7684` - Upcoming Event Date. The date of the next major company event. Requires Wall Street Horizon subscription.
    ///   * `7685` - Upcoming Analyst Meeting. The date and time of the next scheduled analyst meeting. Requires Wall Street Horizon subscription.
    ///   * `7686` - Upcoming Earnings. The date and time of the next scheduled earnings/earnings call event. Requires Wall Street Horizon subscription.
    ///   * `7687` - Upcoming Misc Event. The date and time of the next shareholder meeting
    ///   * `7688` - Recent Analyst Meeting. The date and time of the most recent analyst meeting. Requires Wall Street Horizon subscription.
    ///   * `7689` - Recent Earnings. The date and time of the most recent earnings/earning call event. Requires Wall Street Horizon subscription.
    ///   * `7690` - Recent Misc Event. The date and time of the most recent shareholder meeting
    ///   * `7694` - Probability of Max Return. Customer implied probability of maximum potential gain.
    ///   * `7695` - Break Even. Break even points
    ///   * `7696` - SPX Delta. Beta Weighted Delta is calculated using the formula; Delta x dollar adjusted beta
    ///   * `7697` - Futures Open Interest. Total number of outstanding futures contracts
    ///   * `7698` - Last Yield. Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
    ///   * `7699` - Bid Yield. Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
    ///   * `7700` - Probability of Max Return. Customer implied probability of maximum potential gain.
    ///   * `7702` - Probability of Max Loss. Customer implied probability of maximum potential loss.
    ///   * `7703` - Profit Probability. Customer implied probability of any gain.
    ///   * `7704` - Organization Type.
    ///   * `7705` - Debt Class.
    ///   * `7706` - Ratings. Ratings issued for bond contract.
    ///   * `7707` - Bond State Code.
    ///   * `7708` - Bond Type.
    ///   * `7714` - Last Trading Date.
    ///   * `7715` - Issue Date.
    ///   * `7720` - Ask Yield. Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
    ///   * `7741` - Prior Close. Yesterday's closing price
    ///   * `7762` - Volume Long. High precision volume for the day. For formatted volume refer to field 87.
    ///   * `7768` - hasTradingPermissions. if user has trading permissions for specified contract. Returns 1(true) or 0(false).
    ///   * `7899` - Stock Type. Determines the stock type. Includes: Common, CORP, ADR, ETF, ETN, EFN, REIT, CEF, ETMF.
    ///   * `7920` - Daily PnL Raw. Your profit or loss of the day since prior close. Daily PnL is calculated with real-time market data (even when not subscribed to market data).
    ///   * `7921` - Cost Basis Raw. Your current position in this security multiplied by the average price and and multiplier.
    ///   * `7943` - Rebate Rate. Fed funds or other currency-relevant Benchmark rate minus the interest rate charged on borrowed shares.
    pub fields: Option<MdFields>,
}
/// Response types for getMdSnapshot
#[derive(Debug, Clone)]
pub enum GetMdSnapshotResponse {
    ///200: Successfully requested market data
    Ok(IserverSnapshot),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get the preset behavior for model rebalancing.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetModelPresetsRequest {
    pub body: ReqIDRequestBody,
}
impl GetModelPresetsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetModelPresetsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ModelPresetsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetModelPresetsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetModelPresetsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetModelPresetsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetModelPresetsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetModelPresetsResponse::Unknown);
    }
}
/// Response types for getModelPresets
#[derive(Debug, Clone)]
pub enum GetModelPresetsResponse {
    ///200: Successfully retrieve preset details
    Ok(ModelPresetsResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request a summary for a single model.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetModelSummarySingleRequest {
    pub body: SummaryRequestBody,
}
impl GetModelSummarySingleRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetModelSummarySingleResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ModelSummaryResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetModelSummarySingleResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetModelSummarySingleResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetModelSummarySingleResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetModelSummarySingleResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetModelSummarySingleResponse::Unknown);
    }
}
/// Response types for getModelSummarySingle
#[derive(Debug, Clone)]
pub enum GetModelSummarySingleResponse {
    ///200: Successfully retrieve model summary.
    Ok(ModelSummaryResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve information about your MTA alert. Each login user only has one mobile trading assistant (MTA) alert with it's own unique tool id that cannot be changed. MTA alerts can not be created or deleted, only modified. When modified a new order Id is generated.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetMtaDetailsRequest {}
impl GetMtaDetailsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetMtaDetailsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AlertDetails>::json_with_diagnostics(req).await?;
            return Ok(GetMtaDetailsResponse::Ok(data));
        }
        let _ = req.bytes().await?;
        return Ok(GetMtaDetailsResponse::Unknown);
    }
}
/// Response types for getMtaDetails
#[derive(Debug, Clone)]
pub enum GetMtaDetailsResponse {
    ///200: The alert description for the unique MTA alert on the account.
    Ok(AlertDetails),
    ///default: Unknown response
    Unknown,
}
/// Returns open orders and filled or cancelled orders submitted during the current brokerage session.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetOpenOrdersRequest {
    pub query: GetOpenOrdersRequestQuery,
}
impl GetOpenOrdersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetOpenOrdersResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<LiveOrdersResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetOpenOrdersResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetOpenOrdersResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetOpenOrdersResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetOpenOrdersResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetOpenOrdersResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetOpenOrdersRequestQuery {
    /// Filter results using a comma-separated list of Order Status values. Also accepts a value to sort results by time.
    /// - Example: `Some("filled")`
    pub filters: Option<GetOpenOrdersRequestQueryFilters>,
    /// Instructs IB to clear cache of orders and obtain updated view from brokerage backend. Response will be an empty array.
    pub force: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetOpenOrdersRequestQueryFilters {
    #[serde(rename = "inactive")]
    #[default]
    Inactive,
    #[serde(rename = "pending_submit")]
    PendingSubmit,
    #[serde(rename = "pre_submitted")]
    PreSubmitted,
    #[serde(rename = "submitted")]
    Submitted,
    #[serde(rename = "filled")]
    Filled,
    #[serde(rename = "pending_cancel")]
    PendingCancel,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "warn_state")]
    WarnState,
    #[serde(rename = "sort_by_time")]
    SortByTime,
}
impl core::fmt::Display for GetOpenOrdersRequestQueryFilters {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Inactive => write!(f, "inactive"),
            Self::PendingSubmit => write!(f, "pending_submit"),
            Self::PreSubmitted => write!(f, "pre_submitted"),
            Self::Submitted => write!(f, "submitted"),
            Self::Filled => write!(f, "filled"),
            Self::PendingCancel => write!(f, "pending_cancel"),
            Self::Cancelled => write!(f, "cancelled"),
            Self::WarnState => write!(f, "warn_state"),
            Self::SortByTime => write!(f, "sort_by_time"),
        }
    }
}
/// Response types for getOpenOrders
#[derive(Debug, Clone)]
pub enum GetOpenOrdersResponse {
    ///200: Orders for a specific account
    Ok(LiveOrdersResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve the status of a single order. Only displays orders from the current brokerage session. If orders executed on a previous day or session, queries will 503 error.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetOrderStatusRequest {
    pub path: GetOrderStatusRequestPath,
}
impl GetOrderStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetOrderStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let _ = req.bytes().await?;
            return Ok(GetOrderStatusResponse::Ok);
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetOrderStatusResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetOrderStatusResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetOrderStatusResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetOrderStatusResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetOrderStatusResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct GetOrderStatusRequestPath {
    /// The IB-assigned order ID of the desired order ticket.
    /// - Example: `1_799_796_559i32`
    pub order_id: i32,
}
/// Response types for getOrderStatus
#[derive(Debug, Clone)]
pub enum GetOrderStatusResponse {
    ///200: order status
    Ok,
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get all positions in an account.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPaginatedPositionsRequest {
    #[validate(nested)]
    pub path: GetPaginatedPositionsRequestPath,
    pub query: GetPaginatedPositionsRequestQuery,
}
impl GetPaginatedPositionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPaginatedPositionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Position200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetPaginatedPositionsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetPaginatedPositionsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPaginatedPositionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPaginatedPositionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPaginatedPositionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPaginatedPositionsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetPaginatedPositionsRequestPath {
    /// Account ID whose positions are requested.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// Paginates positions response. Indexed from 0. Max 100 positions returned per page. Defaulted to 0.
    /// - Example: `1i32`
    pub page_id: i32,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetPaginatedPositionsRequestQuery {
    /// Name of model
    pub model: Option<serde_json::Value>,
    /// sorting of result positions by specified field. Defaulted to "name" field.
    /// - Example: `Some("name")`
    pub sort: Option<serde_json::Value>,
    /// Sorting direction. Possible values "a" - ascending, "d" - descending. Defaulted to "a"
    /// - Example: `Some("a")`
    pub direction: Option<serde_json::Value>,
    /// Forcing to wait for all security definition to be received. If false, position may not have secDef portion
    #[serde(rename = "waitForSecDef")]
    pub wait_for_sec_def: Option<bool>,
}
/// Response types for getPaginatedPositions
#[derive(Debug, Clone)]
pub enum GetPaginatedPositionsResponse {
    ///200: positions
    Ok(Position200Response2),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetParticipatingListResponse {
    #[serde(rename = "participatingBanks")]
    pub participating_banks: Vec<GetParticipatingListResponseParticipatingBank>,
    /// - Example: `"eDDA".to_string()`
    #[serde(rename = "type")]
    pub r#type: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetParticipatingListResponseParticipatingBank {
    /// - Example: `"WEDIHKHHXXX".to_string()`
    #[serde(rename = "BIC")]
    pub bic: String,
    /// - Example: `"390".to_string()`
    #[serde(rename = "clearingCode")]
    pub clearing_code: String,
    /// - Example: `"WELAB BANK LIMITED".to_string()`
    #[serde(rename = "institutionName")]
    pub institution_name: String,
}
/// Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPerformanceAllPeriodsRequest {
    pub query: GetPerformanceAllPeriodsRequestQuery,
    pub body: AcctIdRequestBody3,
}
impl GetPerformanceAllPeriodsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPerformanceAllPeriodsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                DetailedContractInformation,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(GetPerformanceAllPeriodsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetPerformanceAllPeriodsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPerformanceAllPeriodsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPerformanceAllPeriodsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPerformanceAllPeriodsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPerformanceAllPeriodsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetPerformanceAllPeriodsRequestQuery {
    /// only one account. If defined, accounts passed in request body ignored
    pub param: Option<String>,
}
/// Response types for getPerformanceAllPeriods
#[derive(Debug, Clone)]
pub enum GetPerformanceAllPeriodsResponse {
    ///200: An array of objects detailing contract information.
    Ok(DetailedContractInformation),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns updated profit and loss values for the selected account. Initial request will return an empty array in the upnl object.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPnlRequest {}
impl GetPnlRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetPnlResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<PnlPartitionedResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetPnlResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetPnlResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPnlResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPnlResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPnlResponse::Unknown);
    }
}
/// Response types for getPnl
#[derive(Debug, Clone)]
pub enum GetPnlResponse {
    ///200: Refers to "updated PnL". Holds a json object of key-value paired pnl details.
    Ok(PnlPartitionedResponse),
    ///400: bad request; passed input cannot pass initial validation and detected right away
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get the given account's ledger data detailing its balances by currency.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioLedgerRequest {
    #[validate(nested)]
    pub path: GetPortfolioLedgerRequestPath,
}
impl GetPortfolioLedgerRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPortfolioLedgerResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Ledger>::json_with_diagnostics(req).await?;
            return Ok(GetPortfolioLedgerResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioLedgerResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioLedgerResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioLedgerResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPortfolioLedgerResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioLedgerRequestPath {
    /// Account ID whose ledger data is requested.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getPortfolioLedger
#[derive(Debug, Clone)]
pub enum GetPortfolioLedgerResponse {
    ///200: ledger
    Ok(Ledger),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get a single account's attributes and capabilities.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioMetadataRequest {
    #[validate(nested)]
    pub path: GetPortfolioMetadataRequestPath,
}
impl GetPortfolioMetadataRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPortfolioMetadataResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountAttributes>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetPortfolioMetadataResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioMetadataResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioMetadataResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioMetadataResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPortfolioMetadataResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioMetadataRequestPath {
    /// Account ID whose attributes are requested.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getPortfolioMetadata
#[derive(Debug, Clone)]
pub enum GetPortfolioMetadataResponse {
    ///200: An account's attributes
    Ok(AccountAttributes),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns detailed summary of account values, by segment where appropriate.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioSummaryRequest {
    #[validate(nested)]
    pub path: GetPortfolioSummaryRequestPath,
}
impl GetPortfolioSummaryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPortfolioSummaryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<PortfolioSummary>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetPortfolioSummaryResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioSummaryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioSummaryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPortfolioSummaryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPortfolioSummaryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetPortfolioSummaryRequestPath {
    /// accountId
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for getPortfolioSummary
#[derive(Debug, Clone)]
pub enum GetPortfolioSummaryResponse {
    ///200: response with summary definitions
    Ok(PortfolioSummary),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Get position for a given instrument in a single account.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetPositionByConidRequest {
    #[validate(nested)]
    pub path: GetPositionByConidRequestPath,
}
impl GetPositionByConidRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetPositionByConidResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<IndividualPositionArray>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetPositionByConidResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetPositionByConidResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetPositionByConidResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetPositionByConidResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetPositionByConidResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetPositionByConidResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetPositionByConidRequestPath {
    /// Account ID whose position in the given instrument is requested.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub accountid: String,
    /// Conid of the instrument whose position in the account is requested.
    /// - Example: `265_598i32`
    pub conid: i32,
}
/// Response types for getPositionByConid
#[derive(Debug, Clone)]
pub enum GetPositionByConidResponse {
    ///200: Position details by conid
    Ok(IndividualPositionArray),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns an xml file containing all available parameters to be sent for the Iserver scanner request.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetScannerParametersRequest {}
impl GetScannerParametersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetScannerParametersResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<IserverScannerParams>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetScannerParametersResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetScannerParametersResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetScannerParametersResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetScannerParametersResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetScannerParametersResponse::Unknown);
    }
}
/// Response types for getScannerParameters
#[derive(Debug, Clone)]
pub enum GetScannerParametersResponse {
    ///200: An array of objects detailing contract information.
    Ok(IserverScannerParams),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Searches for contracts according to the filters specified in /iserver/scanner/params endpoint.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetScannerResultsRequest {
    pub body: IserverScannerRunRequest,
}
impl GetScannerResultsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetScannerResultsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<IserverScannerRunResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(GetScannerResultsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetScannerResultsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetScannerResultsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetScannerResultsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetScannerResultsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetScannerResultsResponse::Unknown);
    }
}
/// Response types for getScannerResults
#[derive(Debug, Clone)]
pub enum GetScannerResultsResponse {
    ///200: An array of objects detailing contract information.
    Ok(IserverScannerRunResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// If the gateway has not received any requests for several minutes an open session will automatically timeout. The tickle endpoint pings the server to prevent the session from ending. It is expected to call this endpoint approximately every 60 seconds to maintain the connection to the brokerage session.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetSessionTokenRequest {}
impl GetSessionTokenRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetSessionTokenResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TickleResponse>::json_with_diagnostics(req).await?;
            return Ok(GetSessionTokenResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetSessionTokenResponse::Unauthorized);
        }
        let _ = req.bytes().await?;
        return Ok(GetSessionTokenResponse::Unknown);
    }
}
/// Response types for getSessionToken
#[derive(Debug, Clone)]
pub enum GetSessionTokenResponse {
    ///200: An array of objects detailing contract information.
    Ok(TickleResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    ///default: Unknown response
    Unknown,
}
/// Validates the current session for the SSO user.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetSessionValidationRequest {}
impl GetSessionValidationRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetSessionValidationResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SsoValidateResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetSessionValidationResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetSessionValidationResponse::Unauthorized);
        }
        let _ = req.bytes().await?;
        return Ok(GetSessionValidationResponse::Unknown);
    }
}
/// Response types for getSessionValidation
#[derive(Debug, Clone)]
pub enum GetSessionValidationResponse {
    ///200: An array of objects detailing contract information.
    Ok(SsoValidateResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    ///default: Unknown response
    Unknown,
}
/// Retrieves the configuration of a single account group.  This describes the name of the allocation group, the specific accounts contained in the group, and the allocation method in use along with any relevant quantities. This endpoint is only supported for Financial Advisors and IBroker Accounts.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetSingleAllocationGroupRequest {
    #[validate(nested)]
    pub body: NameRequestBody,
}
impl GetSingleAllocationGroupRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetSingleAllocationGroupResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<AllocationGroup>::json_with_diagnostics(req)
                .await?;
            return Ok(GetSingleAllocationGroupResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetSingleAllocationGroupResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetSingleAllocationGroupResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetSingleAllocationGroupResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetSingleAllocationGroupResponse::Unknown);
    }
}
/// Response types for getSingleAllocationGroup
#[derive(Debug, Clone)]
pub enum GetSingleAllocationGroupResponse {
    ///200: Returns details of the allocation group.
    Ok(AllocationGroup),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the performance (MTM) for the given accounts, if more than one account is passed, the result is consolidated.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetSinglePerformancePeriodRequest {
    pub body: PerformanceRequestBody,
}
impl GetSinglePerformancePeriodRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetSinglePerformancePeriodResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<PerformanceResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetSinglePerformancePeriodResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetSinglePerformancePeriodResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetSinglePerformancePeriodResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetSinglePerformancePeriodResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetSinglePerformancePeriodResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetSinglePerformancePeriodResponse::Unknown);
    }
}
/// Response types for getSinglePerformancePeriod
#[derive(Debug, Clone)]
pub enum GetSinglePerformancePeriodResponse {
    ///200: An array of objects detailing contract information.
    Ok(PerformanceResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve details of a single watchlist stored in the username's settings.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetSpecificWatchlistRequest {
    #[validate(nested)]
    pub query: GetSpecificWatchlistRequestQuery,
}
impl GetSpecificWatchlistRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetSpecificWatchlistResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<SingleWatchlist>::json_with_diagnostics(req)
                .await?;
            return Ok(GetSpecificWatchlistResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetSpecificWatchlistResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetSpecificWatchlistResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetSpecificWatchlistResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetSpecificWatchlistResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetSpecificWatchlistResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetSpecificWatchlistRequestQuery {
    /// Watchlist ID of the requested watchlist.
    /// - Example: `"1234".to_string()`
    #[validate(length(min = 1u64))]
    pub id: String,
}
/// Response types for getSpecificWatchlist
#[derive(Debug, Clone)]
pub enum GetSpecificWatchlistResponse {
    ///200: Successful deletion of specified watchlist.
    Ok(SingleWatchlist),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct GetStatementsResponse {
    pub data: Option<ResponseData>,
}
/// Returns an object contains all stock contracts for given symbol(s)
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetStockBySymbolRequest {
    #[validate(nested)]
    pub query: GetStockBySymbolRequestQuery,
}
impl GetStockBySymbolRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetStockBySymbolResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Stocks>::json_with_diagnostics(req).await?;
            return Ok(GetStockBySymbolResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetStockBySymbolResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetStockBySymbolResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetStockBySymbolResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetStockBySymbolResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetStockBySymbolResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetStockBySymbolRequestQuery {
    /// Comma-separated list of stock symbols. Symbols must contain only capitalized letters.
    /// - Example: `"AAPL,IBKR".to_string()`
    #[validate(length(min = 1u64))]
    pub symbols: String,
}
/// Response types for getStockBySymbol
#[derive(Debug, Clone)]
pub enum GetStockBySymbolResponse {
    ///200: Successful response containing a contract's security definition.
    Ok(Stocks),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Retrieve a list of trades, up to a maximum of 7 days prior.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetTradeHistoryRequest {
    pub query: GetTradeHistoryRequestQuery,
}
impl GetTradeHistoryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetTradeHistoryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TradesResponse>::json_with_diagnostics(req).await?;
            return Ok(GetTradeHistoryResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetTradeHistoryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetTradeHistoryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetTradeHistoryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetTradeHistoryResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetTradeHistoryRequestQuery {
    /// The number of prior days prior to include in response, up to a maximum of 7. If omitted, only the current day's executions will be returned.
    /// - Example: `Some(3i32)`
    pub days: Option<i32>,
}
/// Response types for getTradeHistory
#[derive(Debug, Clone)]
pub enum GetTradeHistoryResponse {
    ///200: trades
    Ok(TradesResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the trading schedule up to a month for the requested contract.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetTradingScheduleGetTrsrvSecdefScheduleRequest {
    #[validate(nested)]
    pub query: GetTradingScheduleGetTrsrvSecdefScheduleRequestQuery,
}
impl GetTradingScheduleGetTrsrvSecdefScheduleRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetTradingScheduleGetTrsrvSecdefScheduleResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<TradingSchedule>::json_with_diagnostics(req)
                .await?;
            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetTradingScheduleGetTrsrvSecdefScheduleResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetTradingScheduleGetTrsrvSecdefScheduleRequestQuery {
    /// Specify the security type of the given contract. Valid asset classes are:
    ///  * `STK` - Stock
    ///  * `OPT` - Option
    ///  * `FUT` - Future
    ///  * `CFD` - Contract for Difference
    ///  * `WAR` - Warrant
    ///  * `SWP` - Forex
    ///  * `FND` - Mutual Fund
    ///  * `BND` - Bond
    ///  * `ICS` - Inter-Commodity Spread
    #[serde(rename = "assetClass")]
    pub asset_class: GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass,
    /// Specify the symbol for your contract.
    /// - Example: `"AAPL".to_string()`
    #[validate(length(min = 1u64))]
    pub symbol: String,
    /// Specify the primary exchange of your contract.
    /// - Example: `Some("NASDAQ".to_string())`
    pub exchange: Option<String>,
    /// Specify all exchanges you want to retrieve data from.
    /// - Example: `Some("AMEX,NASDAQ,NYSE".to_string())`
    #[serde(rename = "exchangeFilter")]
    pub exchange_filter: Option<String>,
}
/// Specify the security type of the given contract. Valid asset classes are:
///  * `STK` - Stock
///  * `OPT` - Option
///  * `FUT` - Future
///  * `CFD` - Contract for Difference
///  * `WAR` - Warrant
///  * `SWP` - Forex
///  * `FND` - Mutual Fund
///  * `BND` - Bond
///  * `ICS` - Inter-Commodity Spread
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass {
    #[serde(rename = "STK")]
    #[default]
    Stk,
    #[serde(rename = "OPT")]
    Opt,
    #[serde(rename = "FUT")]
    Fut,
    #[serde(rename = "CFD")]
    Cfd,
    #[serde(rename = "WAR")]
    War,
    #[serde(rename = "SWP")]
    Swp,
    #[serde(rename = "FND")]
    Fnd,
    #[serde(rename = "BND")]
    Bnd,
    #[serde(rename = "ICS")]
    Ics,
}
impl core::fmt::Display for GetTradingScheduleGetTrsrvSecdefScheduleRequestQueryAssetClass {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Stk => write!(f, "STK"),
            Self::Opt => write!(f, "OPT"),
            Self::Fut => write!(f, "FUT"),
            Self::Cfd => write!(f, "CFD"),
            Self::War => write!(f, "WAR"),
            Self::Swp => write!(f, "SWP"),
            Self::Fnd => write!(f, "FND"),
            Self::Bnd => write!(f, "BND"),
            Self::Ics => write!(f, "ICS"),
        }
    }
}
/// Response types for getTradingSchedule_get_trsrv_secdef_schedule
#[derive(Debug, Clone)]
pub enum GetTradingScheduleGetTrsrvSecdefScheduleResponse {
    ///200: Returns the trading schedule up to a month for the requested contract.
    Ok(TradingSchedule),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the trading schedule for the 6 total days surrounding the current trading day. Non-Trading days, such as holidays, will not be returned.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetTradingScheduleRequest {
    #[validate(nested)]
    pub query: GetTradingScheduleRequestQuery,
}
impl GetTradingScheduleRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetTradingScheduleResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<ScheduleResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetTradingScheduleResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetTradingScheduleResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetTradingScheduleResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GetTradingScheduleRequestQuery {
    /// Provide the contract identifier to retrieve the trading schedule for.
    #[validate(length(min = 1u64))]
    pub conid: String,
    /// Accepts the exchange to retrieve data from. Primary exchange is assumed by default.
    pub exchange: Option<String>,
}
/// Response types for getTradingSchedule
#[derive(Debug, Clone)]
pub enum GetTradingScheduleResponse {
    ///200: Returns the liquid and extended trading hours of the coming and prior trading days.
    Ok(ScheduleResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Transaction history for a given number of conids and accounts. Types of transactions include dividend payments, buy and sell transactions, transfers.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetTransactionsRequest {
    pub body: TransactionRequestBody,
}
impl GetTransactionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetTransactionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TransactionsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetTransactionsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetTransactionsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetTransactionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetTransactionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetTransactionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetTransactionsResponse::Unknown);
    }
}
/// Response types for getTransactions
#[derive(Debug, Clone)]
pub enum GetTransactionsResponse {
    ///200: An array of objects detailing contract information.
    Ok(TransactionsResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns a list of positions for the given account. /portfolio/accounts or /portfolio/subaccounts must be called prior to this endpoint. This endpoint provides near-real time updates and removes caching otherwise found in the /portfolio/{accountId}/positions/{pageId} endpoint.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetUncachedPositionsRequest {
    #[validate(nested)]
    pub path: GetUncachedPositionsRequestPath,
    pub query: GetUncachedPositionsRequestQuery,
}
impl GetUncachedPositionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetUncachedPositionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Portfolio2Positions>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetUncachedPositionsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetUncachedPositionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetUncachedPositionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetUncachedPositionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetUncachedPositionsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct GetUncachedPositionsRequestPath {
    /// accountId
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct GetUncachedPositionsRequestQuery {
    /// Model code to track the account within.
    /// - Example: `Some("Primary_Model_Groups".to_string())`
    pub model: Option<String>,
    /// The chronologic order of orders to sort by.
    ///   * `a` - Display in ascending order.
    ///   * `d` - Display in descending order.
    #[default(Some(Default::default()))]
    pub direction: Option<GetUncachedPositionsRequestQueryDirection>,
}
/// The chronologic order of orders to sort by.
///   * `a` - Display in ascending order.
///   * `d` - Display in descending order.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum GetUncachedPositionsRequestQueryDirection {
    #[serde(rename = "a")]
    #[default]
    A,
    #[serde(rename = "d")]
    D,
}
impl core::fmt::Display for GetUncachedPositionsRequestQueryDirection {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::A => write!(f, "a"),
            Self::D => write!(f, "d"),
        }
    }
}
/// Response types for getUncachedPositions
#[derive(Debug, Clone)]
pub enum GetUncachedPositionsResponse {
    ///200: response with position details
    Ok(Portfolio2Positions),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Returns the total number of unread notifications
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct GetUnreadFyisRequest {}
impl GetUnreadFyisRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<GetUnreadFyisResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<BNResponse>::json_with_diagnostics(req).await?;
            return Ok(GetUnreadFyisResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetUnreadFyisResponse::Unauthorized);
        }
        if status == http::StatusCode::LOCKED {
            let _ = req.bytes().await?;
            return Ok(GetUnreadFyisResponse::Locked);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetUnreadFyisResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(GetUnreadFyisResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(GetUnreadFyisResponse::Unknown);
    }
}
/// Response types for getUnreadFyis
#[derive(Debug, Clone)]
pub enum GetUnreadFyisResponse {
    ///200: Indicates data is being returned successfully.
    Ok(BNResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    ///423: Return if called too frequently. Should not be called more than 1 time in 5 minutes
    Locked,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct GroupRequestBody {
    /// An array of accounts that should be held in the allocation group and, if using a User-specified allocaiton method, the value correlated to the allocation.
    #[validate(nested)]
    pub accounts: Vec<GroupRequestBodyAccount>,
    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
    ///   * `A` - Available Equity
    ///   * `E` - Equal
    ///   * `N` - Net Liquidation Value
    ///
    /// User-specified allocation methods:
    ///   * `C` - Cash Quantity
    ///   * `P` - Percentage
    ///   * `R` - Ratios
    ///   * `S` - Shares
    #[default(Some(Default::default()))]
    pub default_method: Option<AllocationMethod>,
    /// Name used to refer to your allocation group. If prev_name is specified, this will become the new name of the group.
    /// - Example: `"Group_1_NetLiq".to_string()`
    #[validate(length(min = 1u64))]
    pub name: String,
    /// Can be used to rename a group. Using this field will recognize the previous name, while the "name" filed will mark the updated name.
    /// - Example: `Some("Group_0_NetLiq".to_string())`
    pub prev_name: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct GroupRequestBody2 {
    /// An array of accounts that should be held in the allocation group and, if using a User-specified allocaiton method, the value correlated to the allocation.
    #[validate(nested)]
    pub accounts: Vec<GroupRequestBodyAccount>,
    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
    ///   * `A` - Available Equity
    ///   * `E` - Equal
    ///   * `N` - Net Liquidation Value
    ///
    /// User-specified allocation methods:
    ///   * `C` - Cash Quantity
    ///   * `P` - Percentage
    ///   * `R` - Ratios
    ///   * `S` - Shares
    #[default(Some(Default::default()))]
    pub default_method: Option<AllocationMethod>,
    /// Name used to refer to your allocation group. If prev_name is specified, this will become the new name of the group.
    /// - Example: `"Group_1_NetLiq".to_string()`
    #[validate(length(min = 1u64))]
    pub name: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct GroupRequestBodyAccount {
    /// The total distribution value for each sub-account for user-defined allocation methods.
    /// - Example: `Some(10i32)`
    pub amount: Option<i32>,
    /// The accountId of a given sub-account.
    /// - Example: `"U1234567".to_string()`
    #[validate(length(min = 1u64))]
    pub name: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum History200Response {
    /// Object containing the requested historical data and related metadata.
    #[default]
    BidAsk(IserverHistoryBidAskResponse),
    /// Object containing the requested historical data and related metadata.
    Last(IserverHistoryLastResponse),
    /// Object containing the requested historical data and related metadata.
    Midpoint(IserverHistoryMidpointResponse),
}
impl History200Response {
    /// Object containing the requested historical data and related metadata.
    pub fn bid_ask() -> Self {
        Self::BidAsk(IserverHistoryBidAskResponse::default())
    }
    /// Object containing the requested historical data and related metadata.
    pub fn last() -> Self {
        Self::Last(IserverHistoryLastResponse::default())
    }
    /// Object containing the requested historical data and related metadata.
    pub fn midpoint() -> Self {
        Self::Midpoint(IserverHistoryMidpointResponse::default())
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualComboPosition {
    /// IB accountId of an account with a position in the requested conid.
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
    /// Asset class of the requested instrument.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<String>,
    /// The account's average cost for its position.
    #[serde(rename = "avgCost")]
    pub avg_cost: Option<f64>,
    /// The account's average price for its position.
    #[serde(rename = "avgPrice")]
    pub avg_price: Option<f64>,
    #[serde(rename = "conExchMap")]
    pub con_exch_map: Option<Vec<serde_json::Value>>,
    /// IB contract ID for the instrument.
    pub conid: Option<i32>,
    /// Human-readable description of the instrument.
    #[serde(rename = "contractDesc")]
    pub contract_desc: Option<String>,
    /// Currency in which the instrument trades.
    pub currency: Option<String>,
    pub exchs: Option<serde_json::Value>,
    /// Style of exercise for options.
    #[serde(rename = "exerciseStyle")]
    pub exercise_style: Option<String>,
    /// Expiration of instrument, if applicable.
    pub expiry: Option<String>,
    /// Current market price of the instrument, in the instrument's currency.
    #[serde(rename = "mktPrice")]
    pub mkt_price: Option<f64>,
    /// Current market value of the account's position in the instrument, in the instrument's currency.
    #[serde(rename = "mktValue")]
    pub mkt_value: Option<f64>,
    /// Instrument's multiplier, if applicable.
    pub multiplier: Option<f64>,
    /// Size of position in units of instrument.
    pub position: Option<f64>,
    /// The right of an options contract, if applicable.
    #[serde(rename = "putOrCall")]
    pub put_or_call: Option<IndividualComboPositionPutOrCall>,
    /// Realized PnL for the instrument in the instrument's currency.
    #[serde(rename = "realizedPnl")]
    pub realized_pnl: Option<f64>,
    /// Strike price, if applicable. Returned as string.
    pub strike: Option<String>,
    /// Contract ID of underlying instrument, if applicable.
    #[serde(rename = "undConid")]
    pub und_conid: Option<i32>,
    /// Unrealized PnL for the instrument in the account.
    #[serde(rename = "unrealizedPnl")]
    pub unrealized_pnl: Option<f64>,
}
/// The right of an options contract, if applicable.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum IndividualComboPositionPutOrCall {
    #[default]
    P,
    C,
    None,
}
impl core::fmt::Display for IndividualComboPositionPutOrCall {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::P => write!(f, "P"),
            Self::C => write!(f, "C"),
            Self::None => write!(f, "None"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualIRABene {
    #[serde(rename = "dateOfBirth")]
    pub date_of_birth: Option<String>,
    #[serde(rename = "firstName")]
    pub first_name: Option<String>,
    pub identification: Option<std::collections::HashMap<String, String>>,
    #[serde(rename = "lastName")]
    pub last_name: Option<String>,
    pub location: Option<std::collections::HashMap<String, String>>,
    pub ownership: Option<i32>,
    #[serde(rename = "perStripes")]
    pub per_stripes: Option<String>,
    pub relationship: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
/// A specific account's position in the requested conid.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualPosition {
    /// IB accountId of an account with a position in the requested conid.
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
    /// Comma separated all exchanges on which the instrument trades.
    #[serde(rename = "allExchanges")]
    pub all_exchanges: Option<String>,
    /// Asset class of the requested instrument.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<String>,
    /// The account's average cost for its position.
    #[serde(rename = "avgCost")]
    pub avg_cost: Option<f64>,
    /// The account's average price for its position.
    #[serde(rename = "avgPrice")]
    pub avg_price: Option<f64>,
    /// Average cost in the account's base currency.
    #[serde(rename = "baseAvgCost")]
    pub base_avg_cost: Option<f64>,
    /// Average price in the account's base currency.
    #[serde(rename = "baseAvgPrice")]
    pub base_avg_price: Option<f64>,
    /// Market price of instrument in the account's base currency.
    #[serde(rename = "baseMktPrice")]
    pub base_mkt_price: Option<f64>,
    /// Market value of the position in the account's base currency.
    #[serde(rename = "baseMktValue")]
    pub base_mkt_value: Option<f64>,
    /// Realized PnL for the instrument in the account's base currency.
    #[serde(rename = "baseRealizedPnl")]
    pub base_realized_pnl: Option<f64>,
    /// Unrealized PnL for the instrument in the account's base currency.
    #[serde(rename = "baseUnrealizedPnl")]
    pub base_unrealized_pnl: Option<f64>,
    /// Chinese name of the instrument.
    #[serde(rename = "chineseName")]
    pub chinese_name: Option<String>,
    #[serde(rename = "conExchMap")]
    pub con_exch_map: Option<Vec<serde_json::Value>>,
    /// IB contract ID for the instrument.
    pub conid: Option<i32>,
    /// Human-readable description of the instrument.
    #[serde(rename = "contractDesc")]
    pub contract_desc: Option<String>,
    /// Country in which the instrument is issued.
    #[serde(rename = "countryCode")]
    pub country_code: Option<String>,
    /// Currency in which the instrument trades.
    pub currency: Option<String>,
    /// Object defining minimum increments used in displaying market data for the instrument.
    #[serde(rename = "displayRule")]
    pub display_rule: Option<IndividualPositionDisplayRule>,
    pub exchs: Option<serde_json::Value>,
    /// Style of exercise for options.
    #[serde(rename = "exerciseStyle")]
    pub exercise_style: Option<String>,
    /// Expiration of instrument, if applicable.
    pub expiry: Option<String>,
    /// Full display name of the instrument.
    #[serde(rename = "fullName")]
    pub full_name: Option<String>,
    /// Industry sub-categorization of the instrument.
    pub group: Option<String>,
    /// Indicates whether instrument has options contracts available for trading at IB.
    #[serde(rename = "hasOptions")]
    pub has_options: Option<bool>,
    /// Array containing increment rules used when pricing orders for the instrument.
    #[serde(rename = "incrementRules")]
    pub increment_rules: Option<Vec<IndividualPositionIncrementRule>>,
    /// Indicates whether the instrument is an Event Contract.
    #[serde(rename = "isEventContract")]
    pub is_event_contract: Option<bool>,
    /// Indicates whether the instrument is issued in the US.
    #[serde(rename = "isUS")]
    pub is_us: Option<bool>,
    /// Last day of trading in the instrument, if applicable. Formatted `YYYYMMDD`.
    #[serde(rename = "lastTradingDay")]
    pub last_trading_day: Option<String>,
    /// The exchange on which the instrument is listed, or the primary exchange recognized by IB for the instrument.
    #[serde(rename = "listingExchange")]
    pub listing_exchange: Option<String>,
    /// Current market price of the instrument, in the instrument's currency.
    #[serde(rename = "mktPrice")]
    pub mkt_price: Option<f64>,
    /// Current market value of the account's position in the instrument, in the instrument's currency.
    #[serde(rename = "mktValue")]
    pub mkt_value: Option<f64>,
    /// Name of the model portfolio in which the account is invested that contributes this position.
    pub model: Option<String>,
    /// Instrument's multiplier, if applicable.
    pub multiplier: Option<f64>,
    /// Formal name of the entity or asset to which the instrument relates.
    pub name: Option<String>,
    /// Maximum number of accounts that can be returned in a single request.
    #[serde(rename = "pageSize")]
    pub page_size: Option<i32>,
    /// Size of position in units of instrument.
    pub position: Option<f64>,
    /// The right of an options contract, if applicable.
    #[serde(rename = "putOrCall")]
    pub put_or_call: Option<IndividualPositionPutOrCall>,
    /// Realized PnL for the instrument in the instrument's currency.
    #[serde(rename = "realizedPnl")]
    pub realized_pnl: Option<f64>,
    /// Industry sector categorization of the instrument.
    pub sector: Option<String>,
    /// Industry sub-categorization of the instrument.
    #[serde(rename = "sectorGroup")]
    pub sector_group: Option<String>,
    /// Strike price, if applicable. Returned as string.
    pub strike: Option<String>,
    /// Symbol associated with the instrument.
    pub ticker: Option<String>,
    /// Time taken to retrieve position data in milliseconds.
    pub time: Option<i32>,
    /// Description of instrument, used to differentiate classes, if applicable.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
    /// Contract ID of underlying instrument, if applicable.
    #[serde(rename = "undConid")]
    pub und_conid: Option<i32>,
    /// Unrealized PnL for the instrument in the account.
    #[serde(rename = "unrealizedPnl")]
    pub unrealized_pnl: Option<f64>,
}
pub type IndividualPositionArray = Vec<IndividualPosition>;
/// Object defining minimum increments used in displaying market data for the instrument.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualPositionDisplayRule {
    /// Array containing objects corresponding to display rule increments.
    #[serde(rename = "displayRuleStep")]
    pub display_rule_step: Option<Vec<IndividualPositionDisplayRuleDisplayRuleStep>>,
    /// Magnifier applied to pricing, if applicable.
    pub magnification: Option<i32>,
}
/// A single display rule increment.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualPositionDisplayRuleDisplayRuleStep {
    /// Number of decimal digits to display.
    #[serde(rename = "decimalDigits")]
    pub decimal_digits: Option<i32>,
    /// Lower edge from which the display rule is effective.
    #[serde(rename = "lowerEdge")]
    pub lower_edge: Option<f64>,
    /// Number of integer digits to display.
    #[serde(rename = "wholeDigits")]
    pub whole_digits: Option<i32>,
}
/// Objects describing a single increment rule.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IndividualPositionIncrementRule {
    /// The pricing increment.
    pub increment: Option<f64>,
    /// Lower edge from which the price increment rule is effective.
    #[serde(rename = "lowerEdge")]
    pub lower_edge: Option<f64>,
}
/// The right of an options contract, if applicable.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum IndividualPositionPutOrCall {
    #[default]
    P,
    C,
}
impl core::fmt::Display for IndividualPositionPutOrCall {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::P => write!(f, "P"),
            Self::C => write!(f, "C"),
        }
    }
}
/// After retrieving the access token and subsequent Live Session Token, customers can initialize their brokerage session with the ssodh/init endpoint.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct InitializeSessionRequest {
    pub body: BrokerageSessionInitRequest,
}
impl InitializeSessionRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<InitializeSessionResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<BrokerageSessionStatus>::json_with_diagnostics(req)
                    .await?;
            return Ok(InitializeSessionResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(InitializeSessionResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(InitializeSessionResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(InitializeSessionResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(InitializeSessionResponse::Unknown);
    }
}
/// Response types for initializeSession
#[derive(Debug, Clone)]
pub enum InitializeSessionResponse {
    ///200: An array of objects detailing contract information.
    Ok(BrokerageSessionStatus),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Instruction200Response {
    #[default]
    InstructionPolling(InstructionPollingResponse),
    Instruction(InstructionResponse),
    QueryRecentInstruction(QueryRecentInstructionResponse),
    DepositFundsPolling(DepositFundsPollingResponse),
    QueryIRAContributions(QueryIRAContributionsResponse),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum InstructionDirection {
    #[serde(rename = "IN")]
    #[default]
    In,
    #[serde(rename = "OUT")]
    Out,
}
impl core::fmt::Display for InstructionDirection {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::In => write!(f, "IN"),
            Self::Out => write!(f, "OUT"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct InstructionPollingResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<PollingInstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct InstructionRequestBody {
    pub instruction: InstructionRequestBodyInstruction,
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionRequestBodyInstructionType,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum InstructionRequestBodyInstruction {
    #[default]
    TraditionalBankInstructionVerification(TraditionalBankInstructionVerification),
    AchInstruction(AchInstruction),
    DeleteBankInstruction(DeleteBankInstruction),
    PredefinedDestinationInstruction(PredefinedDestinationInstruction),
    EddaInstruction(EddaInstruction),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum InstructionRequestBodyInstructionType {
    #[serde(rename = "ACH_INSTRUCTION")]
    #[default]
    AchInstruction,
    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
    TraditionalBankInstructionVerification,
    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
    DeleteBankInstruction,
    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
    PredefinedDestinationInstruction,
    #[serde(rename = "EDDA_INSTRUCTION")]
    EddaInstruction,
}
impl core::fmt::Display for InstructionRequestBodyInstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
            Self::TraditionalBankInstructionVerification => {
                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
            }
            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
            Self::PredefinedDestinationInstruction => {
                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
            }
            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct InstructionResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<InstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct InstructionResult {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: InstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum InstructionResultInstructionStatus {
    #[serde(rename = "PENDING")]
    #[default]
    Pending,
    #[serde(rename = "PROCESSED")]
    Processed,
    #[serde(rename = "REJECTED")]
    Rejected,
    #[serde(rename = "PENDING_VERIFICATION")]
    PendingVerification,
}
impl core::fmt::Display for InstructionResultInstructionStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Pending => write!(f, "PENDING"),
            Self::Processed => write!(f, "PROCESSED"),
            Self::Rejected => write!(f, "REJECTED"),
            Self::PendingVerification => write!(f, "PENDING_VERIFICATION"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum InstructionResultInstructionType {
    #[serde(rename = "ACH_INSTRUCTION")]
    #[default]
    AchInstruction,
    #[serde(rename = "CANCEL_INSTRUCTION")]
    CancelInstruction,
    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
    ComplexAssetTransfer,
    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
    DeleteBankInstruction,
    #[serde(rename = "DEPOSIT")]
    Deposit,
    #[serde(rename = "DWAC")]
    Dwac,
    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
    ExternalPositionTransfer,
    #[serde(rename = "FOP")]
    Fop,
    #[serde(rename = "QUERY_RECENT_INSTRUCTIONS")]
    QueryRecentInstructions,
    #[serde(rename = "QUERY_WITHDRAWABLE_FUNDS")]
    QueryWithdrawableFunds,
    #[serde(rename = "INTERNAL_POSITION_TRANSFER")]
    InternalPositionTransfer,
    #[serde(rename = "INTERNAL_CASH_TRANSFER")]
    InternalCashTransfer,
    #[serde(rename = "MICRO_AMOUNT")]
    MicroAmount,
    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
    PredefinedDestinationInstruction,
    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
    TraditionalBankInstructionVerification,
    #[serde(rename = "WITHDRAWAL")]
    Withdrawal,
    #[serde(rename = "QUERY_IRA_CONTRIBUTIONS")]
    QueryIraContributions,
    #[serde(rename = "EDDA_INSTRUCTION")]
    EddaInstruction,
    #[serde(rename = "QUERY_RECENT_RECURRING_EVENTS")]
    QueryRecentRecurringEvents,
    #[serde(rename = "QUERY_RECURRING_INSTRUCTIONS")]
    QueryRecurringInstructions,
    #[serde(rename = "QUERY_ACCOUNT_BALANCES")]
    QueryAccountBalances,
    #[serde(rename = "QUERY_BANK_INSTRUCTION")]
    QueryBankInstruction,
    #[serde(rename = "QUERY_WITHDRAWABLE_CASH_EQUITY")]
    QueryWithdrawableCashEquity,
}
impl core::fmt::Display for InstructionResultInstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
            Self::CancelInstruction => write!(f, "CANCEL_INSTRUCTION"),
            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
            Self::Deposit => write!(f, "DEPOSIT"),
            Self::Dwac => write!(f, "DWAC"),
            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
            Self::Fop => write!(f, "FOP"),
            Self::QueryRecentInstructions => write!(f, "QUERY_RECENT_INSTRUCTIONS"),
            Self::QueryWithdrawableFunds => write!(f, "QUERY_WITHDRAWABLE_FUNDS"),
            Self::InternalPositionTransfer => write!(f, "INTERNAL_POSITION_TRANSFER"),
            Self::InternalCashTransfer => write!(f, "INTERNAL_CASH_TRANSFER"),
            Self::MicroAmount => write!(f, "MICRO_AMOUNT"),
            Self::PredefinedDestinationInstruction => {
                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
            }
            Self::TraditionalBankInstructionVerification => {
                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
            }
            Self::Withdrawal => write!(f, "WITHDRAWAL"),
            Self::QueryIraContributions => write!(f, "QUERY_IRA_CONTRIBUTIONS"),
            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
            Self::QueryRecentRecurringEvents => {
                write!(f, "QUERY_RECENT_RECURRING_EVENTS")
            }
            Self::QueryRecurringInstructions => write!(f, "QUERY_RECURRING_INSTRUCTIONS"),
            Self::QueryAccountBalances => write!(f, "QUERY_ACCOUNT_BALANCES"),
            Self::QueryBankInstruction => write!(f, "QUERY_BANK_INSTRUCTION"),
            Self::QueryWithdrawableCashEquity => {
                write!(f, "QUERY_WITHDRAWABLE_CASH_EQUITY")
            }
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct InternalAssetTransfersBulkRequestBody {
    #[serde(rename = "instructionType")]
    #[default("INTERNAL_POSITION_TRANSFER".to_string())]
    pub instruction_type: String,
    pub instructions: Vec<serde_json::Value>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct InternalCashTransferInstruction {
    /// - Example: `123.0`
    pub amount: f64,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Note".to_string())`
    #[serde(rename = "clientNote")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub client_note: Option<String>,
    /// - Example: `"GBP".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
    #[serde(rename = "dateTimeToOccur")]
    pub date_time_to_occur: Option<chrono::DateTime<chrono::Utc>>,
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "sourceAccountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub source_account_id: String,
    /// - Example: `"U15667".to_string()`
    #[serde(rename = "targetAccountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub target_account_id: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct InternalCashTransfersBulkRequestBody {
    #[serde(rename = "instructionType")]
    #[default("INTERNAL_CASH_TRANSFER".to_string())]
    pub instruction_type: String,
    pub instructions: Vec<serde_json::Value>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct InternalPositionTransferInstruction {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// If settleDate is provided then tradeDate is also required
    /// - Example: `Some("2025-02-25".to_string())`
    #[serde(rename = "settleDate")]
    pub settle_date: Option<String>,
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "sourceAccountId")]
    #[validate(length(min = 1u64))]
    pub source_account_id: String,
    /// - Example: `"U463756".to_string()`
    #[serde(rename = "targetAccountId")]
    #[validate(length(min = 1u64))]
    pub target_account_id: String,
    /// If tradeDate is provided then settleDate is also required
    /// - Example: `Some("2025-02-17".to_string())`
    #[serde(rename = "tradeDate")]
    pub trade_date: Option<String>,
    #[serde(rename = "tradingInstrument")]
    pub trading_instrument: TradingInstrument,
    /// If transferPrice is provided then tradeDate and settleDate are also required
    /// - Example: `Some(123.0)`
    /// Validation: Must be a multiple of 1e-9
    #[serde(rename = "transferPrice")]
    pub transfer_price: Option<f64>,
    /// - Example: `100.0`
    #[serde(rename = "transferQuantity")]
    pub transfer_quantity: f64,
}
/// Instructs IB to discard cached portfolio positions for a given account, so that the next request for positions delivers freshly obtained data.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct InvalidatePositionCacheRequest {
    #[validate(nested)]
    pub path: InvalidatePositionCacheRequestPath,
}
impl InvalidatePositionCacheRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<InvalidatePositionCacheResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<MessageResponse>::json_with_diagnostics(req)
                .await?;
            return Ok(InvalidatePositionCacheResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(InvalidatePositionCacheResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(InvalidatePositionCacheResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(InvalidatePositionCacheResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(InvalidatePositionCacheResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(InvalidatePositionCacheResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct InvalidatePositionCacheRequestPath {
    /// Account ID whose cached portfolio positions will be discarded.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for invalidatePositionCache
#[derive(Debug, Clone)]
pub enum InvalidatePositionCacheResponse {
    ///200: status of invalidation
    Ok(MessageResponse),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct InvestDivest200Response {
    /// Request identifier to uniquely track a request.
    /// - Example: `Some("540607".to_string())`
    #[serde(rename = "reqID")]
    pub req_id: Option<String>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct InvestDivestRequestBody {
    /// Collection of accounts to invest in a model.
    #[serde(rename = "accountList")]
    pub account_list: Option<Vec<InvestDivestRequestBodyAccountList>>,
    /// Define the model to invest accounts into.
    pub model: Option<String>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct InvestDivestRequestBodyAccountList {
    /// Account identifier to invest.
    pub account: Option<String>,
    /// Amount of cash to invest in the model from the account.
    #[serde(rename = "amtToInvest")]
    pub amt_to_invest: Option<f64>,
}
/// Object containing the requested historical data and related metadata.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct IserverHistoryBidAskResponse {
    /// The client-specified bar width, represented in seconds.
    #[serde(rename = "barLength")]
    pub bar_length: Option<i32>,
    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "chartPanStartTime")]
    pub chart_pan_start_time: Option<String>,
    /// Array containing OHLC bars for the requested period.
    pub data: Option<Vec<SingleHistoricalBarBidAsk>>,
    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
    #[default(Some(-1i32))]
    pub direction: Option<i32>,
    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub high: Option<String>,
    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub low: Option<String>,
    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
    #[serde(rename = "mdAvailability")]
    pub md_availability: Option<String>,
    /// Internal use. Reflects the version of the response schema used.
    #[serde(rename = "messageVersion")]
    pub message_version: Option<i32>,
    /// Number of milliseconds taken to satisfy this historical data request.
    #[serde(rename = "mktDataDelay")]
    pub mkt_data_delay: Option<i32>,
    /// Indicates whether instrument is capable of negative pricing.
    #[serde(rename = "negativeCapable")]
    pub negative_capable: Option<bool>,
    /// Indicates whether data from outside regular trading hours is included in the response.
    #[serde(rename = "outsideRth")]
    pub outside_rth: Option<bool>,
    /// Count of the number of bars returned in the data array.
    pub points: Option<i32>,
    /// Internal use. Governs application of pricing display rule.
    #[serde(rename = "priceDisplayRule")]
    pub price_display_rule: Option<i32>,
    /// Internal use. Governs rendering of displayed pricing.
    #[serde(rename = "priceDisplayValue")]
    pub price_display_value: Option<String>,
    /// Internal use. Used to scale Client Portal chart Y-axis.
    #[serde(rename = "priceFactor")]
    pub price_factor: Option<i32>,
    /// Internal use. Identifier of the request.
    #[serde(rename = "serverId")]
    pub server_id: Option<String>,
    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "startTime")]
    pub start_time: Option<String>,
    /// Symbol of the request instrument.
    pub symbol: Option<String>,
    /// Description or company name of the instrument.
    pub text: Option<String>,
    /// The client-specified period value.
    #[serde(rename = "timePeriod")]
    pub time_period: Option<String>,
    /// Length of instrument's trading day in seconds.
    #[serde(rename = "tradingDayDuration")]
    pub trading_day_duration: Option<i32>,
    /// Internal time in flight to serve the request.
    #[serde(rename = "travelTime")]
    pub travel_time: Option<i32>,
    /// Internal use. Used to scale volume histograms.
    #[serde(rename = "volumeFactor")]
    pub volume_factor: Option<i32>,
}
/// Object containing the requested historical data and related metadata.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct IserverHistoryLastResponse {
    /// The client-specified bar width, represented in seconds.
    #[serde(rename = "barLength")]
    pub bar_length: Option<i32>,
    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "chartPanStartTime")]
    pub chart_pan_start_time: Option<String>,
    /// Array containing OHLC bars for the requested period.
    pub data: Option<Vec<SingleHistoricalBarLast>>,
    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
    #[default(Some(-1i32))]
    pub direction: Option<i32>,
    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub high: Option<String>,
    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub low: Option<String>,
    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
    #[serde(rename = "mdAvailability")]
    pub md_availability: Option<String>,
    /// Internal use. Reflects the version of the response schema used.
    #[serde(rename = "messageVersion")]
    pub message_version: Option<i32>,
    /// Number of milliseconds taken to satisfy this historical data request.
    #[serde(rename = "mktDataDelay")]
    pub mkt_data_delay: Option<i32>,
    /// Indicates whether instrument is capable of negative pricing.
    #[serde(rename = "negativeCapable")]
    pub negative_capable: Option<bool>,
    /// Indicates whether data from outside regular trading hours is included in the response.
    #[serde(rename = "outsideRth")]
    pub outside_rth: Option<bool>,
    /// Count of the number of bars returned in the data array.
    pub points: Option<i32>,
    /// Internal use. Governs application of pricing display rule.
    #[serde(rename = "priceDisplayRule")]
    pub price_display_rule: Option<i32>,
    /// Internal use. Governs rendering of displayed pricing.
    #[serde(rename = "priceDisplayValue")]
    pub price_display_value: Option<String>,
    /// Internal use. Used to scale Client Portal chart Y-axis.
    #[serde(rename = "priceFactor")]
    pub price_factor: Option<i32>,
    /// Internal use. Identifier of the request.
    #[serde(rename = "serverId")]
    pub server_id: Option<String>,
    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "startTime")]
    pub start_time: Option<String>,
    /// Symbol of the request instrument.
    pub symbol: Option<String>,
    /// Description or company name of the instrument.
    pub text: Option<String>,
    /// The client-specified period value.
    #[serde(rename = "timePeriod")]
    pub time_period: Option<String>,
    /// Length of instrument's trading day in seconds.
    #[serde(rename = "tradingDayDuration")]
    pub trading_day_duration: Option<i32>,
    /// Internal time in flight to serve the request.
    #[serde(rename = "travelTime")]
    pub travel_time: Option<i32>,
    /// Internal use. Used to scale volume histograms.
    #[serde(rename = "volumeFactor")]
    pub volume_factor: Option<i32>,
}
/// Object containing the requested historical data and related metadata.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct IserverHistoryMidpointResponse {
    /// The client-specified bar width, represented in seconds.
    #[serde(rename = "barLength")]
    pub bar_length: Option<i32>,
    /// Internal use. UTC datetime string used to center Client Portal charts. Format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "chartPanStartTime")]
    pub chart_pan_start_time: Option<String>,
    /// Array containing OHLC bars for the requested period.
    pub data: Option<Vec<SingleHistoricalBarMidpoint>>,
    /// Indicates how the period is applied in relation to the startTime. Value will always be -1, indicating that the period extends from the startTime forward into the future.
    #[default(Some(-1i32))]
    pub direction: Option<i32>,
    /// Internal use. Delivers highest price value in total interval. Used for chart scaling. A string constructed as 'highestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub high: Option<String>,
    /// Internal use. Delivers lowest price value in total interval. Used for chart scaling. A string constructed as 'lowestPrice*priceFactor/totalVolume*volumeFactor/minutesFromStartTime'.
    pub low: Option<String>,
    /// A three-character string reflecting the nature of available data. R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed. P = Snapshot, p = Consolidated. B = Top of book.
    #[serde(rename = "mdAvailability")]
    pub md_availability: Option<String>,
    /// Internal use. Reflects the version of the response schema used.
    #[serde(rename = "messageVersion")]
    pub message_version: Option<i32>,
    /// Number of milliseconds taken to satisfy this historical data request.
    #[serde(rename = "mktDataDelay")]
    pub mkt_data_delay: Option<i32>,
    /// Indicates whether instrument is capable of negative pricing.
    #[serde(rename = "negativeCapable")]
    pub negative_capable: Option<bool>,
    /// Indicates whether data from outside regular trading hours is included in the response.
    #[serde(rename = "outsideRth")]
    pub outside_rth: Option<bool>,
    /// Count of the number of bars returned in the data array.
    pub points: Option<i32>,
    /// Internal use. Governs application of pricing display rule.
    #[serde(rename = "priceDisplayRule")]
    pub price_display_rule: Option<i32>,
    /// Internal use. Governs rendering of displayed pricing.
    #[serde(rename = "priceDisplayValue")]
    pub price_display_value: Option<String>,
    /// Internal use. Used to scale Client Portal chart Y-axis.
    #[serde(rename = "priceFactor")]
    pub price_factor: Option<i32>,
    /// Internal use. Identifier of the request.
    #[serde(rename = "serverId")]
    pub server_id: Option<String>,
    /// UTC date and time of the start (chronologically earlier) of the complete period in format YYYYMMDD-hh:mm:ss.
    #[serde(rename = "startTime")]
    pub start_time: Option<String>,
    /// Symbol of the request instrument.
    pub symbol: Option<String>,
    /// Description or company name of the instrument.
    pub text: Option<String>,
    /// The client-specified period value.
    #[serde(rename = "timePeriod")]
    pub time_period: Option<String>,
    /// Length of instrument's trading day in seconds.
    #[serde(rename = "tradingDayDuration")]
    pub trading_day_duration: Option<i32>,
    /// Internal time in flight to serve the request.
    #[serde(rename = "travelTime")]
    pub travel_time: Option<i32>,
    /// Internal use. Used to scale volume histograms.
    #[serde(rename = "volumeFactor")]
    pub volume_factor: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParams {
    pub filter_list: Option<Vec<IserverScannerParamsFilterList>>,
    /// Contains all values relevant to the scanner "instrument" request field.
    pub instrument_list: Option<Vec<IserverScannerParamsInstrumentList>>,
    /// Contains all values relevant to the location field of the market scanner request.
    pub location_tree: Option<Vec<IserverScannerParamsLocationTree>>,
    /// Contains all values used as the scanner "type" in the request.
    pub scan_type_list: Option<Vec<IserverScannerParamsScanTypeList>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsFilterList {
    /// Value used for the market scanner request.
    pub code: Option<String>,
    /// combo values when type equals to combo
    pub combo_values: Option<Vec<IserverScannerParamsFilterListComboValue>>,
    /// Returns the human-readable identifier for the filter.
    pub display_name: Option<String>,
    /// Returns the group of filters the request is affiliated with.
    pub group: Option<String>,
    /// Returns the type of value to be used in the request. This can indicate a range based value, or if it should be a single value.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsFilterListComboValue {
    pub default: Option<bool>,
    pub vendor: Option<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsInstrumentList {
    /// Human readable representation of the instrument type.
    pub display_name: Option<String>,
    /// Returns an array of all filters uniquely avaliable to that instrument type.
    pub filters: Option<Vec<serde_json::Value>>,
    /// Value used for the market scanner request.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsLocationTree {
    /// Returns the overarching instrument type to designate the location.
    pub display_name: Option<String>,
    pub locations: Option<Vec<IserverScannerParamsLocationTreeLocation>>,
    /// Returns the code value of the market scanner instrument type value.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsLocationTreeLocation {
    /// Returns the human-readable value of the market scanner's location value.
    pub display_name: Option<String>,
    pub locations: Option<Vec<IserverScannerParamsLocationTreeLocationLocation>>,
    /// Returns the code value of the market scanner location value.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsLocationTreeLocationLocation {
    pub display_name: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerParamsScanTypeList {
    /// Value used for the market scanner request.
    pub code: Option<String>,
    /// Human readable name for the scanner "type"
    pub display_name: Option<String>,
    /// Returns all instruments the scanner type can be used with.
    pub instruments: Option<Vec<serde_json::Value>>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct IserverScannerRunRequest {
    /// Contains any additional filters that should apply to response.
    pub filter: Option<Vec<IserverScannerRunRequestFilter>>,
    /// Instrument type as the target of the market scanner request. Found in the "instrument_list" section of the /iserver/scanner/params response.
    pub instrument: Option<String>,
    /// Location value the market scanner is searching through. Based on the "location_tree" section of the /iserver/scanner/params response.
    pub location: Option<String>,
    /// Scanner value the market scanner is sorted by. Based on the "scan_type_list" section of the /iserver/scanner/params response.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct IserverScannerRunRequestFilter {
    /// Code value of the filter. Based on the "code" value within the "filter_list" section of the /iserver/scanner/params response.
    pub code: Option<String>,
    /// Value corresponding to the input for "code".
    pub value: Option<IserverScannerRunRequestFilterValue>,
}
/// Value corresponding to the input for "code".
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum IserverScannerRunRequestFilterValue {
    #[default]
    String(String),
    Integer(i32),
    Boolean(bool),
    Number(f64),
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerRunResponse {
    /// Contains contracts related to the market scanner request.
    pub contracts: Option<Vec<IserverScannerRunResponseContract>>,
    /// Internal Use Only
    pub scan_data_column_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct IserverScannerRunResponseContract {
    /// Internal Use Only
    pub available_chart_periods: Option<String>,
    /// Always returned for the first contract.
    pub column_name: Option<String>,
    /// Returns the company long name.
    pub company_name: Option<String>,
    /// Returns the contract ID of the contract.
    pub con_id: Option<i32>,
    /// Returns the contract ID of the contract.
    pub conidex: Option<String>,
    /// For derivatives like Futures, the local symbol of the contract will be returned.
    pub contract_description_1: Option<String>,
    /// Returns the primary listing exchange of the contract.
    pub listing_exchange: Option<String>,
    /// Returns the security type of the contract.
    pub sec_type: Option<String>,
    /// Contract's index in relation to the market scanner type's sorting priority.
    pub server_id: Option<String>,
    /// Returns the contract's ticker symbol.
    pub symbol: Option<String>,
}
/// Returns an object for each conId requested.
pub type IserverSnapshot = Vec<IserverSnapshotKind>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum IserverSnapshotKind {
    #[default]
    Variant0(serde_json::Value),
}
/// Contains objects reflecting all currencies in which the account's positions trade.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Ledger {
    /// Additional properties not defined in the schema.
    #[serde(flatten)]
    pub additional_properties: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct LiveOrdersResponse {
    /// Array of orders that are currently working, or were filled/cancelled in the current brokerage session.
    pub orders: Option<Vec<LiveOrdersResponseOrder>>,
    /// Whether the response is a snapshot.
    pub snapshot: Option<bool>,
}
/// Object representing one order.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct LiveOrdersResponseOrder {
    /// IB account ID to which the order was placed.
    pub account: Option<String>,
    /// IB account ID to which the order was placed.
    pub acct: Option<String>,
    /// Average price of fills against the order, if any.
    #[serde(rename = "avgPrice")]
    pub avg_price: Option<String>,
    /// Internal use. IB's UI background color in hex.
    #[serde(rename = "bgColor")]
    pub bg_color: Option<String>,
    /// Currency of the order ticket's Cash Quantity, if applicable.
    #[serde(rename = "cashCcy")]
    pub cash_ccy: Option<String>,
    /// Name of business associated with instrument, or otherwise description of instrument.
    #[serde(rename = "companyName")]
    pub company_name: Option<String>,
    /// Contract ID of the order's instrument.
    pub conid: Option<String>,
    /// Contract ID and routing destination in format 123456@EXCHANGE.
    pub conidex: Option<String>,
    /// Descriptive text, or additional details that specific the instrument.
    pub description1: Option<String>,
    /// Only present for derivatives. Shows Expiry, Strike, Right, And Exchange information.
    pub description2: Option<String>,
    /// Routing destination of the order ticket.
    pub exchange: Option<String>,
    /// Internal use. IB's UI foreground color in hex.
    #[serde(rename = "fgColor")]
    pub fg_color: Option<String>,
    /// Quantity filled in units of the instrument.
    #[serde(rename = "filledQuantity")]
    pub filled_quantity: Option<String>,
    /// Indicates whether the order ticket is an Event Trading order.
    #[serde(rename = "isEventTrading")]
    pub is_event_trading: Option<AlertActivationRequestAlertActive>,
    /// Time of last execution against the order in format YYMMDDhhmmss.
    #[serde(rename = "lastExecutionTime")]
    pub last_execution_time: Option<String>,
    /// Unix timestamp of the last execution against the order.
    #[serde(rename = "lastExecutionTime_r")]
    pub last_execution_time_r: Option<String>,
    /// Exchange on which the instrument is listed.
    #[serde(rename = "listingExchange")]
    pub listing_exchange: Option<String>,
    /// Human-readable shorthand rendering of the order ticket.
    #[serde(rename = "orderDesc")]
    pub order_desc: Option<String>,
    /// IB-assigned order identifier.
    #[serde(rename = "orderId")]
    pub order_id: Option<i32>,
    /// Order type of a working order ticket.
    #[serde(rename = "orderType")]
    pub order_type: Option<String>,
    /// Only present for Cancelled orders. Provides the reason for order to have been cancelled or rejected by the system.
    pub order_cancellation_by_system_reason: Option<String>,
    /// IB internal order status.
    pub order_ccp_status: Option<String>,
    /// Order type of a filled order.
    #[serde(rename = "origOrderType")]
    pub orig_order_type: Option<String>,
    /// Price of the order, if applicable to the order type.
    pub price: Option<String>,
    /// Quantity remaining to be filled in units of the instrument.
    #[serde(rename = "remainingQuantity")]
    pub remaining_quantity: Option<String>,
    /// Asset class of the instrument.
    #[serde(rename = "secType")]
    pub sec_type: Option<String>,
    /// Side of the order.
    pub side: Option<String>,
    /// Human-readable shorthand rendering of the filled and total quantities of the order.
    #[serde(rename = "sizeAndFills")]
    pub size_and_fills: Option<String>,
    /// Status of the order ticket.
    pub status: Option<OrderStatusOrderStatus>,
    /// Indicates whether the order is supported by IB's Tax Optimization tool.
    #[serde(rename = "supportsTaxOpt")]
    pub supports_tax_opt: Option<AlertActivationRequestAlertActive>,
    /// Tax Optimizer id, identifies set of tax lots selected, for gains and losses management.
    #[serde(rename = "taxOptimizerId")]
    pub tax_optimizer_id: Option<String>,
    /// Symbol or base product code of the instrument.
    pub ticker: Option<String>,
    /// Time of force of the order.
    #[serde(rename = "timeInForce")]
    pub time_in_force: Option<String>,
    /// Total size of a cash quantity order.
    #[serde(rename = "totalCashSize")]
    pub total_cash_size: Option<String>,
    /// Total size of an order in the instrument's units.
    #[serde(rename = "totalSize")]
    pub total_size: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct LiveSessionToken200Response {
    /// Diffie-Hellman challenge value used to compute live session token locally by client.
    pub diffie_hellman_challenge: Option<String>,
    /// Unix timestamp in milliseconds of time of live session token computation by IB. Live session tokens are valid for 24 hours from this time.
    pub live_session_token_expiration: Option<i32>,
    /// Signature value used to validate successful client-side computation of live session token.
    pub live_session_token_signature: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct LoginMessage {
    #[serde(rename = "contentId")]
    pub content_id: Option<i32>,
    pub description: Option<String>,
    pub id: Option<i32>,
    #[serde(rename = "messageType")]
    pub message_type: Option<String>,
    #[serde(rename = "recordDate")]
    pub record_date: Option<chrono::DateTime<chrono::Utc>>,
    pub state: Option<String>,
    pub tasks: Option<Vec<i32>>,
    pub username: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct LoginMessageRequest {
    #[serde(rename = "endDate")]
    pub end_date: chrono::NaiveDate,
    #[validate(range(min = 1i32, max = 1_000i32))]
    pub limit: Option<i32>,
    #[validate(range(min = 0i32))]
    pub offset: Option<i32>,
    #[serde(rename = "startDate")]
    pub start_date: chrono::NaiveDate,
    pub status: Option<RequestStatus>,
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct LoginMessageResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "clearingStatus")]
    pub clearing_status: Option<String>,
    #[serde(rename = "clearingStatusDescription")]
    pub clearing_status_description: Option<String>,
    #[serde(rename = "loginMessagePresent")]
    pub login_message_present: Option<bool>,
    #[serde(rename = "loginMessages")]
    pub login_messages: Option<Vec<LoginMessage>>,
}
/// Logs the user out of the gateway session. Any further activity requires re-authentication. Discard client-side cookies upon logout.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct LogoutRequest {}
impl LogoutRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<LogoutResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<StatusResponse4>::json_with_diagnostics(req)
                .await?;
            return Ok(LogoutResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(LogoutResponse::Unauthorized);
        }
        let _ = req.bytes().await?;
        return Ok(LogoutResponse::Unknown);
    }
}
/// Response types for logout
#[derive(Debug, Clone)]
pub enum LogoutResponse {
    ///200: An array of objects detailing contract information.
    Ok(StatusResponse4),
    ///401: Invalid or expired access token
    Unauthorized,
    ///default: Unknown response
    Unknown,
}
/// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
///   * `31` - Last Price. The last price at which the contract traded. May contain one of the following prefixes: C - Previous day's closing price. H - Trading has halted.
///   * `55` - Symbol.
///   * `58` - Text.
///   * `70` - High. Current day high price
///   * `71` - Low. Current day low price
///   * `73` - Market Value. The current market value of your position in the security. Market Value is calculated with real time market data (even when not subscribed to market data).
///   * `74` - Avg Price. The average price of the position.
///   * `75` - Unrealized PnL. Unrealized profit or loss. Unrealized PnL is calculated with real time market data (even when not subscribed to market data).
///   * `76` - Formatted position.
///   * `77` - Formatted Unrealized PnL.
///   * `78` - Daily PnL. Your profit or loss of the day since prior close. Daily PnL is calculated with real time market data (even when not subscribed to market data).
///   * `79` - Realized PnL. Realized profit or loss. Realized PnL is calculated with real time market data (even when not subscribed to market data).
///   * `80` - Unrealized PnL %. Unrealized profit or loss expressed in percentage.
///   * `82` - Change. The difference between the last price and the close on the previous trading day
///   * `83` - Change %. The difference between the last price and the close on the previous trading day in percentage.
///   * `84` - Bid Price. The highest-priced bid on the contract.
///   * `85` - Ask Size. The number of contracts or shares offered at the ask price. For US stocks
///   * `86` - Ask Price. The lowest-priced offer on the contract.
///   * `87` - Volume. Volume for the day
///   * `88` - Bid Size. The number of contracts or shares bid for at the bid price. For US stocks
///   * `201` - Right. Declares the Right of the Option, Call or Put.
///   * `6004` - Exchange.
///   * `6008` - Conid. Contract identifier from IBKR's database.
///   * `6070` - SecType. The asset class of the instrument.
///   * `6072` - Months.
///   * `6073` - Regular Expiry.
///   * `6119` - Marker for market data delivery method (similar to request id).
///   * `6457` - Underlying Conid. Use /trsrv/secdef to get more information about the security.
///   * `6508` - Service Params..
///   * `6509` - Market Data Availability. The field may contain three chars. First char defines: R = RealTime, D = Delayed, Z = Frozen, Y = Frozen Delayed, N = Not Subscribed, i - incomplete, v - VDR Exempt (Vendor Display Rule 603c). Second char defines: P = Snapshot, p = Consolidated. Third char defines: B = Book. RealTime Data is relayed back in real time without delay, market data subscription(s) are required. Delayed - Data is relayed back 15-20 min delayed. Frozen - Last recorded data at market close.  relayed back in real time. Frozen Delayed - Last recorded data at market close, relayed back delayed. Not Subscribed - User does not have the required market data subscription(s) to relay back either real time or delayed data. Snapshot - Snapshot request is available for contract. Consolidated - Market data is aggregated across multiple exchanges or venues. Book - Top of the book data is available for contract.
///   * `7051` - Company name.
///   * `7057` - Ask Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
///   * `7058` - Last Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
///   * `7059` - Last Size. The number of unites traded at the last price
///   * `7068` - Bid Exch. Displays the exchange(s) offering the SMART price. A=AMEX, C=CBOE, I=ISE, X=PHLX, N=PSE, B=BOX, Q=NASDAQOM, Z=BATS, W=CBOE2, T=NASDAQBX, M=MIAX, H=GEMINI, E=EDGX, J=MERCURY
///   * `7084` - Implied Vol./Hist. Vol %. The ratio of the implied volatility over the historical volatility, expressed as a percentage.
///   * `7085` - Put/Call Interest. Put option open interest/call option open interest for the trading day.
///   * `7086` - Put/Call Volume. Put option volume/call option volume for the trading day.
///   * `7087` - Hist. Vol. %. 30-day real-time historical volatility.
///   * `7088` - Hist. Vol. Close %. Shows the historical volatility based on previous close price.
///   * `7089` - Opt. Volume. Option Volume
///   * `7094` - Conid + Exchange.
///   * `7184` - canBeTraded. If contract is a trade-able instrument. Returns 1(true) or 0(false).
///   * `7219` - Contract Description.
///   * `7220` - Contract Description.
///   * `7221` - Listing Exchange.
///   * `7280` - Industry. Displays the type of industry under which the underlying company can be categorized.
///   * `7281` - Category. Displays a more detailed level of description within the industry under which the underlying company can be categorized.
///   * `7282` - Average Volume. The average daily trading volume over 90 days.
///   * `7283` - Option Implied Vol. %. A prediction of how volatile an underlying will be in the future.At the market volatility estimated for a maturity thirty calendar days forward of the current trading day, and based on option prices from two consecutive expiration months. To query the Implied Vol. % of a specific strike refer to field 7633.
///   * `7284` - Historical volatility %. Deprecated
///   * `7285` - Put/Call Ratio.
///   * `7292` - Cost Basis. Your current position in this security multiplied by the average price and multiplier.
///   * `7293` - 52 Week High. The highest price for the past 52 weeks.
///   * `7294` - 52 Week Low. The lowest price for the past 52 weeks.
///   * `7295` - Open. Today's opening price.
///   * `7296` - Close. Today's closing price.
///   * `7308` - Delta. The ratio of the change in the price of the option to the corresponding change in the price of the underlying.
///   * `7309` - Gamma. The rate of change for the delta with respect to the underlying asset's price.
///   * `7310` - Theta. A measure of the rate of decline the value of an option due to the passage of time.
///   * `7311` - Vega. The amount that the price of an option changes compared to a 1% change in the volatility.
///   * `7607` - Opt. Volume Change %. Today's option volume as a percentage of the average option volume.
///   * `7633` - Implied Vol. %. The implied volatility for the specific strike of the option in percentage. To query the Option Implied Vol. % from the underlying refer to field 7283.
///   * `7635` - Mark. The mark price is
///   * `7636` - Shortable Shares. Number of shares available for shorting.
///   * `7637` - Fee Rate. Interest rate charged on borrowed shares.
///   * `7638` - Option Open Interest.
///   * `7639` - % of Mark Value. Displays the market value of the contract as a percentage of the total market value of the account. Mark Value is calculated with real time market data (even when not subscribed to market data).
///   * `7644` - Shortable. Describes the level of difficulty with which the security can be sold short.
///   * `7671` - Dividends. This value is the total of the expected dividend payments over the next twelve months per share.
///   * `7672` - Dividends TTM. This value is the total of the expected dividend payments over the last twelve months per share.
///   * `7674` - EMA(200). Exponential moving average (N=200).
///   * `7675` - EMA(100). Exponential moving average (N=100).
///   * `7676` - EMA(50). Exponential moving average (N=50).
///   * `7677` - EMA(20). Exponential moving average (N=20).
///   * `7678` - Price/EMA(200). Price to Exponential moving average (N=200) ratio -1
///   * `7679` - Price/EMA(100). Price to Exponential moving average (N=100) ratio -1
///   * `7724` - Price/EMA(50). Price to Exponential moving average (N=50) ratio -1
///   * `7681` - Price/EMA(20). Price to Exponential moving average (N=20) ratio -1
///   * `7682` - Change Since Open. The difference between the last price and the open price.
///   * `7683` - Upcoming Event. Shows the next major company event. Requires Wall Street Horizon subscription.
///   * `7684` - Upcoming Event Date. The date of the next major company event. Requires Wall Street Horizon subscription.
///   * `7685` - Upcoming Analyst Meeting. The date and time of the next scheduled analyst meeting. Requires Wall Street Horizon subscription.
///   * `7686` - Upcoming Earnings. The date and time of the next scheduled earnings/earnings call event. Requires Wall Street Horizon subscription.
///   * `7687` - Upcoming Misc Event. The date and time of the next shareholder meeting
///   * `7688` - Recent Analyst Meeting. The date and time of the most recent analyst meeting. Requires Wall Street Horizon subscription.
///   * `7689` - Recent Earnings. The date and time of the most recent earnings/earning call event. Requires Wall Street Horizon subscription.
///   * `7690` - Recent Misc Event. The date and time of the most recent shareholder meeting
///   * `7694` - Probability of Max Return. Customer implied probability of maximum potential gain.
///   * `7695` - Break Even. Break even points
///   * `7696` - SPX Delta. Beta Weighted Delta is calculated using the formula; Delta x dollar adjusted beta
///   * `7697` - Futures Open Interest. Total number of outstanding futures contracts
///   * `7698` - Last Yield. Implied yield of the bond if it is purchased at the current last price. Last yield is calculated using the Last price on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
///   * `7699` - Bid Yield. Implied yield of the bond if it is purchased at the current bid price. Bid yield is calculated using the Ask on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
///   * `7700` - Probability of Max Return. Customer implied probability of maximum potential gain.
///   * `7702` - Probability of Max Loss. Customer implied probability of maximum potential loss.
///   * `7703` - Profit Probability. Customer implied probability of any gain.
///   * `7704` - Organization Type.
///   * `7705` - Debt Class.
///   * `7706` - Ratings. Ratings issued for bond contract.
///   * `7707` - Bond State Code.
///   * `7708` - Bond Type.
///   * `7714` - Last Trading Date.
///   * `7715` - Issue Date.
///   * `7720` - Ask Yield. Implied yield of the bond if it is purchased at the current offer. Ask yield is calculated using the Bid on all possible call dates. It is assumed that prepayment occurs if the bond has call or put provisions and the issuer can offer a lower coupon rate based on current market rates. The yield to worst will be the lowest of the yield to maturity or yield to call (if the bond has prepayment provisions). Yield to worse may be the same as yield to maturity but never higher.
///   * `7741` - Prior Close. Yesterday's closing price
///   * `7762` - Volume Long. High precision volume for the day. For formatted volume refer to field 87.
///   * `7768` - hasTradingPermissions. if user has trading permissions for specified contract. Returns 1(true) or 0(false).
///   * `7899` - Stock Type. Determines the stock type. Includes: Common, CORP, ADR, ETF, ETN, EFN, REIT, CEF, ETMF.
///   * `7920` - Daily PnL Raw. Your profit or loss of the day since prior close. Daily PnL is calculated with real-time market data (even when not subscribed to market data).
///   * `7921` - Cost Basis Raw. Your current position in this security multiplied by the average price and and multiplier.
///   * `7943` - Rebate Rate. Fed funds or other currency-relevant Benchmark rate minus the interest rate charged on borrowed shares.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum MdFields {
    #[serde(rename = "31")]
    #[default]
    T31,
    #[serde(rename = "55")]
    T55,
    #[serde(rename = "58")]
    T58,
    #[serde(rename = "70")]
    T70,
    #[serde(rename = "71")]
    T71,
    #[serde(rename = "73")]
    T73,
    #[serde(rename = "74")]
    T74,
    #[serde(rename = "75")]
    T75,
    #[serde(rename = "76")]
    T76,
    #[serde(rename = "77")]
    T77,
    #[serde(rename = "78")]
    T78,
    #[serde(rename = "79")]
    T79,
    #[serde(rename = "80")]
    T80,
    #[serde(rename = "82")]
    T82,
    #[serde(rename = "83")]
    T83,
    #[serde(rename = "84")]
    T84,
    #[serde(rename = "85")]
    T85,
    #[serde(rename = "86")]
    T86,
    #[serde(rename = "87")]
    T87,
    #[serde(rename = "88")]
    T88,
    #[serde(rename = "6004")]
    T6004,
    #[serde(rename = "6008")]
    T6008,
    #[serde(rename = "6070")]
    T6070,
    #[serde(rename = "6072")]
    T6072,
    #[serde(rename = "6073")]
    T6073,
    #[serde(rename = "6119")]
    T6119,
    #[serde(rename = "6457")]
    T6457,
    #[serde(rename = "6508")]
    T6508,
    #[serde(rename = "6509")]
    T6509,
    #[serde(rename = "7051")]
    T7051,
    #[serde(rename = "7057")]
    T7057,
    #[serde(rename = "7058")]
    T7058,
    #[serde(rename = "7059")]
    T7059,
    #[serde(rename = "7068")]
    T7068,
    #[serde(rename = "7084")]
    T7084,
    #[serde(rename = "7085")]
    T7085,
    #[serde(rename = "7086")]
    T7086,
    #[serde(rename = "7087")]
    T7087,
    #[serde(rename = "7088")]
    T7088,
    #[serde(rename = "7089")]
    T7089,
    #[serde(rename = "7094")]
    T7094,
    #[serde(rename = "7184")]
    T7184,
    #[serde(rename = "7219")]
    T7219,
    #[serde(rename = "7220")]
    T7220,
    #[serde(rename = "7221")]
    T7221,
    #[serde(rename = "7280")]
    T7280,
    #[serde(rename = "7281")]
    T7281,
    #[serde(rename = "7282")]
    T7282,
    #[serde(rename = "7283")]
    T7283,
    #[serde(rename = "7284")]
    T7284,
    #[serde(rename = "7285")]
    T7285,
    #[serde(rename = "7292")]
    T7292,
    #[serde(rename = "7293")]
    T7293,
    #[serde(rename = "7294")]
    T7294,
    #[serde(rename = "7295")]
    T7295,
    #[serde(rename = "7296")]
    T7296,
    #[serde(rename = "7308")]
    T7308,
    #[serde(rename = "7309")]
    T7309,
    #[serde(rename = "7310")]
    T7310,
    #[serde(rename = "7311")]
    T7311,
    #[serde(rename = "7607")]
    T7607,
    #[serde(rename = "7633")]
    T7633,
    #[serde(rename = "7635")]
    T7635,
    #[serde(rename = "7636")]
    T7636,
    #[serde(rename = "7637")]
    T7637,
    #[serde(rename = "7638")]
    T7638,
    #[serde(rename = "7639")]
    T7639,
    #[serde(rename = "7644")]
    T7644,
    #[serde(rename = "7671")]
    T7671,
    #[serde(rename = "7672")]
    T7672,
    #[serde(rename = "7674")]
    T7674,
    #[serde(rename = "7675")]
    T7675,
    #[serde(rename = "7676")]
    T7676,
    #[serde(rename = "7677")]
    T7677,
    #[serde(rename = "7678")]
    T7678,
    #[serde(rename = "7679")]
    T7679,
    #[serde(rename = "7724")]
    T7724,
    #[serde(rename = "7681")]
    T7681,
    #[serde(rename = "7682")]
    T7682,
    #[serde(rename = "7683")]
    T7683,
    #[serde(rename = "7684")]
    T7684,
    #[serde(rename = "7685")]
    T7685,
    #[serde(rename = "7686")]
    T7686,
    #[serde(rename = "7687")]
    T7687,
    #[serde(rename = "7688")]
    T7688,
    #[serde(rename = "7689")]
    T7689,
    #[serde(rename = "7690")]
    T7690,
    #[serde(rename = "7694")]
    T7694,
    #[serde(rename = "7695")]
    T7695,
    #[serde(rename = "7696")]
    T7696,
    #[serde(rename = "7697")]
    T7697,
    #[serde(rename = "7698")]
    T7698,
    #[serde(rename = "7699")]
    T7699,
    #[serde(rename = "7700")]
    T7700,
    #[serde(rename = "7702")]
    T7702,
    #[serde(rename = "7703")]
    T7703,
    #[serde(rename = "7704")]
    T7704,
    #[serde(rename = "7705")]
    T7705,
    #[serde(rename = "7706")]
    T7706,
    #[serde(rename = "7707")]
    T7707,
    #[serde(rename = "7708")]
    T7708,
    #[serde(rename = "7714")]
    T7714,
    #[serde(rename = "7715")]
    T7715,
    #[serde(rename = "7720")]
    T7720,
    #[serde(rename = "7741")]
    T7741,
    #[serde(rename = "7762")]
    T7762,
    #[serde(rename = "7768")]
    T7768,
    #[serde(rename = "7920")]
    T7920,
    #[serde(rename = "7921")]
    T7921,
    #[serde(rename = "7943")]
    T7943,
}
impl core::fmt::Display for MdFields {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::T31 => write!(f, "31"),
            Self::T55 => write!(f, "55"),
            Self::T58 => write!(f, "58"),
            Self::T70 => write!(f, "70"),
            Self::T71 => write!(f, "71"),
            Self::T73 => write!(f, "73"),
            Self::T74 => write!(f, "74"),
            Self::T75 => write!(f, "75"),
            Self::T76 => write!(f, "76"),
            Self::T77 => write!(f, "77"),
            Self::T78 => write!(f, "78"),
            Self::T79 => write!(f, "79"),
            Self::T80 => write!(f, "80"),
            Self::T82 => write!(f, "82"),
            Self::T83 => write!(f, "83"),
            Self::T84 => write!(f, "84"),
            Self::T85 => write!(f, "85"),
            Self::T86 => write!(f, "86"),
            Self::T87 => write!(f, "87"),
            Self::T88 => write!(f, "88"),
            Self::T6004 => write!(f, "6004"),
            Self::T6008 => write!(f, "6008"),
            Self::T6070 => write!(f, "6070"),
            Self::T6072 => write!(f, "6072"),
            Self::T6073 => write!(f, "6073"),
            Self::T6119 => write!(f, "6119"),
            Self::T6457 => write!(f, "6457"),
            Self::T6508 => write!(f, "6508"),
            Self::T6509 => write!(f, "6509"),
            Self::T7051 => write!(f, "7051"),
            Self::T7057 => write!(f, "7057"),
            Self::T7058 => write!(f, "7058"),
            Self::T7059 => write!(f, "7059"),
            Self::T7068 => write!(f, "7068"),
            Self::T7084 => write!(f, "7084"),
            Self::T7085 => write!(f, "7085"),
            Self::T7086 => write!(f, "7086"),
            Self::T7087 => write!(f, "7087"),
            Self::T7088 => write!(f, "7088"),
            Self::T7089 => write!(f, "7089"),
            Self::T7094 => write!(f, "7094"),
            Self::T7184 => write!(f, "7184"),
            Self::T7219 => write!(f, "7219"),
            Self::T7220 => write!(f, "7220"),
            Self::T7221 => write!(f, "7221"),
            Self::T7280 => write!(f, "7280"),
            Self::T7281 => write!(f, "7281"),
            Self::T7282 => write!(f, "7282"),
            Self::T7283 => write!(f, "7283"),
            Self::T7284 => write!(f, "7284"),
            Self::T7285 => write!(f, "7285"),
            Self::T7292 => write!(f, "7292"),
            Self::T7293 => write!(f, "7293"),
            Self::T7294 => write!(f, "7294"),
            Self::T7295 => write!(f, "7295"),
            Self::T7296 => write!(f, "7296"),
            Self::T7308 => write!(f, "7308"),
            Self::T7309 => write!(f, "7309"),
            Self::T7310 => write!(f, "7310"),
            Self::T7311 => write!(f, "7311"),
            Self::T7607 => write!(f, "7607"),
            Self::T7633 => write!(f, "7633"),
            Self::T7635 => write!(f, "7635"),
            Self::T7636 => write!(f, "7636"),
            Self::T7637 => write!(f, "7637"),
            Self::T7638 => write!(f, "7638"),
            Self::T7639 => write!(f, "7639"),
            Self::T7644 => write!(f, "7644"),
            Self::T7671 => write!(f, "7671"),
            Self::T7672 => write!(f, "7672"),
            Self::T7674 => write!(f, "7674"),
            Self::T7675 => write!(f, "7675"),
            Self::T7676 => write!(f, "7676"),
            Self::T7677 => write!(f, "7677"),
            Self::T7678 => write!(f, "7678"),
            Self::T7679 => write!(f, "7679"),
            Self::T7724 => write!(f, "7724"),
            Self::T7681 => write!(f, "7681"),
            Self::T7682 => write!(f, "7682"),
            Self::T7683 => write!(f, "7683"),
            Self::T7684 => write!(f, "7684"),
            Self::T7685 => write!(f, "7685"),
            Self::T7686 => write!(f, "7686"),
            Self::T7687 => write!(f, "7687"),
            Self::T7688 => write!(f, "7688"),
            Self::T7689 => write!(f, "7689"),
            Self::T7690 => write!(f, "7690"),
            Self::T7694 => write!(f, "7694"),
            Self::T7695 => write!(f, "7695"),
            Self::T7696 => write!(f, "7696"),
            Self::T7697 => write!(f, "7697"),
            Self::T7698 => write!(f, "7698"),
            Self::T7699 => write!(f, "7699"),
            Self::T7700 => write!(f, "7700"),
            Self::T7702 => write!(f, "7702"),
            Self::T7703 => write!(f, "7703"),
            Self::T7704 => write!(f, "7704"),
            Self::T7705 => write!(f, "7705"),
            Self::T7706 => write!(f, "7706"),
            Self::T7707 => write!(f, "7707"),
            Self::T7708 => write!(f, "7708"),
            Self::T7714 => write!(f, "7714"),
            Self::T7715 => write!(f, "7715"),
            Self::T7720 => write!(f, "7720"),
            Self::T7741 => write!(f, "7741"),
            Self::T7762 => write!(f, "7762"),
            Self::T7768 => write!(f, "7768"),
            Self::T7920 => write!(f, "7920"),
            Self::T7921 => write!(f, "7921"),
            Self::T7943 => write!(f, "7943"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct MessageIdRequestBody {
    /// Array of order reply messageId identifier strings to be suppressed.
    #[serde(rename = "messageIds")]
    pub message_ids: Option<Vec<MessageIdRequestBodyMessageId>>,
}
/// A warning message to be pre-approved.
///   * `o163` - The following order exceeds the price percentage limit
///   * `o354` - """You are submitting an order without market data. We strongly recommend against this as it may result in erroneous and unexpected trades. Are you sure you want to submit this order?"""
///   * `o382` - The following value exceeds the tick size limit
///   * `o383` - """The following order \""BUY 650 AAPL NASDAQ.NMS\"" size exceeds the Size Limit of 500.
/// Are you sure you want to submit this order?"""
///   * `o403` - """This order will most likely trigger and fill immediately.
/// Are you sure you want to submit this order?"""
///   * `o451` - """The following order \""BUY 650 AAPL NASDAQ.NMS\"" value estimate of 124,995.00 USD exceeds
/// the Total Value Limit of 100,000 USD.
/// Are you sure you want to submit this order?"""
///   * `o2136` - Mixed allocation order warning
///   * `o2137` - Cross side order warning
///   * `o2165` - Warns that instrument does not support trading in fractions outside regular trading hours
///   * `o10082` - Called Bond warning
///   * `o10138` - The following order size modification exceeds the size modification limit.
///   * `o10151` - Warns about risks with Market Orders
///   * `o10152` - Warns about risks associated with stop orders once they become active
///   * `o10153` - <h4>Confirm Mandatory Cap Price</h4>To avoid trading at a price that is not consistent with a fair and orderly market, IB may set a cap (for a buy order) or sell order). THIS MAY CAUSE AN ORDER THAT WOULD OTHERWISE BE MARKETABLE TO NOT BE TRADED.
///   * `o10164` - """Traders are responsible for understanding cash quantity details, which are provided on a best efforts basis only."""
///   * `o10223` - """<h4>Cash Quantity Order Confirmation</h4>Orders that express size using a monetary value (cash quantity) are provided on a non-guaranteed basis. The system simulates the order by cancelling it once the specified amount is spent (for buy orders) or collected (for sell orders). In addition to the monetary value, the order uses a maximum size that is calculated using the Cash Quantity Estimate Factor, which you can modify in Presets."""
///   * `o10288` - Warns about risks associated with market orders for Crypto
///   * `o10331` - """You are about to submit a stop order. Please be aware of the various stop order types available and the risks associated with each one.
/// Are you sure you want to submit this order?"""
///   * `o10332` - OSL Digital Securities LTD Crypto Order Warning
///   * `o10333` - Option Exercise at the Money warning
///   * `o10334` - Warns that order will be placed into current omnibus account instead of currently selected global account.
///   * `o10335` - Serves internal Rapid Entry window.
///   * `o10336` - This security has limited liquidity. If you choose to trade this security, there is a heightened risk that you may not be able to close your position at the time you wish, at a price you wish, and/or without incurring a loss. Confirm that you understand the risks of trading illiquid securities.
///   * `Are you sure you want to submit this order?
///   * `p6` - This order will be distributed over multiple accounts. We strongly suggest you familiarize yourself with our allocation facilities before submitting orders.
///   * `p12` - "If your order is not immediately executable, our systems may, depending on market conditions, reject your order if its limit price is more than the allowed amount away from the reference price at that time. If this happens, you will not receive a fill. This is a control designed to ensure that we comply with our regulatory obligations to avoid submitting disruptive orders to the marketplace.\
/// Use the Price Management Algo?"
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum MessageIdRequestBodyMessageId {
    #[serde(rename = "o163")]
    #[default]
    O163,
    #[serde(rename = "o354")]
    O354,
    #[serde(rename = "o382")]
    O382,
    #[serde(rename = "o383")]
    O383,
    #[serde(rename = "o403")]
    O403,
    #[serde(rename = "o451")]
    O451,
    #[serde(rename = "o2136")]
    O2136,
    #[serde(rename = "o2137")]
    O2137,
    #[serde(rename = "o2165")]
    O2165,
    #[serde(rename = "o10082")]
    O10082,
    #[serde(rename = "o10138")]
    O10138,
    #[serde(rename = "o10151")]
    O10151,
    #[serde(rename = "o10152")]
    O10152,
    #[serde(rename = "o10153")]
    O10153,
    #[serde(rename = "o10164")]
    O10164,
    #[serde(rename = "o10223")]
    O10223,
    #[serde(rename = "o10288")]
    O10288,
    #[serde(rename = "o10331")]
    O10331,
    #[serde(rename = "o10332")]
    O10332,
    #[serde(rename = "o10333")]
    O10333,
    #[serde(rename = "o10334")]
    O10334,
    #[serde(rename = "o10335")]
    O10335,
    #[serde(rename = "o10336")]
    O10336,
    #[serde(rename = "p6")]
    P6,
    #[serde(rename = "p12")]
    P12,
}
impl core::fmt::Display for MessageIdRequestBodyMessageId {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::O163 => write!(f, "o163"),
            Self::O354 => write!(f, "o354"),
            Self::O382 => write!(f, "o382"),
            Self::O383 => write!(f, "o383"),
            Self::O403 => write!(f, "o403"),
            Self::O451 => write!(f, "o451"),
            Self::O2136 => write!(f, "o2136"),
            Self::O2137 => write!(f, "o2137"),
            Self::O2165 => write!(f, "o2165"),
            Self::O10082 => write!(f, "o10082"),
            Self::O10138 => write!(f, "o10138"),
            Self::O10151 => write!(f, "o10151"),
            Self::O10152 => write!(f, "o10152"),
            Self::O10153 => write!(f, "o10153"),
            Self::O10164 => write!(f, "o10164"),
            Self::O10223 => write!(f, "o10223"),
            Self::O10288 => write!(f, "o10288"),
            Self::O10331 => write!(f, "o10331"),
            Self::O10332 => write!(f, "o10332"),
            Self::O10333 => write!(f, "o10333"),
            Self::O10334 => write!(f, "o10334"),
            Self::O10335 => write!(f, "o10335"),
            Self::O10336 => write!(f, "o10336"),
            Self::P6 => write!(f, "p6"),
            Self::P12 => write!(f, "p12"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct MessageResponse {
    /// Indicates success or failure of request to discard cached positions.
    pub message: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelListResponse {
    /// Base currency of the established model.
    #[serde(rename = "baseCcy")]
    pub base_ccy: Option<String>,
    /// Advisor account responsible for the model.
    #[serde(rename = "masterAccount")]
    pub master_account: Option<String>,
    /// List of all models held under the masterAccount.
    pub models: Option<Vec<ModelListResponseItem>>,
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_607i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelListResponseItem {
    /// Used internally for client portal designation. Should be ignored.
    pub bootstrapped: Option<bool>,
    /// Used internally for client portal. Should be ignored.
    #[serde(rename = "customIndex")]
    pub custom_index: Option<bool>,
    /// Personal description of model to read in IBKR GUI elements.
    pub desc: Option<String>,
    /// Determine if investing and rebalancing should be handled statically or dynamically. * `true` - Static models will always use the original targets. * `false` - Dynamic models will adjust allocation in response to market movements.
    #[serde(rename = "isStatic")]
    pub is_static: Option<bool>,
    /// Notes if the Actual allocation has become misalligned with the Target.
    pub mismatch: Option<bool>,
    /// Name of the model.
    pub model: Option<String>,
    /// Market value of the model.
    pub nlv: Option<f64>,
    /// Lists the number of accounts held within the model.
    #[serde(rename = "numAccounts")]
    pub num_accounts: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelPositionResponse {
    /// An object representing each currency held in the model.
    pub cash: Option<Vec<ModelPositionResponseCash>>,
    /// Notes if the Actual allocation has become misalligned with the Target.
    pub mismatched: Option<bool>,
    /// Name of the model.
    pub model: Option<String>,
    /// Market value of the model.
    pub nlv: Option<f64>,
    /// List of object containing each equity in the model.
    #[serde(rename = "positionList")]
    pub position_list: Option<Vec<ModelPositionResponsePositionList>>,
    /// Epoch timestamp when the position was retrieved.
    #[serde(rename = "positionTs")]
    pub position_ts: Option<i64>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Describes if the model contains only stocks.
    #[serde(rename = "stkOnly")]
    pub stk_only: Option<bool>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
    /// Diplayed total liquidation value of the model.
    #[serde(rename = "totalDlv")]
    pub total_dlv: Option<f64>,
    /// Market value of the entire position.
    #[serde(rename = "totalMv")]
    pub total_mv: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelPositionResponseCash {
    /// Actual percent of the model held in the postion.
    pub actual: Option<f64>,
    /// Currency symbol.
    pub ccy: Option<String>,
    /// Exchange rate of the account base currency to the model base currency.
    #[serde(rename = "exchangeRate")]
    pub exchange_rate: Option<f64>,
    /// Describes the percentage of imbalance of the actual allocation from the model.
    #[serde(rename = "instrumentImbalance")]
    pub instrument_imbalance: Option<f64>,
    /// Market value of the position.
    pub mv: Option<f64>,
    /// Target percentage of the model to hold in the position.
    pub target: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelPositionResponsePositionList {
    /// Actual percent of the model held in the postion.
    pub actual: Option<f64>,
    /// Maximum accepted tolerance above the target.
    #[serde(rename = "actualRangeMax")]
    pub actual_range_max: Option<f64>,
    /// Minimum accepted tolerance below the target.
    #[serde(rename = "actualRangeMin")]
    pub actual_range_min: Option<f64>,
    /// Currency symbol.
    pub ccy: Option<String>,
    /// Contract identifier for the instrument.
    pub conid: Option<f64>,
    /// Displayed liquidation value.
    pub dlv: Option<f64>,
    /// Used internally for client portal. Should be ignored.
    #[serde(rename = "exchangeRate")]
    pub exchange_rate: Option<f64>,
    /// Used internally for client portal. Should be ignored.
    pub flags: Option<i32>,
    /// Symbol of the position.
    pub instrument: Option<String>,
    /// Describes the percentage of imbalance of the actual allocation from the model.
    #[serde(rename = "instrumentImbalance")]
    pub instrument_imbalance: Option<f64>,
    /// Used internally for client portal. Should be ignored.
    #[serde(rename = "mismatchType")]
    pub mismatch_type: Option<f64>,
    /// Market Value.
    pub mv: Option<f64>,
    /// The total size of the position held in the model.
    pub position: Option<f64>,
    /// The desired allocation percentage of the position in the model.
    pub target: Option<f64>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
pub struct ModelPresetsResponse {
    /// Avoid negative offsetting cash in Independent
    #[serde(rename = "avoidNegativeCashInIndependent")]
    pub avoid_negative_cash_in_independent: Option<bool>,
    /// Close out the full position while divesting.
    #[serde(rename = "closeDivestIndependentPosition")]
    pub close_divest_independent_position: Option<bool>,
    /// Use the maximum avialble funds to increase long positions.
    #[serde(rename = "fullyInvestExistingLongPositions")]
    pub fully_invest_existing_long_positions: Option<bool>,
    /// Keep model open for fully divested accounts.
    #[serde(rename = "keepModelOpen")]
    pub keep_model_open: Option<bool>,
    /// Transfer positions to Independent instead of liquidating.
    #[serde(rename = "preferCrossWithIndependent")]
    pub prefer_cross_with_independent: Option<bool>,
    /// Transfer positions from Independent structure when possible.
    #[serde(rename = "preferTransferFromIndependent")]
    pub prefer_transfer_from_independent: Option<bool>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Determine if allocation quantities should be handled by lot size.
    #[serde(rename = "roundAllocationQuantityToExchangeBoardLot")]
    pub round_allocation_quantity_to_exchange_board_lot: Option<bool>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
    /// Use non-base balances when available.
    #[serde(rename = "useNonBaseCcy")]
    pub use_non_base_ccy: Option<bool>,
    /// Designate of tolerance ranges should be used for rebalancing.
    #[serde(rename = "useToleranceRange")]
    pub use_tolerance_range: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ModelSummaryResponse {
    /// Used internally for client portal designation. Should be ignored.
    pub bootstrapped: Option<bool>,
    /// Used internally for client portal. Should be ignored.
    #[serde(rename = "customIndex")]
    pub custom_index: Option<bool>,
    /// Personal description of model to read in IBKR GUI elements.
    pub desc: Option<String>,
    /// Determine if investing and rebalancing should be handled statically or dynamically. * `true` - Static models will always use the original targets. * `false` - Dynamic models will adjust allocation in response to market movements.
    #[serde(rename = "isStatic")]
    pub is_static: Option<bool>,
    /// Notes if the Actual allocation has become misalligned with the Target.
    pub mismatch: Option<bool>,
    /// Name of the model.
    pub model: Option<String>,
    /// Net Liquidation of the model.
    pub nlv: Option<f64>,
    /// Lists the number of accounts held within the model.
    #[serde(rename = "numAccounts")]
    pub num_accounts: Option<i32>,
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_609i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
}
/// Modify an existing allocation group.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyAllocationGroupRequest {
    #[validate(nested)]
    pub body: GroupRequestBody,
}
impl ModifyAllocationGroupRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<CreateAllocationGroupResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<SuccessResponse>::json_with_diagnostics(req)
                .await?;
            return Ok(CreateAllocationGroupResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(CreateAllocationGroupResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(CreateAllocationGroupResponse::Unknown);
    }
}
/// Choose whether a particular device is enabled or disabled.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyFyiDeliveryRequest {
    pub body: FyiEnableDeviceOption,
}
impl ModifyFyiDeliveryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ModifyFyiDeliveryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
            return Ok(ModifyFyiDeliveryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ModifyFyiDeliveryResponse::Unknown);
    }
}
/// Response types for modifyFyiDelivery
#[derive(Debug, Clone)]
pub enum ModifyFyiDeliveryResponse {
    ///200: Successfully retrieve preset details
    Ok(FyiVT),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Enable or disable your account's primary email to receive notifications.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyFyiEmailsRequest {
    pub query: ModifyFyiEmailsRequestQuery,
}
impl ModifyFyiEmailsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyFyiEmailsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
            return Ok(ModifyFyiEmailsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ModifyFyiEmailsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ModifyFyiEmailsRequestQuery {
    /// Enable or disable your email. Value format: true: Enable; false: Disable
    pub enabled: serde_json::Value,
}
/// Response types for modifyFyiEmails
#[derive(Debug, Clone)]
pub enum ModifyFyiEmailsResponse {
    ///200: Successfully enabled or disabled your email notifications.
    Ok(FyiVT),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Enable or disable group of notifications by the specific typecode.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyFyiNotificationRequest {
    pub path: ModifyFyiNotificationRequestPath,
    pub body: EnabledRequestBody,
}
impl ModifyFyiNotificationRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyFyiEmailsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
            return Ok(ModifyFyiEmailsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiEmailsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ModifyFyiEmailsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ModifyFyiNotificationRequestPath {
    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
    ///   * `BA` - Borrow Availability
    ///   * `CA` - Comparable Algo
    ///   * `DA` - Dividends Advisory
    ///   * `EA` - Upcoming Earnings
    ///   * `MF` - Mutual Fund Advisory
    ///   * `OE` - Option Expiration
    ///   * `PR` - Portfolio Builder Rebalance
    ///   * `SE` - Suspend Order on Economic Event
    ///   * `SG` - Short Term Gain turning Long Term
    ///   * `SM` - System Messages
    ///   * `T2` - Assignment Realizing Long-Term Gains
    ///   * `TO` - Takeover
    ///   * `UA` - User Alert
    ///   * `M8` - M871 Trades
    ///   * `PS` - Platform Use Suggestions
    ///   * `DL` - Unexercised Option Loss Prevention Reminder
    ///   * `PT` - Position Transfer
    ///   * `CB` - Missing Cost Basis
    ///   * `MS` - Milestones
    ///   * `TD` - MiFID || 10% Deprecation Notice
    ///   * `ST` - Save Taxes
    ///   * `TI` - Trade Idea
    ///   * `CT` - Cash Transfer
    pub typecode: Typecodes,
}
/// Modify an existing, unfilled order.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyOpenOrderRequest {
    #[validate(nested)]
    pub path: ModifyOpenOrderRequestPath,
    #[validate(nested)]
    pub body: SingleOrderSubmissionRequest,
}
impl ModifyOpenOrderRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ModifyOpenOrderResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Order200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(ModifyOpenOrderResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ModifyOpenOrderResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ModifyOpenOrderResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ModifyOpenOrderResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ModifyOpenOrderResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ModifyOpenOrderResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct ModifyOpenOrderRequestPath {
    /// The account to which the order will clear.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// The IB-assigned order ID of the desired order ticket.
    /// - Example: `1_799_796_559i32`
    pub order_id: i32,
}
/// Response types for modifyOpenOrder
#[derive(Debug, Clone)]
pub enum ModifyOpenOrderResponse {
    ///200: Status of submission
    Ok(Order200Response),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct NameRequestBody {
    /// Name of an existing allocation group.
    /// - Example: `"Group_1_NetLiq".to_string()`
    #[validate(length(min = 1u64))]
    pub name: String,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct NonDisclosedDetail {
    /// - Example: `Some("320043".to_string())`
    #[serde(rename = "buyerSellBic")]
    #[validate(length(min = 0u64, max = 64u64))]
    pub buyer_sell_bic: Option<String>,
    /// - Example: `Some("123456".to_string())`
    #[serde(rename = "memberAccountId")]
    #[validate(length(min = 0u64, max = 64u64))]
    pub member_account_id: Option<String>,
    /// - Example: `Some("DTCYUS33XXX".to_string())`
    #[serde(rename = "psetBic")]
    #[validate(length(min = 0u64, max = 64u64))]
    pub pset_bic: Option<String>,
    /// - Example: `Some("CH100164".to_string())`
    #[serde(rename = "reagDeagBic")]
    #[validate(length(min = 0u64, max = 64u64))]
    pub reag_deag_bic: Option<String>,
    /// - Example: `Some("123456".to_string())`
    #[serde(rename = "safeKeepingAccountId")]
    #[validate(length(min = 0u64, max = 64u64))]
    pub safe_keeping_account_id: Option<String>,
    /// - Example: `"2023-07-18".to_string()`
    #[serde(rename = "settleDate")]
    #[validate(length(min = 1u64))]
    pub settle_date: String,
    /// - Example: `"2023-07-08".to_string()`
    #[serde(rename = "tradeDate")]
    #[validate(length(min = 1u64))]
    pub trade_date: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct NotificationReadAcknowledge {
    /// Returns details about the notification read status.
    #[serde(rename = "P")]
    pub p: Option<NotificationReadAcknowledgeP>,
    /// Returns the time in ms to complete the edit.
    #[serde(rename = "T")]
    pub t: Option<i32>,
    /// Returns 1 to state message was acknowledged.
    #[serde(rename = "V")]
    pub v: Option<i32>,
}
/// Returns details about the notification read status.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct NotificationReadAcknowledgeP {
    /// Returns the ID for the notification.
    #[serde(rename = "ID")]
    pub id: Option<String>,
    /// Returns if the message was read (1) or unread (0).
    #[serde(rename = "R")]
    pub r: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct NotificationRequestBody {
    /// IB-assigned order identifier obtained from the ntf websocket message that delivered the server prompt.
    /// - Example: `Some(987_654_321i32)`
    #[serde(rename = "orderId")]
    pub order_id: Option<i32>,
    /// IB-assigned request identifier obtained from the ntf websocket message that delivered the server prompt.
    /// - Example: `Some("12345".to_string())`
    #[serde(rename = "reqId")]
    pub req_id: Option<String>,
    /// The selected value from the "options" array delivered in the server prompt ntf websocket message.
    /// - Example: `Some("Yes".to_string())`
    pub text: Option<String>,
}
pub type Notifications = Vec<NotificationsNotification>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct NotificationsNotification {
    /// Notification date as an epoch string.
    #[serde(rename = "D")]
    pub d: Option<String>,
    /// FYI code, we can use it to find whether the disclaimer is accepted or not in settings
    #[serde(rename = "FC")]
    pub fc: Option<String>,
    /// HT
    /// - Example: `Some(0i32)`
    #[serde(rename = "HT")]
    pub ht: Option<i32>,
    /// Unique way to reference the notification.
    #[serde(rename = "ID")]
    pub id: Option<String>,
    /// Content of notification.
    #[serde(rename = "MD")]
    pub md: Option<String>,
    /// Title of notification.
    #[serde(rename = "MS")]
    pub ms: Option<String>,
    /// Return if the notification was read or not. Value Format: 0: Disabled; 1: Enabled.
    #[serde(rename = "R")]
    pub r: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OauthTokenResponse {
    /// Temporary OAuth access token. 20 character hex value.
    pub oauth_token: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Order200Response {
    /// A successful submission of one or more order tickets.
    #[default]
    OrderSubmitSuccess(OrderSubmitSuccess),
    /// Indicates that the order reply message or submission was not accepted.
    OrderSubmitError(OrderSubmitError),
    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
    OrderReplyMessage(OrderReplyMessage),
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    AdvancedOrderReject(AdvancedOrderReject),
}
impl Order200Response {
    /// Indicates that the order reply message or submission was not accepted.
    pub fn order_submit_error(error: Option<String>) -> Self {
        Self::OrderSubmitError(OrderSubmitError {
            error,
            ..Default::default()
        })
    }
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    pub fn advanced_order_reject() -> Self {
        Self::AdvancedOrderReject(AdvancedOrderReject::default())
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Order200Response2 {
    /// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
    #[default]
    CancelSuccess(OrderCancelSuccess),
    /// Indicates that the order reply message or submission was not accepted.
    SubmitError(OrderSubmitError),
}
impl Order200Response2 {
    /// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
    pub fn cancel_success() -> Self {
        Self::CancelSuccess(OrderCancelSuccess::default())
    }
    /// Indicates that the order reply message or submission was not accepted.
    pub fn submit_error(error: Option<String>) -> Self {
        Self::SubmitError(OrderSubmitError {
            error,
            ..Default::default()
        })
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Order200Response3 {
    /// A successful submission of one or more order tickets.
    #[default]
    OrderSubmitSuccess(OrderSubmitSuccess),
    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
    OrderReplyMessage(OrderReplyMessage),
    /// Indicates that the order reply message or submission was not accepted.
    OrderSubmitError(OrderSubmitError),
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    AdvancedOrderReject(AdvancedOrderReject),
}
impl Order200Response3 {
    /// Indicates that the order reply message or submission was not accepted.
    pub fn order_submit_error(error: Option<String>) -> Self {
        Self::OrderSubmitError(OrderSubmitError {
            error,
            ..Default::default()
        })
    }
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    pub fn advanced_order_reject() -> Self {
        Self::AdvancedOrderReject(AdvancedOrderReject::default())
    }
}
/// Acknowledges IB's acceptance of the request to cancel the order. Does not report whether the cancellation can or will ultimately be enacted.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct OrderCancelSuccess {
    /// IB account to which the order was originally set to clear.
    pub account: Option<String>,
    /// IB contract ID of the order ticket's instrument.
    pub conid: Option<String>,
    /// Indicates success with value 'Request was submitted'
    #[default(Some("Request was submitted".to_string()))]
    pub msg: Option<String>,
    /// IB order ID of the order ticket requested for cancellation.
    pub order_id: Option<String>,
}
/// Projected costs and changes to margin and equity values in the account, if the order ticket were executed in full.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreview {
    /// Describes the projected costs associated with the order ticket.
    pub amount: Option<OrderPreviewAmount>,
    /// Describes the projected change to the account's equity.
    pub equity: Option<OrderPreviewEquity>,
    /// Human-readable text of an error message, if applicable. Otherwise null.
    pub error: Option<String>,
    /// Describes the projected change to initial margin.
    pub initial: Option<OrderPreviewInitial>,
    /// Describes the projected change to maintenance margin.
    pub maintenance: Option<OrderPreviewMaintenance>,
    /// Describes the projected change to the account's position in the instrument.
    pub position: Option<OrderPreviewPosition>,
    /// Human-readable text of warning message, if applicable. Otherwise null.
    pub warn: Option<String>,
}
/// Describes the projected costs associated with the order ticket.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreviewAmount {
    /// Projected cost of the order, current reference price times total quantity.
    pub amount: Option<String>,
    /// Projected commissions and fees associated with the order.
    pub commission: Option<String>,
    /// Sum of projected cost and commission values for the order.
    pub total: Option<String>,
}
/// Describes the projected change to the account's equity.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreviewEquity {
    /// Projected equity after execution of the order.
    pub after: Option<String>,
    /// Difference between current and projected equity values.
    pub change: Option<String>,
    /// Current equity.
    pub current: Option<String>,
}
/// Describes the projected change to initial margin.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreviewInitial {
    /// Projected initial margin after execution of the order.
    pub after: Option<String>,
    /// Difference between current and projected initial margin values.
    pub change: Option<String>,
    /// Current initial margin.
    pub current: Option<String>,
}
/// Describes the projected change to maintenance margin.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreviewMaintenance {
    /// Projected maintenance margin after execution of the order.
    pub after: Option<String>,
    /// Difference between current and projected maintenance margin values.
    pub change: Option<String>,
    /// Current maintenance margin.
    pub current: Option<String>,
}
/// Describes the projected change to the account's position in the instrument.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderPreviewPosition {
    /// Projected position size after execution of the order.
    pub after: Option<String>,
    /// Difference between current and projected position sizes.
    pub change: Option<String>,
    /// Current position in the instrument.
    pub current: Option<String>,
}
/// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
pub type OrderReplyMessage = Vec<OrderReplyMessageOrderReplyMessage>;
/// An object containing order reply messages emitted against a single order ticket.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderReplyMessageOrderReplyMessage {
    /// The replyId UUID of the order ticket's emitted order reply messages, used to confirm them and proceed. Use the POST /iserver/reply/{replyId} endpoint to confirm an order reply message.
    pub id: Option<String>,
    /// Internal use. Always delivers value 'false'.
    #[serde(rename = "isSuppressed")]
    pub is_suppressed: Option<bool>,
    /// An array containing the human-readable text of all order reply messages emitted for the order ticket.
    pub message: Option<Vec<String>>,
    /// An array containing identifiers that categorize the types of order reply messages that have been emitted.  Elements of this array are ordered so that indicies match the corresponding human-readable text strings in the 'message' array. A messageId can typically be passed in the POST /iserver/questions/suppress endpoint to auto-accept a given warning message.
    #[serde(rename = "messageIds")]
    pub message_ids: Option<Vec<String>>,
}
/// Indicates that the order reply ID does not exist.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderReplyNotFound {
    /// Message indicating that order reply id was not found.
    pub error: Option<String>,
}
/// Object containing information about the status of an order ticket.
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
pub struct OrderStatus {
    /// The account receiving executions against this order ticket.
    pub account: Option<String>,
    /// Indicates that an alert is active for the order ticket.
    pub alert_active: Option<AlertActivationRequestAlertActive>,
    /// Indicates whether an identical order on the opposite side can be placed.
    pub allowed_duplicate_opposite: Option<bool>,
    /// Internal use. Indicates chart periods available for the instrument.
    pub available_chart_periods: Option<String>,
    /// Average price of fills against the order, if any.
    pub average_price: Option<String>,
    /// Internal use. IB's UI background color in hex.
    #[serde(rename = "bgColor")]
    pub bg_color: Option<String>,
    /// Indicates whether the order ticket can be cancelled.
    pub cannot_cancel_order: Option<bool>,
    /// Indicates if the order ticket is hedged, and if so, in what way. 0 = No hedge, A = Attached child hedge order, B = Beta/portfolio hedge
    pub child_order_type: Option<OrderStatusChildOrderType>,
    /// Name of the company or asset associated with the instrument.
    pub company_name: Option<String>,
    /// Contract ID of the order's instrument.
    pub conid: Option<i32>,
    /// Contract ID and routing destination in format 123456@EXCHANGE.
    pub conidex: Option<String>,
    /// Human-readable description of the order's instrument.
    pub contract_description_1: Option<String>,
    /// Cumulative filled quantity of the instrument against the order ticket.
    pub cum_fill: Option<String>,
    /// The currency in which the instrument trades and executions are conducted.
    pub currency: Option<String>,
    /// Indicates whether the order ticket can be deactivated.
    pub deactivate_order: Option<bool>,
    /// Indicates which fields of the order ticket can be modified currently.
    pub editable_fields: Option<String>,
    /// Internal use. A string describing an active Client Portal exit strategy, or the result of its execution.
    pub exit_strategy_chart_description: Option<String>,
    /// Internal use. The UI-displayed price associated with a Client Portal exist strategy.
    pub exit_strategy_display_price: Option<String>,
    /// Internal use. Indicates the availability of Client Portal exit strategy tool for the order.
    pub exit_strategy_tool_availability: Option<String>,
    /// Internal use. IB's UI foreground color in hex.
    #[serde(rename = "fgColor")]
    pub fg_color: Option<String>,
    /// Primary listing exchange of the order ticket's instrument.
    pub listing_exchange: Option<String>,
    /// Internal use only.
    pub option_acct: Option<String>,
    /// IB internal order status.
    pub order_ccp_status: Option<String>,
    /// The IB account to which the order ticket clears.
    pub order_clearing_account: Option<String>,
    /// Human-readable description of the status or current result of the order ticket, meant for UI presentation.
    pub order_description: Option<String>,
    /// Human-readable description of the status or current result of the order ticket, meant for UI presentation. Includes instrument name.
    pub order_description_with_contract: Option<String>,
    /// The IB-assigned order identifier of the order, as provided in the request path.
    pub order_id: Option<i32>,
    /// Indicates whether the order ticket can be modified.
    pub order_not_editable: Option<bool>,
    /// Status of the order ticket.
    pub order_status: Option<OrderStatusOrderStatus>,
    /// Human-readable rendering of the order's status meant for presentation in UI.
    pub order_status_description: Option<String>,
    /// Time of the order's submission in format YYMMDDhhmmss.
    pub order_time: Option<String>,
    /// The order's  IB order type.
    pub order_type: Option<String>,
    /// Internal use only. IB-assigned identifier for the status request.
    pub request_id: Option<String>,
    /// IB asset class identifier.
    pub sec_type: Option<OrderStatusSecType>,
    /// IB-assigned meta-identifier used to associate rejected and resubmitted orders following Server Prompts.
    pub server_id: Option<String>,
    /// Side of the order ticket.
    pub side: Option<Side>,
    /// Remaining unfilled size of the order ticket. Will reflect 0.0 if order is filled in full, cancelled, or otherwise resolved and no longer working.
    pub size: Option<String>,
    /// A string reflecting the cumulative fills and total size of the order.
    pub size_and_fills: Option<String>,
    /// Internal use only.
    pub sub_type: Option<String>,
    /// Symbol of the order ticket's instrument.
    pub symbol: Option<String>,
    /// Time in force of the order ticket.
    pub tif: Option<OrderStatusTif>,
    /// The total size of the order ticket.
    pub total_size: Option<String>,
}
/// Indicates if the order ticket is hedged, and if so, in what way. 0 = No hedge, A = Attached child hedge order, B = Beta/portfolio hedge
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum OrderStatusChildOrderType {
    #[serde(rename = "0")]
    #[default]
    T0,
    A,
    B,
}
impl core::fmt::Display for OrderStatusChildOrderType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::T0 => write!(f, "0"),
            Self::A => write!(f, "A"),
            Self::B => write!(f, "B"),
        }
    }
}
/// Status of the order ticket.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum OrderStatusOrderStatus {
    #[default]
    Inactive,
    PendingSubmit,
    PreSubmitted,
    Submitted,
    Filled,
    PendingCancel,
    Cancelled,
    WarnState,
}
impl core::fmt::Display for OrderStatusOrderStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Inactive => write!(f, "Inactive"),
            Self::PendingSubmit => write!(f, "PendingSubmit"),
            Self::PreSubmitted => write!(f, "PreSubmitted"),
            Self::Submitted => write!(f, "Submitted"),
            Self::Filled => write!(f, "Filled"),
            Self::PendingCancel => write!(f, "PendingCancel"),
            Self::Cancelled => write!(f, "Cancelled"),
            Self::WarnState => write!(f, "WarnState"),
        }
    }
}
/// IB asset class identifier.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum OrderStatusSecType {
    #[serde(rename = "STK")]
    #[default]
    Stk,
    #[serde(rename = "OPT")]
    Opt,
    #[serde(rename = "FUT")]
    Fut,
    #[serde(rename = "FOP")]
    Fop,
    #[serde(rename = "CASH")]
    Cash,
    #[serde(rename = "CRYPTO")]
    Crypto,
    #[serde(rename = "BOND")]
    Bond,
    #[serde(rename = "WAR")]
    War,
    #[serde(rename = "FUND")]
    Fund,
}
impl core::fmt::Display for OrderStatusSecType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Stk => write!(f, "STK"),
            Self::Opt => write!(f, "OPT"),
            Self::Fut => write!(f, "FUT"),
            Self::Fop => write!(f, "FOP"),
            Self::Cash => write!(f, "CASH"),
            Self::Crypto => write!(f, "CRYPTO"),
            Self::Bond => write!(f, "BOND"),
            Self::War => write!(f, "WAR"),
            Self::Fund => write!(f, "FUND"),
        }
    }
}
/// Time in force of the order ticket.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum OrderStatusTif {
    #[serde(rename = "DAY")]
    #[default]
    Day,
    #[serde(rename = "IOC")]
    Ioc,
    #[serde(rename = "GTC")]
    Gtc,
    #[serde(rename = "OPG")]
    Opg,
    #[serde(rename = "PAX")]
    Pax,
}
impl core::fmt::Display for OrderStatusTif {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Day => write!(f, "DAY"),
            Self::Ioc => write!(f, "IOC"),
            Self::Gtc => write!(f, "GTC"),
            Self::Opg => write!(f, "OPG"),
            Self::Pax => write!(f, "PAX"),
        }
    }
}
/// Indicates that the order reply message or submission was not accepted.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderSubmitError {
    /// Message indicating that order submission was not successful.
    pub error: Option<String>,
}
/// A successful submission of one or more order tickets.
pub type OrderSubmitSuccess = Vec<OrderSubmitSuccessOrderSubmitSuccess>;
/// Result of successful submission of one order ticket.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct OrderSubmitSuccessOrderSubmitSuccess {
    /// Internal use only.
    pub encrypt_message: Option<String>,
    /// The order ID assigned to your order ticket by IB. Contains only numerals.
    pub order_id: Option<String>,
    /// Status describing where the order stands in its lifecycle.
    pub order_status: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct OrdersSubmissionRequest {
    /// Array of order tickets objects. Only one order ticket object may be submitted per request, unless constructing a bracket.
    #[validate(nested)]
    pub orders: Option<Vec<SingleOrderSubmissionRequest>>,
}
/// Query status of account by accountId<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1AccountsAccountidStatusRequest {
    #[validate(nested)]
    pub path: PatchGwApiV1AccountsAccountidStatusRequestPath,
    pub body: AccountRequestBody,
}
impl PatchGwApiV1AccountsAccountidStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1AccountsAccountidStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccountStatusResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1AccountsAccountidStatusResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1AccountsAccountidStatusResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1AccountsAccountidStatusRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Task status can be updated from this api<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1AccountsAccountidTasksRequest {
    #[validate(nested)]
    pub path: PatchGwApiV1AccountsAccountidTasksRequestPath,
    pub body: AccountRequestBody,
}
impl PatchGwApiV1AccountsAccountidTasksRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1AccountsAccountidTasksResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Task200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1AccountsAccountidTasksRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Update information for an existing accountId<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1AccountsRequest {
    pub body: AccountRequestBody,
}
impl PatchGwApiV1AccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
            return Ok(PostGwApiV1AccountsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1AccountsResponse::Unknown);
    }
}
/// This api will be used to update the status of am request<br><br>**Scope**: `accounts.read`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PatchGwApiV1RequestsRequestidStatusRequest {
    pub path: PatchGwApiV1RequestsRequestidStatusRequestPath,
    pub body: AccountRequestBody,
}
impl PatchGwApiV1RequestsRequestidStatusRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PatchGwApiV1RequestsRequestidStatusResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AmRequestStatusResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PatchGwApiV1RequestsRequestidStatusResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PatchGwApiV1RequestsRequestidStatusResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct PatchGwApiV1RequestsRequestidStatusRequestPath {
    pub request_id: i32,
}
/// Response types for patch_gw_api_v1_requests_requestid_status
#[derive(Debug, Clone)]
pub enum PatchGwApiV1RequestsRequestidStatusResponse {
    ///200: This api will be used to update the status of am request
    Ok(AmRequestStatusResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PendingTask {
    pub action: Option<String>,
    #[serde(rename = "au10tixCreatedDate")]
    pub au10tix_created_date: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "au10tixExpiryDate")]
    pub au10tix_expiry_date: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "documentRejectReason")]
    pub document_reject_reason: Option<Vec<String>>,
    #[serde(rename = "entityId")]
    pub entity_id: Option<i32>,
    #[serde(rename = "externalId")]
    pub external_id: Option<String>,
    #[serde(rename = "formName")]
    pub form_name: Option<String>,
    #[serde(rename = "formNumber")]
    pub form_number: Option<i32>,
    #[serde(rename = "onlineTask")]
    pub online_task: Option<bool>,
    #[serde(rename = "questionIds")]
    pub question_ids: Option<Vec<i32>>,
    #[serde(rename = "requiredForApproval")]
    pub required_for_approval: Option<bool>,
    #[serde(rename = "requiredForTrading")]
    pub required_for_trading: Option<bool>,
    #[serde(rename = "startDate")]
    pub start_date: Option<chrono::DateTime<chrono::Utc>>,
    pub state: Option<String>,
    #[serde(rename = "taskNumber")]
    pub task_number: Option<i32>,
    pub url: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PendingTasksResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    pub description: Option<String>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "pendingTaskPresent")]
    pub pending_task_present: Option<bool>,
    #[serde(rename = "pendingTasks")]
    pub pending_tasks: Option<Vec<PendingTask>>,
    pub state: Option<String>,
    pub status: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct PerformanceRequestBody {
    /// An array of strings containing each account identifier to retrieve performance details for.
    #[serde(rename = "acctIds")]
    pub acct_ids: Option<Vec<serde_json::Value>>,
    /// Specify the period for which the account should be analyzed. Available period lengths:
    ///   * `1D` - The last 24 hours.
    ///   * `7D` - The last 7 full days.
    ///   * `MTD` - Performance since the 1st of the month.
    ///   * `1M` - A full calendar month from the last full trade day.
    ///   * `3M` - 3 full calendar months from the last full trade day.
    ///   * `6M` - 6 full calendar months from the last full trade day.
    ///   * `12M` - 12 full calendar month from the last full trade day.
    ///   * `YTD` - Performance since January 1st.
    #[default(Some(Default::default()))]
    pub period: Option<PerformanceRequestBodyPeriod>,
}
/// Specify the period for which the account should be analyzed. Available period lengths:
///   * `1D` - The last 24 hours.
///   * `7D` - The last 7 full days.
///   * `MTD` - Performance since the 1st of the month.
///   * `1M` - A full calendar month from the last full trade day.
///   * `3M` - 3 full calendar months from the last full trade day.
///   * `6M` - 6 full calendar months from the last full trade day.
///   * `12M` - 12 full calendar month from the last full trade day.
///   * `YTD` - Performance since January 1st.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PerformanceRequestBodyPeriod {
    #[serde(rename = "1D")]
    #[default]
    T1d,
    #[serde(rename = "7D")]
    T7d,
    #[serde(rename = "MTD")]
    Mtd,
    #[serde(rename = "1M")]
    T1m,
    #[serde(rename = "3M")]
    T3m,
    #[serde(rename = "6M")]
    T6m,
    #[serde(rename = "12M")]
    T12m,
    #[serde(rename = "YTD")]
    Ytd,
}
impl core::fmt::Display for PerformanceRequestBodyPeriod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::T1d => write!(f, "1D"),
            Self::T7d => write!(f, "7D"),
            Self::Mtd => write!(f, "MTD"),
            Self::T1m => write!(f, "1M"),
            Self::T3m => write!(f, "3M"),
            Self::T6m => write!(f, "6M"),
            Self::T12m => write!(f, "12M"),
            Self::Ytd => write!(f, "YTD"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponse {
    /// Returns the object containing the Cumulative performance data.
    pub cps: Option<PerformanceResponseCps>,
    /// Confirms if the currency type. If trading exclusively in your base currency, "base" will be returned.
    #[serde(rename = "currencyType")]
    pub currency_type: Option<String>,
    /// Returns the request identifier, getPerformanceData.
    pub id: Option<String>,
    /// Returns an array containing accounts reviewed.
    pub included: Option<Vec<serde_json::Value>>,
    /// Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.
    pub nav: Option<PerformanceResponseNav>,
    /// Returns the total data points.
    pub nd: Option<i32>,
    /// Portfolio Measure. Used to indicate TWR or MWR values returned.
    pub pm: Option<String>,
    /// Returns the data identifier (Internal Use Only).
    pub rc: Option<i32>,
    /// Returns the time period performance data.
    pub tpps: Option<PerformanceResponseTpps>,
}
/// Returns the object containing the Cumulative performance data.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseCps {
    /// Returns the array of cps data available.
    pub data: Option<Vec<PerformanceResponseCpsDatum>>,
    /// Returns the dates corresponding to the frequency of data.
    pub dates: Option<Vec<serde_json::Value>>,
    /// Returns the determining frequency of the data range.
    pub freq: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseCpsDatum {
    /// Returns the base curency for the account.
    #[serde(rename = "baseCurrency")]
    pub base_currency: Option<String>,
    /// Returns the ending value of the value range.
    pub end: Option<String>,
    /// Returns the account identifier.
    pub id: Option<String>,
    /// Returns the key value of the request.
    #[serde(rename = "idType")]
    pub id_type: Option<String>,
    /// Returns all cps values in order between the start and end times.
    pub returns: Option<Vec<serde_json::Value>>,
    /// Returns the starting value of the value range.
    pub start: Option<String>,
}
/// Net asset value data for the account or consolidated accounts. NAV data is not applicable to benchmarks.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseNav {
    /// Contains the affiliated 'nav' data.
    pub data: Option<Vec<PerformanceResponseNavDatum>>,
    /// Returns the array of dates formatted as strings corresponding to your frequency, the length should be same as the length of returns inside data.
    pub dates: Option<Vec<serde_json::Value>>,
    /// Displays the values corresponding to a given frequency.
    pub freq: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseNavDatum {
    /// Returns the base currency used in the account.
    #[serde(rename = "baseCurrency")]
    pub base_currency: Option<String>,
    /// Returns the end of the available frequency.
    pub end: Option<String>,
    /// Returns the account identifier.
    pub id: Option<String>,
    /// Returns how identifiers are determined.
    #[serde(rename = "idType")]
    pub id_type: Option<String>,
    /// Returns sequential data points corresponding to the net asset value between the "start" and "end" days.
    pub navs: Option<Vec<serde_json::Value>>,
    /// Returns the first available date for data.
    pub start: Option<String>,
    /// Returns the intiial NAV available.
    #[serde(rename = "startNAV")]
    pub start_nav: Option<PerformanceResponseNavDatumStartNav>,
}
/// Returns the intiial NAV available.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseNavDatumStartNav {
    /// Returns the starting date for the request.
    pub date: Option<String>,
    /// Returns the Net Asset Value of the account.
    pub val: Option<f64>,
}
/// Returns the time period performance data.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PerformanceResponseTpps {
    /// Object containing all data about tpps.
    pub data: Option<Vec<PerformanceResponseCpsDatum>>,
    /// Returns the dates corresponding to the frequency of data.
    pub dates: Option<Vec<serde_json::Value>>,
    /// Returns the determining frequency of the data range.
    pub freq: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PnlPartitionedResponse {
    /// Refers to the U accounts PnL. This does reference Realized Profit and Loss.
    pub upnl: Option<PnlPartitionedResponseUpnl>,
}
/// Refers to the U accounts PnL. This does reference Realized Profit and Loss.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PnlPartitionedResponseUpnl {
    /// The account or model's Profit and Loss.
    #[serde(rename = "U1234567.Core")]
    pub u1234567_core: Option<PnlPartitionedResponseUpnlU1234567Core>,
}
/// The account or model's Profit and Loss.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PnlPartitionedResponseUpnlU1234567Core {
    /// Daily PnL for the specified account profile.
    pub dpl: Option<f64>,
    /// Excess Liquidity for the specified account profile.
    pub el: Option<f64>,
    /// Margin value for the specified account profile.
    pub mv: Option<f64>,
    /// Net Liquidity for the specified account profile.
    pub nl: Option<f64>,
    /// Returns the positional value of the returned account. Always returns 1 for individual accounts.
    #[serde(rename = "rowType")]
    pub row_type: Option<i32>,
    /// Unrealized PnL for the specified account profile.
    pub upl: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PollingInstructionResult {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum PollingInstructionResultInstructionStatus {
    #[serde(rename = "PENDING")]
    #[default]
    Pending,
    #[serde(rename = "REJECTED")]
    Rejected,
    #[serde(rename = "PROCESSED")]
    Processed,
}
impl core::fmt::Display for PollingInstructionResultInstructionStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Pending => write!(f, "PENDING"),
            Self::Rejected => write!(f, "REJECTED"),
            Self::Processed => write!(f, "PROCESSED"),
        }
    }
}
/// Array of position objects, each defining a position held in the account.
pub type Portfolio2Positions = Vec<Portfolio2PositionsPortfolio2position>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Portfolio2PositionsPortfolio2position {
    /// Asset class of the requested instrument.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<String>,
    /// The account's average cost for its position.
    #[serde(rename = "avgCost")]
    pub avg_cost: Option<serde_json::Value>,
    /// The account's average price for its position.
    #[serde(rename = "avgPrice")]
    pub avg_price: Option<f64>,
    /// IB contract ID for the instrument.
    pub conid: Option<i32>,
    /// Currency in which the instrument trades.
    pub currency: Option<String>,
    /// Contract's local symbol
    pub description: Option<String>,
    /// Industry sub-categorization of the instrument.
    pub group: Option<String>,
    #[serde(rename = "isLastToLoq")]
    pub is_last_to_loq: Option<bool>,
    /// Current market price of the instrument, in the instrument's currency.
    #[serde(rename = "marketPrice")]
    pub market_price: Option<f64>,
    /// Current market value of the account's position in the instrument, in the instrument's currency.
    #[serde(rename = "marketValue")]
    pub market_value: Option<f64>,
    /// Name of the model portfolio in which the account is invested that contributes this position.
    pub model: Option<String>,
    /// Size of position in units of instrument.
    pub position: Option<f64>,
    /// Realized PnL for the instrument in the instrument's currency.
    #[serde(rename = "realizedPnl")]
    pub realized_pnl: Option<f64>,
    /// The security type of the instrument.
    #[serde(rename = "secType")]
    pub sec_type: Option<String>,
    /// Industry sector categorization of the instrument.
    pub sector: Option<String>,
    /// Time taken to retrieve position data in milliseconds.
    pub timestamp: Option<i32>,
    /// Unrealized PnL for the instrument in the account.
    #[serde(rename = "unrealizedPnl")]
    pub unrealized_pnl: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioAllocations {
    /// Object containing values of positions sorted by long/short and asset class.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<PortfolioAllocationsAssetClass>,
    /// Object containing values of positions sorted by long/short and Sector Group.
    pub group: Option<PortfolioAllocationsGroup>,
    /// Object containing values of positions sorted by long/short and Sector.
    pub sector: Option<PortfolioAllocationsSector>,
}
/// Object containing values of positions sorted by long/short and asset class.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioAllocationsAssetClass {
    /// Object containing value of long positions in the account aggregated by asset class.
    pub long: Option<std::collections::HashMap<String, f64>>,
    /// Object containing value of short positions in the account aggregated by asset class.
    pub short: Option<std::collections::HashMap<String, f64>>,
}
/// Object containing values of positions sorted by long/short and Sector Group.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioAllocationsGroup {
    /// Object containing value of long positions in the account aggregated by Sector Group.
    pub long: Option<std::collections::HashMap<String, f64>>,
    /// Object containing value of short positions in the account aggregated by Sector Group.
    pub short: Option<std::collections::HashMap<String, f64>>,
}
/// Object containing values of positions sorted by long/short and Sector.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioAllocationsSector {
    /// Object containing value of long positions in the account aggregated by Sector.
    pub long: Option<std::collections::HashMap<String, f64>>,
    /// Object containing value of short positions in the account aggregated by Sector.
    pub short: Option<std::collections::HashMap<String, f64>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioSummary {
    pub accountcode: Option<serde_json::Value>,
    pub accountready: Option<serde_json::Value>,
    pub accounttype: Option<serde_json::Value>,
    pub accruedcash: Option<serde_json::Value>,
    #[serde(rename = "accruedcash-c")]
    pub accruedcash_c: Option<serde_json::Value>,
    #[serde(rename = "accruedcash-s")]
    pub accruedcash_s: Option<serde_json::Value>,
    pub accrueddividend: Option<serde_json::Value>,
    #[serde(rename = "accrueddividend-c")]
    pub accrueddividend_c: Option<serde_json::Value>,
    #[serde(rename = "accrueddividend-s")]
    pub accrueddividend_s: Option<serde_json::Value>,
    pub availablefunds: Option<serde_json::Value>,
    #[serde(rename = "availablefunds-c")]
    pub availablefunds_c: Option<serde_json::Value>,
    #[serde(rename = "availablefunds-s")]
    pub availablefunds_s: Option<serde_json::Value>,
    pub availabletotrade: Option<serde_json::Value>,
    #[serde(rename = "availabletotrade-c")]
    pub availabletotrade_c: Option<serde_json::Value>,
    #[serde(rename = "availabletotrade-s")]
    pub availabletotrade_s: Option<serde_json::Value>,
    pub availabletowithdraw: Option<serde_json::Value>,
    #[serde(rename = "availabletowithdraw-c")]
    pub availabletowithdraw_c: Option<serde_json::Value>,
    #[serde(rename = "availabletowithdraw-s")]
    pub availabletowithdraw_s: Option<serde_json::Value>,
    pub billable: Option<serde_json::Value>,
    #[serde(rename = "billable-c")]
    pub billable_c: Option<serde_json::Value>,
    #[serde(rename = "billable-s")]
    pub billable_s: Option<serde_json::Value>,
    pub buyingpower: Option<serde_json::Value>,
    #[serde(rename = "columnprio-c")]
    pub columnprio_c: Option<serde_json::Value>,
    #[serde(rename = "columnprio-s")]
    pub columnprio_s: Option<serde_json::Value>,
    pub cushion: Option<serde_json::Value>,
    pub daytradesremaining: Option<serde_json::Value>,
    #[serde(rename = "daytradesremainingt+1")]
    pub daytradesremainingt_1: Option<serde_json::Value>,
    #[serde(rename = "daytradesremainingt+2")]
    pub daytradesremainingt_2: Option<serde_json::Value>,
    #[serde(rename = "daytradesremainingt+3")]
    pub daytradesremainingt_3: Option<serde_json::Value>,
    #[serde(rename = "daytradesremainingt+4")]
    pub daytradesremainingt_4: Option<serde_json::Value>,
    #[serde(rename = "daytradingstatus-s")]
    pub daytradingstatus_s: Option<serde_json::Value>,
    pub depositoncredithold: Option<serde_json::Value>,
    pub equitywithloanvalue: Option<serde_json::Value>,
    #[serde(rename = "equitywithloanvalue-c")]
    pub equitywithloanvalue_c: Option<serde_json::Value>,
    #[serde(rename = "equitywithloanvalue-s")]
    pub equitywithloanvalue_s: Option<serde_json::Value>,
    pub excessliquidity: Option<serde_json::Value>,
    #[serde(rename = "excessliquidity-c")]
    pub excessliquidity_c: Option<serde_json::Value>,
    #[serde(rename = "excessliquidity-s")]
    pub excessliquidity_s: Option<serde_json::Value>,
    pub fullavailablefunds: Option<serde_json::Value>,
    #[serde(rename = "fullavailablefunds-c")]
    pub fullavailablefunds_c: Option<serde_json::Value>,
    #[serde(rename = "fullavailablefunds-s")]
    pub fullavailablefunds_s: Option<serde_json::Value>,
    pub fullexcessliquidity: Option<serde_json::Value>,
    #[serde(rename = "fullexcessliquidity-c")]
    pub fullexcessliquidity_c: Option<serde_json::Value>,
    #[serde(rename = "fullexcessliquidity-s")]
    pub fullexcessliquidity_s: Option<serde_json::Value>,
    pub fullinitmarginreq: Option<serde_json::Value>,
    #[serde(rename = "fullinitmarginreq-c")]
    pub fullinitmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "fullinitmarginreq-s")]
    pub fullinitmarginreq_s: Option<serde_json::Value>,
    pub fullmaintmarginreq: Option<serde_json::Value>,
    #[serde(rename = "fullmaintmarginreq-c")]
    pub fullmaintmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "fullmaintmarginreq-s")]
    pub fullmaintmarginreq_s: Option<serde_json::Value>,
    pub grosspositionvalue: Option<serde_json::Value>,
    #[serde(rename = "grosspositionvalue-s")]
    pub grosspositionvalue_s: Option<serde_json::Value>,
    pub guarantee: Option<serde_json::Value>,
    #[serde(rename = "guarantee-c")]
    pub guarantee_c: Option<serde_json::Value>,
    #[serde(rename = "guarantee-s")]
    pub guarantee_s: Option<serde_json::Value>,
    pub highestseverity: Option<serde_json::Value>,
    pub indianstockhaircut: Option<serde_json::Value>,
    #[serde(rename = "indianstockhaircut-c")]
    pub indianstockhaircut_c: Option<serde_json::Value>,
    #[serde(rename = "indianstockhaircut-s")]
    pub indianstockhaircut_s: Option<serde_json::Value>,
    pub initmarginreq: Option<serde_json::Value>,
    #[serde(rename = "initmarginreq-c")]
    pub initmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "initmarginreq-s")]
    pub initmarginreq_s: Option<serde_json::Value>,
    #[serde(rename = "leverage-s")]
    pub leverage_s: Option<serde_json::Value>,
    pub lookaheadavailablefunds: Option<serde_json::Value>,
    #[serde(rename = "lookaheadavailablefunds-c")]
    pub lookaheadavailablefunds_c: Option<serde_json::Value>,
    #[serde(rename = "lookaheadavailablefunds-s")]
    pub lookaheadavailablefunds_s: Option<serde_json::Value>,
    pub lookaheadexcessliquidity: Option<serde_json::Value>,
    #[serde(rename = "lookaheadexcessliquidity-c")]
    pub lookaheadexcessliquidity_c: Option<serde_json::Value>,
    #[serde(rename = "lookaheadexcessliquidity-s")]
    pub lookaheadexcessliquidity_s: Option<serde_json::Value>,
    pub lookaheadinitmarginreq: Option<serde_json::Value>,
    #[serde(rename = "lookaheadinitmarginreq-c")]
    pub lookaheadinitmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "lookaheadinitmarginreq-s")]
    pub lookaheadinitmarginreq_s: Option<serde_json::Value>,
    pub lookaheadmaintmarginreq: Option<serde_json::Value>,
    #[serde(rename = "lookaheadmaintmarginreq-c")]
    pub lookaheadmaintmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "lookaheadmaintmarginreq-s")]
    pub lookaheadmaintmarginreq_s: Option<serde_json::Value>,
    pub lookaheadnextchange: Option<serde_json::Value>,
    pub maintmarginreq: Option<serde_json::Value>,
    #[serde(rename = "maintmarginreq-c")]
    pub maintmarginreq_c: Option<serde_json::Value>,
    #[serde(rename = "maintmarginreq-s")]
    pub maintmarginreq_s: Option<serde_json::Value>,
    pub netliquidation: Option<serde_json::Value>,
    #[serde(rename = "netliquidation-c")]
    pub netliquidation_c: Option<serde_json::Value>,
    #[serde(rename = "netliquidation-s")]
    pub netliquidation_s: Option<serde_json::Value>,
    pub netliquidationuncertainty: Option<serde_json::Value>,
    pub nlvandmargininreview: Option<serde_json::Value>,
    pub pasharesvalue: Option<serde_json::Value>,
    #[serde(rename = "pasharesvalue-c")]
    pub pasharesvalue_c: Option<serde_json::Value>,
    #[serde(rename = "pasharesvalue-s")]
    pub pasharesvalue_s: Option<serde_json::Value>,
    pub physicalcertificatevalue: Option<serde_json::Value>,
    #[serde(rename = "physicalcertificatevalue-c")]
    pub physicalcertificatevalue_c: Option<serde_json::Value>,
    #[serde(rename = "physicalcertificatevalue-s")]
    pub physicalcertificatevalue_s: Option<serde_json::Value>,
    pub postexpirationexcess: Option<serde_json::Value>,
    #[serde(rename = "postexpirationexcess-c")]
    pub postexpirationexcess_c: Option<serde_json::Value>,
    #[serde(rename = "postexpirationexcess-s")]
    pub postexpirationexcess_s: Option<serde_json::Value>,
    pub postexpirationmargin: Option<serde_json::Value>,
    #[serde(rename = "postexpirationmargin-c")]
    pub postexpirationmargin_c: Option<serde_json::Value>,
    #[serde(rename = "postexpirationmargin-s")]
    pub postexpirationmargin_s: Option<serde_json::Value>,
    pub previousdayequitywithloanvalue: Option<serde_json::Value>,
    #[serde(rename = "previousdayequitywithloanvalue-s")]
    pub previousdayequitywithloanvalue_s: Option<serde_json::Value>,
    pub regtequity: Option<serde_json::Value>,
    #[serde(rename = "regtequity-s")]
    pub regtequity_s: Option<serde_json::Value>,
    pub regtmargin: Option<serde_json::Value>,
    #[serde(rename = "regtmargin-s")]
    pub regtmargin_s: Option<serde_json::Value>,
    #[serde(rename = "segmenttitle-c")]
    pub segmenttitle_c: Option<serde_json::Value>,
    #[serde(rename = "segmenttitle-s")]
    pub segmenttitle_s: Option<serde_json::Value>,
    pub sma: Option<serde_json::Value>,
    #[serde(rename = "sma-s")]
    pub sma_s: Option<serde_json::Value>,
    pub totalcashvalue: Option<serde_json::Value>,
    #[serde(rename = "totalcashvalue-c")]
    pub totalcashvalue_c: Option<serde_json::Value>,
    #[serde(rename = "totalcashvalue-s")]
    pub totalcashvalue_s: Option<serde_json::Value>,
    pub totaldebitcardpendingcharges: Option<serde_json::Value>,
    #[serde(rename = "totaldebitcardpendingcharges-c")]
    pub totaldebitcardpendingcharges_c: Option<serde_json::Value>,
    #[serde(rename = "totaldebitcardpendingcharges-s")]
    pub totaldebitcardpendingcharges_s: Option<serde_json::Value>,
    #[serde(rename = "tradingtype-s")]
    pub tradingtype_s: Option<serde_json::Value>,
    pub whatifpmenabled: Option<serde_json::Value>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
pub struct PortfolioSummaryValue {
    /// Numerical data for the associated key.
    pub amount: Option<f64>,
    /// The currency in which the value of the 'amount' field is denominated.
    pub currency: Option<f64>,
    /// Indicates whether the associated key's value does not exist, as opposed to a value of zero.
    #[serde(rename = "isNull")]
    pub is_null: Option<bool>,
    /// severity
    pub severity: Option<i32>,
    /// Unix epoch timestamp of returned data in milliseconds.
    pub timestamp: Option<i32>,
    /// String and boolean (non-numerical) data for the associated key.
    pub value: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Position200Response {
    /// Additional properties not defined in the schema.
    #[serde(flatten)]
    pub additional_properties: std::collections::HashMap<String, IndividualPosition>,
}
/// Array of objects reflecting all positions in the given account.
pub type Position200Response2 = Vec<IndividualPosition>;
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PositionRequestBody {
    /// Define the model to retrieve accounts from.
    pub model: Option<String>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PositionRequestBody2 {
    /// Maximum number of positions to return.
    /// - Example: `Some(10i32)`
    pub limit: Option<i32>,
    /// Name of your model.
    /// - Example: `Some("Sample-Model".to_string())`
    pub model: Option<String>,
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_609i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Direction to sort the request by.
    ///  * `ASC` - Sort from greatest to smallest.
    ///  * `DESC` - Sort from smallest to greatest.
    #[serde(rename = "sortDirection")]
    pub sort_direction: Option<PositionRequestBody2SortDirection>,
    /// Field to sort the response by.
    ///   * `actual` - Current actual model allocation for the instrument.
    ///   * `actualRangeMax` - Maximum actual model allocation allowed for the instrument.
    ///   * `actualRangeMin` - Minimum actual model allocation allowed for the instrument.
    ///   * `ccy` - Currency of the instrument.
    ///   * `conid` - Contract identifier, or conid.
    ///   * `dlv` - Market value.
    ///   * `instrumentImbalance` - How far an instrument's actual allocation is from its model.
    ///   * `instrument` - Symbol of the security.
    ///   * `mv` - Market value of the model position.
    ///   * `position` - Number of shares held by the model.
    ///   * `target` - Target percentage of an instrument held within a model.
    #[serde(rename = "sortField")]
    pub sort_field: Option<PositionRequestBody2SortField>,
}
/// Direction to sort the request by.
///  * `ASC` - Sort from greatest to smallest.
///  * `DESC` - Sort from smallest to greatest.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PositionRequestBody2SortDirection {
    #[serde(rename = "ASC")]
    #[default]
    Asc,
    #[serde(rename = "DESC")]
    Desc,
}
impl core::fmt::Display for PositionRequestBody2SortDirection {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Asc => write!(f, "ASC"),
            Self::Desc => write!(f, "DESC"),
        }
    }
}
/// Field to sort the response by.
///   * `actual` - Current actual model allocation for the instrument.
///   * `actualRangeMax` - Maximum actual model allocation allowed for the instrument.
///   * `actualRangeMin` - Minimum actual model allocation allowed for the instrument.
///   * `ccy` - Currency of the instrument.
///   * `conid` - Contract identifier, or conid.
///   * `dlv` - Market value.
///   * `instrumentImbalance` - How far an instrument's actual allocation is from its model.
///   * `instrument` - Symbol of the security.
///   * `mv` - Market value of the model position.
///   * `position` - Number of shares held by the model.
///   * `target` - Target percentage of an instrument held within a model.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PositionRequestBody2SortField {
    #[serde(rename = "actual")]
    #[default]
    Actual,
    #[serde(rename = "actualRangeMax")]
    ActualRangeMax,
    #[serde(rename = "actualRangeMin")]
    ActualRangeMin,
    #[serde(rename = "ccy")]
    Ccy,
    #[serde(rename = "conid")]
    Conid,
    #[serde(rename = "dlv")]
    Dlv,
    #[serde(rename = "instrumentImbalance")]
    InstrumentImbalance,
    #[serde(rename = "instrument")]
    Instrument,
    #[serde(rename = "mismatchType")]
    MismatchType,
    #[serde(rename = "mv")]
    Mv,
    #[serde(rename = "position")]
    Position,
    #[serde(rename = "target")]
    Target,
}
impl core::fmt::Display for PositionRequestBody2SortField {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Actual => write!(f, "actual"),
            Self::ActualRangeMax => write!(f, "actualRangeMax"),
            Self::ActualRangeMin => write!(f, "actualRangeMin"),
            Self::Ccy => write!(f, "ccy"),
            Self::Conid => write!(f, "conid"),
            Self::Dlv => write!(f, "dlv"),
            Self::InstrumentImbalance => write!(f, "instrumentImbalance"),
            Self::Instrument => write!(f, "instrument"),
            Self::MismatchType => write!(f, "mismatchType"),
            Self::Mv => write!(f, "mv"),
            Self::Position => write!(f, "position"),
            Self::Target => write!(f, "target"),
        }
    }
}
/// Task can be assigned from this api<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1AccountsAccountidTasksRequest {
    #[validate(nested)]
    pub path: PostGwApiV1AccountsAccountidTasksRequestPath,
    pub body: AccountRequestBody,
}
impl PostGwApiV1AccountsAccountidTasksRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1AccountsAccountidTasksResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Task200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsAccountidTasksResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1AccountsAccountidTasksResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1AccountsAccountidTasksRequestPath {
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for post_gw_api_v1_accounts_accountid_tasks
#[derive(Debug, Clone)]
pub enum PostGwApiV1AccountsAccountidTasksResponse {
    ///200: Task can be assigned from this api
    Ok(Task200Response2),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Provides mechanism to submit Agreements and Disclosures to IBKR once a day instead of with each application. We store these documents on the servers and will use them for new application requests submitted that day.<ul><li>Documents will need to be submitted once a day (before the Applications are submitted). PDFs will be displayed and submitted as is- no changes/edits will be made to the actual PDF files.</li><li>This end-point will not process any Tax Form Documents. Tax Form document should be submitted with every application</li><li>If submitted in the morning, you only need to include the Tax Form attachment for each applicant. Otherwise, you will need to include PDFs with each application (Create Account).</li></ul><br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1AccountsDocumentsRequest {
    pub body: AccountRequestBody,
}
impl PostGwApiV1AccountsDocumentsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
            return Ok(PostGwApiV1AccountsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1AccountsResponse::Unknown);
    }
}
/// Submit account application. This will create brokerage account for the end user.<br><br>**Scope**: `accounts.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1AccountsRequest {
    pub body: AccountRequestBody,
}
impl PostGwApiV1AccountsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1AccountsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<StatusResponse>::json_with_diagnostics(req).await?;
            return Ok(PostGwApiV1AccountsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::Forbidden);
        }
        if status == http::StatusCode::UNSUPPORTED_MEDIA_TYPE {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::UnsupportedMediaType);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1AccountsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1AccountsResponse::Unknown);
    }
}
/// Response types for post_gw_api_v1_accounts
#[derive(Debug, Clone)]
pub enum PostGwApiV1AccountsResponse {
    ///200: Submit account application. This will create brokerage account for the end user.
    Ok(StatusResponse),
    ///400: Returns error description representing bad request
    BadRequest,
    ///401: Returns error description representing access issue
    Unauthorized,
    ///403: Returns error description representing access issue
    Forbidden,
    ///415: Unsupported Media Type
    UnsupportedMediaType,
    ///500: Returns error description representing internal server error
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// View available cash for withdrawal and account equity value by accountId<br><br>**Scope**: `balances.read`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1BalancesQueryRequest {
    pub query: PostGwApiV1BalancesQueryRequestQuery,
    /// Create an query request body
    pub body: QueryRequestBody,
}
impl PostGwApiV1BalancesQueryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BalancesQueryResponse> {
        let status = req.status();
        if status == http::StatusCode::CREATED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BalancesQueryResponse::Created);
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BalancesQueryResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BalancesQueryResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BalancesQueryResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BalancesQueryResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BalancesQueryResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1BalancesQueryRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_balances_query
#[derive(Debug, Clone)]
pub enum PostGwApiV1BalancesQueryResponse {
    ///201: Instruction successfully created and processed synchronously
    Created,
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///422: Returns a Problem detail instance representing a business error.
    UnprocessableEntity,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `bank-instructions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsBulkRequest {
    pub query: PostGwApiV1BankInstructionsBulkRequestQuery,
    /// Create Bulk Banking Instructions request body
    pub body: BankInstructionsBulkRequestBody,
}
impl PostGwApiV1BankInstructionsBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_bank_instructions_bulk
#[derive(Debug, Clone)]
pub enum PostGwApiV1BankInstructionsBulkResponse {
    ///202: Accepts all instructions in Bulk request to create them asynchronously
    Accepted(AsynchronousInstructionSetResponse),
    ///400: Returns a Problem detail instance representing a bad request. Returned even if only one instruction in the bulk upload has syntactical errors.
    BadRequest,
    ///500: Unable to process request due to an Internal Error. Please try again later.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// View active bank instructions for an accountId.<br><br>**Scope**: `bank-instructions.read`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsQueryRequest {
    pub query: PostGwApiV1BankInstructionsQueryRequestQuery,
    /// Create get instruction name request body
    pub body: QueryRequestBody2,
}
impl PostGwApiV1BankInstructionsQueryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsQueryResponse> {
        let status = req.status();
        if status == http::StatusCode::CREATED {
            let data =
                oas3_gen_support::Diagnostics::<Query201Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1BankInstructionsQueryResponse::Created(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsQueryResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsQueryResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsQueryResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsQueryResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsQueryResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsQueryRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_bank_instructions_query
#[derive(Debug, Clone)]
pub enum PostGwApiV1BankInstructionsQueryResponse {
    ///201: Instruction successfully created and processed synchronously
    Created(Query201Response),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///422: Returns a Problem detail instance representing a business error.
    UnprocessableEntity,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Create or delete bank instructions by accountId. Only ACH and EDDA are supported for 'Create'.<br><br>**Scope**: `bank-instructions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsRequest {
    pub query: PostGwApiV1BankInstructionsRequestQuery,
    pub body: InstructionRequestBody,
}
impl PostGwApiV1BankInstructionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1BankInstructionsRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_bank_instructions
#[derive(Debug, Clone)]
pub enum PostGwApiV1BankInstructionsResponse {
    ///202: Accepts request to create a new instruction asynchronously
    Accepted(AsynchronousInstructionResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///422: Returns a Problem detail instance representing a business error.
    UnprocessableEntity,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `echo.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1EchoSignedJwtRequest {
    /// Create a Signed JWT echo request.
    pub body: AccountRequestBody,
}
impl PostGwApiV1EchoSignedJwtRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<GetGwApiV1EchoHttpsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<EchoResponse>::json_with_diagnostics(req).await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(GetGwApiV1EchoHttpsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(GetGwApiV1EchoHttpsResponse::Unknown);
    }
}
/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalAssetTransfersBulkRequest {
    pub query: PostGwApiV1ExternalAssetTransfersBulkRequestQuery,
    /// Create Bulk External Asset transfers (Fop, DWAC and Complex Asset Transfer) request body
    pub body: ExternalAssetTransfersBulkRequestBody,
}
impl PostGwApiV1ExternalAssetTransfersBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalAssetTransfersBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Initiate request to submit external position transfer. Methods- ACATS, ATON, Basic FOP, FOP, DWAC. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers/<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalAssetTransfersRequest {
    pub query: PostGwApiV1ExternalAssetTransfersRequestQuery,
    pub body: TransferRequestBody2,
}
impl PostGwApiV1ExternalAssetTransfersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalAssetTransfersRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersBulkRequest {
    pub query: PostGwApiV1ExternalCashTransfersBulkRequestQuery,
    /// Create Bulk External Cash transfers (Deposit and Withdraw fund) request body
    pub body: ExternalCashTransfersBulkRequestBody,
}
impl PostGwApiV1ExternalCashTransfersBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// View available cash for withdrawal with and without margin loan by accountId<br><br>**Scope**: `transfers.read`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersQueryRequest {
    pub query: PostGwApiV1ExternalCashTransfersQueryRequestQuery,
    /// Create an external cash transfer query request body
    pub body: QueryRequestBody3,
}
impl PostGwApiV1ExternalCashTransfersQueryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1ExternalCashTransfersQueryResponse> {
        let status = req.status();
        if status == http::StatusCode::CREATED {
            let data =
                oas3_gen_support::Diagnostics::<Query201Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Created(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1ExternalCashTransfersQueryResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersQueryRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_external_cash_transfers_query
#[derive(Debug, Clone)]
pub enum PostGwApiV1ExternalCashTransfersQueryResponse {
    ///201: Instruction successfully created and processed synchronously
    Created(Query201Response2),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///422: Returns a Problem detail instance representing a business error.
    UnprocessableEntity,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Initiate request to deposit or withdrawal between IBKR account and bank account. More information on transfer methods can be found here - https://www.interactivebrokers.com/campus/trading-lessons/cash-and-position-transfers<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersRequest {
    pub query: PostGwApiV1ExternalCashTransfersRequestQuery,
    pub body: TransferRequestBody3,
}
impl PostGwApiV1ExternalCashTransfersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1ExternalCashTransfersRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `instructions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsCancelBulkRequest {
    pub query: PostGwApiV1InstructionsCancelBulkRequestQuery,
    /// Create Bulk Cancel Instructions request body
    pub body: CancelBulkRequestBody,
}
impl PostGwApiV1InstructionsCancelBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsCancelBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Cancel request by instructionId.<br><br>**Scope**: `instructions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsCancelRequest {
    pub query: PostGwApiV1InstructionsCancelRequestQuery,
    #[validate(nested)]
    pub body: CancelRequestBody,
}
impl PostGwApiV1InstructionsCancelRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1InstructionsCancelResponse> {
        let status = req.status();
        if status == http::StatusCode::CREATED {
            let data = oas3_gen_support::Diagnostics::<
                SynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::Created(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1InstructionsCancelResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsCancelRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Response types for post_gw_api_v1_instructions_cancel
#[derive(Debug, Clone)]
pub enum PostGwApiV1InstructionsCancelResponse {
    ///201: Instruction successfully created and processed synchronously
    Created(SynchronousInstructionResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///422: Returns a Problem detail instance representing a business error.
    UnprocessableEntity,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Query list of recent transactions (up to 30 days) based on accountId.<br><br>**Scope**: `instructions.read`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsQueryRequest {
    pub query: PostGwApiV1InstructionsQueryRequestQuery,
    /// Create recent instructions request body
    #[validate(nested)]
    pub body: QueryRequestBody4,
}
impl PostGwApiV1InstructionsQueryRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InstructionsQueryRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalAssetTransfersBulkRequest {
    pub query: PostGwApiV1InternalAssetTransfersBulkRequestQuery,
    /// Create Bulk Internal Asset Transfers request body
    pub body: InternalAssetTransfersBulkRequestBody,
}
impl PostGwApiV1InternalAssetTransfersBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalAssetTransfersBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Transfer positions internally between two accounts with Interactive Brokers<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalAssetTransfersRequest {
    pub query: PostGwApiV1InternalAssetTransfersRequestQuery,
    #[validate(nested)]
    pub body: TransferRequestBody4,
}
impl PostGwApiV1InternalAssetTransfersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalAssetTransfersRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalCashTransfersBulkRequest {
    pub query: PostGwApiV1InternalCashTransfersBulkRequestQuery,
    /// Create Bulk Internal Cash Transfers request body
    pub body: InternalCashTransfersBulkRequestBody,
}
impl PostGwApiV1InternalCashTransfersBulkRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1BankInstructionsBulkResponse> {
        let status = req.status();
        if status == http::StatusCode::ACCEPTED {
            let data = oas3_gen_support::Diagnostics::<
                AsynchronousInstructionSetResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::Accepted(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::BadRequest);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1BankInstructionsBulkResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1BankInstructionsBulkResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalCashTransfersBulkRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// Transfer cash internally between two accounts with Interactive Brokers.<br><br>**Scope**: `transfers.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalCashTransfersRequest {
    pub query: PostGwApiV1InternalCashTransfersRequestQuery,
    #[validate(nested)]
    pub body: TransferRequestBody5,
}
impl PostGwApiV1InternalCashTransfersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1InstructionsCancelResponse> {
        let status = req.status();
        if status == http::StatusCode::CREATED {
            let data = oas3_gen_support::Diagnostics::<
                SynchronousInstructionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::Created(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::BadRequest);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::Forbidden);
        }
        if status == http::StatusCode::UNPROCESSABLE_ENTITY {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::UnprocessableEntity);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1InstructionsCancelResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1InstructionsCancelResponse::Unknown);
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct PostGwApiV1InternalCashTransfersRequestQuery {
    /// The client's clientId
    /// - Example: `Some("abc123".to_string())`
    #[serde(rename = "client-id")]
    pub client_id: Option<String>,
}
/// <br>**Scope**: `sso-browser-sessions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1SsoBrowserSessionsRequest {
    #[validate(nested)]
    pub header: PostGwApiV1SsoBrowserSessionsRequestHeader,
    /// Create browser session on behalf of end-user.
    pub body: AccountRequestBody,
}
impl PostGwApiV1SsoBrowserSessionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1SsoBrowserSessionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                CreateBrowserSessionResponse,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoBrowserSessionsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoBrowserSessionsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoBrowserSessionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1SsoBrowserSessionsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1SsoBrowserSessionsRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&PostGwApiV1SsoBrowserSessionsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &PostGwApiV1SsoBrowserSessionsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<PostGwApiV1SsoBrowserSessionsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: PostGwApiV1SsoBrowserSessionsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for post_gw_api_v1_sso_browser_sessions
#[derive(Debug, Clone)]
pub enum PostGwApiV1SsoBrowserSessionsResponse {
    ///200: Create a Single Sign On (SSO) to access the IBKR hosted portal (White Branded).
    Ok(CreateBrowserSessionResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `sso-sessions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1SsoSessionsRequest {
    #[validate(nested)]
    pub header: PostGwApiV1SsoSessionsRequestHeader,
    /// Create session on behalf of end-user.
    pub body: AccountRequestBody,
}
impl PostGwApiV1SsoSessionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1SsoSessionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<CreateSessionResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1SsoSessionsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoSessionsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoSessionsResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoSessionsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1SsoSessionsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1SsoSessionsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1SsoSessionsRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&PostGwApiV1SsoSessionsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &PostGwApiV1SsoSessionsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<PostGwApiV1SsoSessionsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: PostGwApiV1SsoSessionsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for post_gw_api_v1_sso_sessions
#[derive(Debug, Clone)]
pub enum PostGwApiV1SsoSessionsResponse {
    ///200: Returns a JSON object containing a reference to the newly created SSO session.
    Ok(CreateSessionResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.read` OR `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1StatementsRequest {
    #[validate(nested)]
    pub header: PostGwApiV1StatementsRequestHeader,
    /// Report request object
    #[validate(nested)]
    pub body: StmtRequest,
}
impl PostGwApiV1StatementsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1StatementsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<GetStatementsResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostGwApiV1StatementsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1StatementsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1StatementsResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1StatementsResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1StatementsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1StatementsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1StatementsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1StatementsRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&PostGwApiV1StatementsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &PostGwApiV1StatementsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<PostGwApiV1StatementsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: PostGwApiV1StatementsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for post_gw_api_v1_statements
#[derive(Debug, Clone)]
pub enum PostGwApiV1StatementsResponse {
    ///200: Returns a JSON object containing the relevant statement.
    Ok(GetStatementsResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1TaxDocumentsRequest {
    #[validate(nested)]
    pub header: PostGwApiV1TaxDocumentsRequestHeader,
    /// Tax Form request object
    #[validate(nested)]
    pub body: TaxFormRequest,
}
impl PostGwApiV1TaxDocumentsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1TaxDocumentsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<TaxFormResponse>::json_with_diagnostics(req)
                .await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TaxDocumentsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1TaxDocumentsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1TaxDocumentsRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&PostGwApiV1TaxDocumentsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &PostGwApiV1TaxDocumentsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<PostGwApiV1TaxDocumentsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: PostGwApiV1TaxDocumentsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for post_gw_api_v1_tax_documents
#[derive(Debug, Clone)]
pub enum PostGwApiV1TaxDocumentsResponse {
    ///200: Returns a JSON object containing the relevant Tax Form.
    Ok(TaxFormResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// <br>**Scope**: `statements.write` OR `reports.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1TradeConfirmationsRequest {
    #[validate(nested)]
    pub header: PostGwApiV1TradeConfirmationsRequestHeader,
    /// Trade confirmation request body
    #[validate(nested)]
    pub body: TradeConfirmationRequest,
}
impl PostGwApiV1TradeConfirmationsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostGwApiV1TradeConfirmationsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<TradeConfirmationResponse>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::Unauthorized);
        }
        if status == http::StatusCode::PAYMENT_REQUIRED {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::PaymentRequired);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostGwApiV1TradeConfirmationsResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(PostGwApiV1TradeConfirmationsResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PostGwApiV1TradeConfirmationsRequestHeader {
    /// Specifies the authorization header value (e.g., Bearer eyJ0eXAiOiJKV1...).
    /// - Example: `"Bearer eyJ0eXAiOiJKV1...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&PostGwApiV1TradeConfirmationsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &PostGwApiV1TradeConfirmationsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<PostGwApiV1TradeConfirmationsRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: PostGwApiV1TradeConfirmationsRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for post_gw_api_v1_trade_confirmations
#[derive(Debug, Clone)]
pub enum PostGwApiV1TradeConfirmationsResponse {
    ///200: Returns a JSON object containing the relevant Trade Confirmation.
    Ok(TradeConfirmationResponse),
    ///400: Returns a Problem detail instance representing a bad request.
    BadRequest,
    ///401: Returns a Problem detail instance representing an unauthorized request.
    Unauthorized,
    ///402: Returns a Problem detail instance representing an unauthorized request.
    PaymentRequired,
    ///403: Returns a Problem detail instance representing a forbidden request.
    Forbidden,
    ///500: Returns a Problem detail instance representing an internal server error.
    InternalServerError,
    ///default: Unknown response
    Unknown,
}
/// Create a named watchlist by submitting a set of conids.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PostNewWatchlistRequest {
    /// Watchlist contents.
    #[validate(nested)]
    pub body: WatchlistRequestBody,
}
impl PostNewWatchlistRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PostNewWatchlistResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Watchlist200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(PostNewWatchlistResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PostNewWatchlistResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PostNewWatchlistResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PostNewWatchlistResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(PostNewWatchlistResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(PostNewWatchlistResponse::Unknown);
    }
}
/// Response types for postNewWatchlist
#[derive(Debug, Clone)]
pub enum PostNewWatchlistResponse {
    ///200: Watchlist creation successful.
    Ok(Watchlist200Response),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct PredefinedDestinationInstruction {
    /// - Example: `"U2323232".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 10u64))]
    pub account_id: String,
    /// - Example: `"ACH"`
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: PredefinedDestinationInstructionBankInstructionMethod,
    /// - Example: `"Instruction".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 100u64))]
    pub bank_instruction_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 3u64, max = 3u64))]
    pub currency: String,
    #[serde(rename = "financialInstitution")]
    #[validate(nested)]
    pub financial_institution: PredefinedDestinationInstructionFinancialInstitution,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PredefinedDestinationInstructionBankInstructionMethod {
    #[serde(rename = "LVP")]
    #[default]
    Lvp,
    #[serde(rename = "SEPA")]
    Sepa,
    #[serde(rename = "WIRE")]
    Wire,
    #[serde(rename = "ACH")]
    Ach,
    #[serde(rename = "CPA")]
    Cpa,
}
impl core::fmt::Display for PredefinedDestinationInstructionBankInstructionMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Lvp => write!(f, "LVP"),
            Self::Sepa => write!(f, "SEPA"),
            Self::Wire => write!(f, "WIRE"),
            Self::Ach => write!(f, "ACH"),
            Self::Cpa => write!(f, "CPA"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct PredefinedDestinationInstructionFinancialInstitution {
    #[serde(rename = "branchCode")]
    #[validate(length(min = 0u64, max = 32u64))]
    pub branch_code: Option<String>,
    /// - Example: `Some("BSB_AUD")`
    #[serde(rename = "branchCodeType")]
    pub branch_code_type:
        Option<PredefinedDestinationInstructionFinancialInstitutionBranchCodeType>,
    /// - Example: `"132456789".to_string()`
    #[serde(rename = "clientAccountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub client_account_id: String,
    /// - Example: `"SBIN001000".to_string()`
    #[validate(length(min = 1u64, max = 24u64))]
    pub identifier: String,
    /// - Example: `"BIC"`
    #[serde(rename = "identifierType")]
    pub identifier_type: PredefinedDestinationInstructionFinancialInstitutionIdentifierType,
    /// - Example: `"SBI BANK".to_string()`
    #[validate(length(min = 1u64, max = 100u64))]
    pub name: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PredefinedDestinationInstructionFinancialInstitutionBranchCodeType {
    #[serde(rename = "BSB_AUD")]
    #[default]
    BsbAud,
    #[serde(rename = "BANK_CODE_CAD")]
    BankCodeCad,
    #[serde(rename = "NONE")]
    None,
}
impl core::fmt::Display for PredefinedDestinationInstructionFinancialInstitutionBranchCodeType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::BsbAud => write!(f, "BSB_AUD"),
            Self::BankCodeCad => write!(f, "BANK_CODE_CAD"),
            Self::None => write!(f, "NONE"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum PredefinedDestinationInstructionFinancialInstitutionIdentifierType {
    #[serde(rename = "BIC")]
    #[default]
    Bic,
    #[serde(rename = "IFSC")]
    Ifsc,
}
impl core::fmt::Display for PredefinedDestinationInstructionFinancialInstitutionIdentifierType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Bic => write!(f, "BIC"),
            Self::Ifsc => write!(f, "IFSC"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
pub struct Presets {
    /// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
    ///   * `A` - Available Equity
    ///   * `E` - Equal
    ///   * `N` - Net Liquidation Value
    ///
    /// User-specified allocation methods:
    ///   * `C` - Cash Quantity
    ///   * `P` - Percentage
    ///   * `R` - Ratios
    ///   * `S` - Shares
    pub default_method_for_all: Option<PresetsDefaultMethodForAll>,
    /// Determines if allocation groups should prioritize closing positions over equal distribution.
    pub group_auto_close_positions: Option<bool>,
    /// Determines if the system should keep allocation groups proportional for scaling.
    pub group_proportional_allocation: Option<bool>,
    /// Determines if allocation profiles should prioritize closing positions over equal distribution.
    pub profiles_auto_close_positions: Option<bool>,
    /// Determines if the system should always check user credit before beginning the order process every time, or only at the time of order placement and execution.
    pub strict_credit_check: Option<bool>,
}
/// Interactive Brokers supports two forms of allocation methods. Allocation methods that have calculations completed by Interactive Brokers, and a set of allocation methods calculated by the user and then specified. IB-computed allocation methods:
///   * `A` - Available Equity
///   * `E` - Equal
///   * `N` - Net Liquidation Value
///
/// User-specified allocation methods:
///   * `C` - Cash Quantity
///   * `P` - Percentage
///   * `R` - Ratios
///   * `S` - Shares
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum PresetsDefaultMethodForAll {
    #[default]
    AvailableEquity,
    E,
    N,
    C,
    P,
    R,
    S,
}
impl core::fmt::Display for PresetsDefaultMethodForAll {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::AvailableEquity => write!(f, "AvailableEquity"),
            Self::E => write!(f, "E"),
            Self::N => write!(f, "N"),
            Self::C => write!(f, "C"),
            Self::P => write!(f, "P"),
            Self::R => write!(f, "R"),
            Self::S => write!(f, "S"),
        }
    }
}
/// Preview the projected effects of an order ticket or bracket of orders, including cost and changes to margin and account equity.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct PreviewMarginImpactRequest {
    #[validate(nested)]
    pub path: PreviewMarginImpactRequestPath,
    #[validate(nested)]
    pub body: OrdersSubmissionRequest,
}
impl PreviewMarginImpactRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<PreviewMarginImpactResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<OrderPreview>::json_with_diagnostics(req).await?;
            return Ok(PreviewMarginImpactResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(PreviewMarginImpactResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(PreviewMarginImpactResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(PreviewMarginImpactResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(PreviewMarginImpactResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(PreviewMarginImpactResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct PreviewMarginImpactRequestPath {
    /// The account to which the order will clear.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for previewMarginImpact
#[derive(Debug, Clone)]
pub enum PreviewMarginImpactResponse {
    ///200: Order Preview
    Ok(OrderPreview),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Query201Response {
    #[default]
    RecentRecurringEvent(QueryRecentRecurringEventResponse),
    BankInstruction(QueryBankInstructionResponse),
    RecurringInstructions(QueryRecurringInstructionsResponse),
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Query201Response2 {
    #[default]
    QueryWithdrawableAmountsResponse(QueryWithdrawableAmountsResponse),
    WithoutOriginHold(QueryWithdrawableAmountsWithoutOriginHoldResponse),
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryBankInstruction {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// - Example: `"WIRE"`
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: BankInstructionMethod,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryBankInstructionResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryBankInstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryBankInstructionResult {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "bankInstructionDetails")]
    pub bank_instruction_details: Vec<QueryBankInstructionResultBankInstructionDetail>,
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: BankInstructionMethod,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: InstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryBankInstructionResultBankInstructionDetail {
    /// - Example: `"*****0000".to_string()`
    #[serde(rename = "bankAccountNumber")]
    pub bank_account_number: String,
    /// - Example: `"000000000".to_string()`
    #[serde(rename = "bankRoutingNumber")]
    pub bank_routing_number: String,
    /// - Example: `"USD".to_string()`
    pub currency: String,
    /// - Example: `"testinstr".to_string()`
    #[serde(rename = "instructionName")]
    pub instruction_name: String,
    /// - Example: `"PROCESSED".to_string()`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: String,
    /// - Example: `"CREDIT".to_string()`
    #[serde(rename = "type")]
    pub r#type: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryIRAContributions {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"2003".to_string()`
    #[validate(length(min = 4u64, max = 4u64))]
    pub year: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryIRAContributionsResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryIRAContributionsResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryIRAContributionsResult {
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    pub contributions: Vec<QueryIRAContributionsResultContribution>,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    #[serde(rename = "iraType")]
    pub ira_type: String,
    pub year: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryIRAContributionsResultContribution {
    #[serde(rename = "allowedContributionLimit")]
    pub allowed_contribution_limit: f64,
    #[serde(rename = "maximumContributionLimit")]
    pub maximum_contribution_limit: f64,
    #[serde(rename = "yearToDateContribution")]
    pub year_to_date_contribution: f64,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum QueryInstructionKind {
    #[default]
    BankInstruction(QueryBankInstruction),
    RecentRecurringEvents(QueryRecentRecurringEvents),
    RecurringInstructions(QueryRecurringInstructions),
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum QueryInstructionKind2 {
    #[default]
    WithdrawableFunds(QueryWithdrawableFunds),
    IRAContributions(QueryIRAContributions),
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentInstructionResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryRecentInstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentInstructionResult {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    #[serde(rename = "instructionHistory")]
    pub instruction_history: QueryRecentInstructionResultInstructionHistory,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentInstructionResultInstructionHistory {
    #[serde(rename = "historyMaxDepthNumberOfDays")]
    pub history_max_depth_number_of_days: i32,
    #[serde(rename = "historyMaxDepthNumberOfInstruction")]
    pub history_max_depth_number_of_instruction: i32,
    pub result: Vec<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryRecentInstructions {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    #[serde(rename = "transactionHistory")]
    #[validate(nested)]
    pub transaction_history: QueryRecentInstructionsTransactionHistory,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryRecentInstructionsTransactionHistory {
    /// - Example: `5.0`
    #[serde(rename = "daysToGoBack")]
    #[validate(range(min = 1.0))]
    pub days_to_go_back: f64,
    /// - Example: `Some("INTERNAL_CASH_TRANSFER")`
    #[serde(rename = "transactionType")]
    pub transaction_type: Option<QueryRecentInstructionsTransactionHistoryTransactionType>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum QueryRecentInstructionsTransactionHistoryTransactionType {
    #[serde(rename = "ALL")]
    #[default]
    All,
    #[serde(rename = "ACH_INSTRUCTION")]
    AchInstruction,
    #[serde(rename = "PREDEFINED_DESTINATION_INSTRUCTION")]
    PredefinedDestinationInstruction,
    #[serde(rename = "WITHDRAWAL")]
    Withdrawal,
    #[serde(rename = "DEPOSIT")]
    Deposit,
    #[serde(rename = "DWAC")]
    Dwac,
    #[serde(rename = "FOP")]
    Fop,
    #[serde(rename = "EDDA_INSTRUCTION")]
    EddaInstruction,
    #[serde(rename = "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")]
    TraditionalBankInstructionVerification,
    #[serde(rename = "CANCEL_INSTRUCTION")]
    CancelInstruction,
    #[serde(rename = "DELETE_BANK_INSTRUCTION")]
    DeleteBankInstruction,
    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
    ExternalPositionTransfer,
    #[serde(rename = "INTERNAL_CASH_TRANSFER")]
    InternalCashTransfer,
    #[serde(rename = "INTERNAL_POSITION_TRANSFER")]
    InternalPositionTransfer,
    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
    ComplexAssetTransfer,
}
impl core::fmt::Display for QueryRecentInstructionsTransactionHistoryTransactionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::All => write!(f, "ALL"),
            Self::AchInstruction => write!(f, "ACH_INSTRUCTION"),
            Self::PredefinedDestinationInstruction => {
                write!(f, "PREDEFINED_DESTINATION_INSTRUCTION")
            }
            Self::Withdrawal => write!(f, "WITHDRAWAL"),
            Self::Deposit => write!(f, "DEPOSIT"),
            Self::Dwac => write!(f, "DWAC"),
            Self::Fop => write!(f, "FOP"),
            Self::EddaInstruction => write!(f, "EDDA_INSTRUCTION"),
            Self::TraditionalBankInstructionVerification => {
                write!(f, "TRADITIONAL_BANK_INSTRUCTION_VERIFICATION")
            }
            Self::CancelInstruction => write!(f, "CANCEL_INSTRUCTION"),
            Self::DeleteBankInstruction => write!(f, "DELETE_BANK_INSTRUCTION"),
            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
            Self::InternalCashTransfer => write!(f, "INTERNAL_CASH_TRANSFER"),
            Self::InternalPositionTransfer => write!(f, "INTERNAL_POSITION_TRANSFER"),
            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentRecurringEventResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryRecentRecurringEventResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentRecurringEventResult {
    pub amount: f64,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    pub currency: String,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: InstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    pub method: String,
    #[serde(rename = "recurringInstructionName")]
    pub recurring_instruction_name: String,
    #[serde(rename = "recurringTransactionStatus")]
    pub recurring_transaction_status: String,
    #[serde(rename = "recurringTransactionType")]
    pub recurring_transaction_type: String,
    #[serde(rename = "transactionHistory")]
    pub transaction_history: QueryRecentRecurringEventResultTransactionHistory,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentRecurringEventResultTransactionHistory {
    #[serde(rename = "maxNumberOfTransactions")]
    pub max_number_of_transactions: Option<i32>,
    pub result: Option<Vec<QueryRecentRecurringEventResultTransactionHistoryResult>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecentRecurringEventResultTransactionHistoryResult {
    #[serde(rename = "ibRequestId")]
    pub ib_request_id: Option<i32>,
    pub status: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryRecentRecurringEvents {
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `-343872793.0`
    #[serde(rename = "ibReferenceId")]
    #[validate(range(min = 0.0))]
    pub ib_reference_id: f64,
    /// - Example: `Some(15.0)`
    #[serde(rename = "numberOfTransactions")]
    #[validate(range(min = 1.0))]
    pub number_of_transactions: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryRecurringInstructions {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecurringInstructionsResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryRecurringInstructionsResult>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecurringInstructionsResult {
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: InstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    #[serde(rename = "recurringInstructions")]
    pub recurring_instructions: Vec<QueryRecurringInstructionsResultRecurringInstruction>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryRecurringInstructionsResultRecurringInstruction {
    pub amount: Option<f64>,
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: Option<String>,
    #[serde(rename = "bankInstructionName")]
    pub bank_instruction_name: Option<String>,
    pub currency: Option<String>,
    #[serde(rename = "endDate")]
    pub end_date: Option<String>,
    pub frequency: Option<String>,
    #[serde(rename = "requestId")]
    pub request_id: Option<i32>,
    #[serde(rename = "startDate")]
    pub start_date: Option<String>,
    #[serde(rename = "transactionType")]
    pub transaction_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct QueryRequestBody {
    pub instruction: QueryRequestBodyInstruction,
    #[serde(rename = "instructionType")]
    #[default("QUERY_WITHDRAWABLE_CASH_EQUITY".to_string())]
    pub instruction_type: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct QueryRequestBody2 {
    pub instruction: QueryInstructionKind,
    #[serde(rename = "instructionType")]
    pub instruction_type: QueryRequestBody2InstructionType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum QueryRequestBody2InstructionType {
    #[serde(rename = "QUERY_BANK_INSTRUCTION")]
    #[default]
    QueryBankInstruction,
    #[serde(rename = "QUERY_RECENT_RECURRING_EVENTS")]
    QueryRecentRecurringEvents,
    #[serde(rename = "QUERY_RECURRING_INSTRUCTIONS")]
    QueryRecurringInstructions,
}
impl core::fmt::Display for QueryRequestBody2InstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::QueryBankInstruction => write!(f, "QUERY_BANK_INSTRUCTION"),
            Self::QueryRecentRecurringEvents => {
                write!(f, "QUERY_RECENT_RECURRING_EVENTS")
            }
            Self::QueryRecurringInstructions => write!(f, "QUERY_RECURRING_INSTRUCTIONS"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct QueryRequestBody3 {
    pub instruction: QueryInstructionKind2,
    #[serde(rename = "instructionType")]
    pub instruction_type: QueryRequestBody3InstructionType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum QueryRequestBody3InstructionType {
    #[serde(rename = "QUERY_WITHDRAWABLE_FUNDS")]
    #[default]
    QueryWithdrawableFunds,
    #[serde(rename = "QUERY_IRA_CONTRIBUTIONS")]
    QueryIraContributions,
}
impl core::fmt::Display for QueryRequestBody3InstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::QueryWithdrawableFunds => write!(f, "QUERY_WITHDRAWABLE_FUNDS"),
            Self::QueryIraContributions => write!(f, "QUERY_IRA_CONTRIBUTIONS"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct QueryRequestBody4 {
    #[validate(nested)]
    pub instruction: QueryRecentInstructions,
    #[serde(rename = "instructionType")]
    #[default("QUERY_RECENT_INSTRUCTIONS".to_string())]
    pub instruction_type: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum QueryRequestBodyInstruction {
    #[default]
    QueryWithdrawableCashEquity(QueryWithdrawableCashEquity),
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryWithdrawableAmountsInstructionResult {
    #[serde(rename = "accountId")]
    pub account_id: String,
    #[serde(rename = "allowedTransferAmountToMaster")]
    pub allowed_transfer_amount_to_master: f64,
    #[serde(rename = "allowedTransferAmountToMasterNoBorrow")]
    pub allowed_transfer_amount_to_master_no_borrow: f64,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    pub currency: String,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    #[serde(rename = "withdrawableAmount")]
    pub withdrawable_amount: f64,
    #[serde(rename = "withdrawableAmountNoBorrow")]
    pub withdrawable_amount_no_borrow: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryWithdrawableAmountsResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryWithdrawableAmountsInstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryWithdrawableAmountsWithoutOriginHoldResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<QueryWithdrawableAmountsWithoutOriginHoldResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QueryWithdrawableAmountsWithoutOriginHoldResult {
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    pub currency: String,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    #[serde(rename = "withdrawableAmountWithoutOriginationHold")]
    pub withdrawable_amount_without_origination_hold: f64,
    #[serde(rename = "withdrawableAmountWithoutOriginationHoldNoBorrow")]
    pub withdrawable_amount_without_origination_hold_no_borrow: f64,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryWithdrawableCashEquity {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 3u64, max = 3u64))]
    pub currency: String,
}
#[serde_with::skip_serializing_none]
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct QueryWithdrawableCashEquityResponse {
    #[serde(rename = "instructionResult")]
    #[validate(nested)]
    pub instruction_result: Option<QueryWithdrawableCashEquityResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[serde_with::skip_serializing_none]
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct QueryWithdrawableCashEquityResult {
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    #[serde(rename = "availableEquityValue")]
    pub available_equity_value: f64,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    #[validate(length(min = 1u64))]
    pub currency: String,
    /// - Example: `Some("Please poll for status after 10 minutes".to_string())`
    pub description: Option<String>,
    #[validate(nested)]
    pub error: Option<ResultError>,
    /// - Example: `Some(23456745.0)`
    #[serde(rename = "ibReferenceId")]
    pub ib_reference_id: Option<f64>,
    /// - Example: `45123654.0`
    #[serde(rename = "instructionId")]
    pub instruction_id: f64,
    /// - Example: `"PENDING"`
    #[serde(rename = "instructionStatus")]
    pub instruction_status: PollingInstructionResultInstructionStatus,
    /// - Example: `"INTERNAL_CASH_TRANSFER"`
    #[serde(rename = "instructionType")]
    pub instruction_type: InstructionResultInstructionType,
    #[serde(rename = "withdrawableCashAmount")]
    pub withdrawable_cash_amount: f64,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct QueryWithdrawableFunds {
    /// - Example: `"U399192".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// If bankAccountNumber is provided then bankRoutingNumber is also required, cannot be passed with bankInstructionName
    /// - Example: `Some("9876543210".to_string())`
    #[serde(rename = "bankAccountNumber")]
    #[validate(length(min = 1u64))]
    pub bank_account_number: Option<String>,
    /// bankInstructionName cannot be passed with (bankAccountNumber or bankRoutingNumber)
    /// - Example: `Some("test".to_string())`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64))]
    pub bank_instruction_name: Option<String>,
    /// If bankRoutingNumber is provided then bankAccountNumber is also required, cannot be passed with bankInstructionName
    /// - Example: `Some("122199983".to_string())`
    #[serde(rename = "bankRoutingNumber")]
    #[validate(length(min = 1u64))]
    pub bank_routing_number: Option<String>,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64))]
    pub currency: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct QuestionnaireResponse {
    pub answers: Option<Vec<AnswerResponse>>,
    #[serde(rename = "isMandatoryToAnswer")]
    pub is_mandatory_to_answer: Option<bool>,
    pub question: Option<String>,
    #[serde(rename = "questionId")]
    pub question_id: Option<i64>,
    #[serde(rename = "questionType")]
    pub question_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RateResponse {
    /// Returns the exchange rate for the currency pair.
    pub rate: Option<f64>,
}
/// Mark a specific disclaimer message as read.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ReadFyiDisclaimerRequest {
    pub path: ReadFyiDisclaimerRequestPath,
}
impl ReadFyiDisclaimerRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ModifyFyiDeliveryResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<FyiVT>::json_with_diagnostics(req).await?;
            return Ok(ModifyFyiDeliveryResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ModifyFyiDeliveryResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ModifyFyiDeliveryResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ReadFyiDisclaimerRequestPath {
    /// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
    ///   * `BA` - Borrow Availability
    ///   * `CA` - Comparable Algo
    ///   * `DA` - Dividends Advisory
    ///   * `EA` - Upcoming Earnings
    ///   * `MF` - Mutual Fund Advisory
    ///   * `OE` - Option Expiration
    ///   * `PR` - Portfolio Builder Rebalance
    ///   * `SE` - Suspend Order on Economic Event
    ///   * `SG` - Short Term Gain turning Long Term
    ///   * `SM` - System Messages
    ///   * `T2` - Assignment Realizing Long-Term Gains
    ///   * `TO` - Takeover
    ///   * `UA` - User Alert
    ///   * `M8` - M871 Trades
    ///   * `PS` - Platform Use Suggestions
    ///   * `DL` - Unexercised Option Loss Prevention Reminder
    ///   * `PT` - Position Transfer
    ///   * `CB` - Missing Cost Basis
    ///   * `MS` - Milestones
    ///   * `TD` - MiFID || 10% Deprecation Notice
    ///   * `ST` - Save Taxes
    ///   * `TI` - Trade Idea
    ///   * `CT` - Cash Transfer
    pub typecode: Typecodes,
}
/// Mark a particular notification message as read or unread.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ReadFyiNotificationRequest {
    pub path: ReadFyiNotificationRequestPath,
}
impl ReadFyiNotificationRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ReadFyiNotificationResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                NotificationReadAcknowledge,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(ReadFyiNotificationResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ReadFyiNotificationResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ReadFyiNotificationResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ReadFyiNotificationResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ReadFyiNotificationResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ReadFyiNotificationResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ReadFyiNotificationRequestPath {
    /// Code used to signify a specific notification to mark. Value received from /fyi/notifications
    pub notification_id: serde_json::Value,
}
/// Response types for readFyiNotification
#[derive(Debug, Clone)]
pub enum ReadFyiNotificationResponse {
    ///200: Successfully enabled or disabled your email notifications.
    Ok(NotificationReadAcknowledge),
    ///400: Invalid input format or missing required fields
    BadRequest,
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct RecurringInstructionDetail {
    /// - Example: `Some("2023-10-16".to_string())`
    #[serde(rename = "endDate")]
    pub end_date: Option<String>,
    /// - Example: `"MONTHLY"`
    pub frequency: RecurringInstructionDetailFrequency,
    /// - Example: `"Arkansas-Test".to_string()`
    #[serde(rename = "instructionName")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub instruction_name: String,
    /// - Example: `"2023-10-16".to_string()`
    #[serde(rename = "startDate")]
    #[validate(length(min = 1u64))]
    pub start_date: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum RecurringInstructionDetailFrequency {
    #[serde(rename = "MONTHLY")]
    #[default]
    Monthly,
    #[serde(rename = "QUARTERLY")]
    Quarterly,
    #[serde(rename = "YEARLY")]
    Yearly,
}
impl core::fmt::Display for RecurringInstructionDetailFrequency {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Monthly => write!(f, "MONTHLY"),
            Self::Quarterly => write!(f, "QUARTERLY"),
            Self::Yearly => write!(f, "YEARLY"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RegistrationTask {
    pub action: Option<String>,
    #[serde(rename = "dateCompleted")]
    pub date_completed: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "externalId")]
    pub external_id: Option<String>,
    #[serde(rename = "formName")]
    pub form_name: Option<String>,
    #[serde(rename = "formNumber")]
    pub form_number: Option<i32>,
    #[serde(rename = "isCompleted")]
    pub is_completed: Option<bool>,
    #[serde(rename = "isDeclined")]
    pub is_declined: Option<bool>,
    #[serde(rename = "isRequiredForApproval")]
    pub is_required_for_approval: Option<bool>,
    #[serde(rename = "questionIds")]
    pub question_ids: Option<Vec<i32>>,
    pub state: Option<String>,
    pub warning: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RegistrationTasksResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    pub description: Option<String>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "registrationTaskPresent")]
    pub registration_task_present: Option<bool>,
    #[serde(rename = "registrationTasks")]
    pub registration_tasks: Option<Vec<RegistrationTask>>,
    pub state: Option<String>,
    pub status: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Reply200Response {
    /// A successful submission of one or more order tickets.
    #[default]
    OrderSubmitSuccess(OrderSubmitSuccess),
    /// An array containing objects that each deliver the order reply messages emitted against one order ticket in the submission request's array.  Indicies of the order reply message objects in this array correspond to the indicies of the order tickets in the submission request's array.
    OrderReplyMessage(OrderReplyMessage),
    /// Indicates that the order reply message or submission was not accepted.
    OrderSubmitError(OrderSubmitError),
    /// Indicates that the order reply ID does not exist.
    OrderReplyNotFound(OrderReplyNotFound),
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    AdvancedOrderReject(AdvancedOrderReject),
}
impl Reply200Response {
    /// Indicates that the order reply message or submission was not accepted.
    pub fn order_submit_error(error: Option<String>) -> Self {
        Self::OrderSubmitError(OrderSubmitError {
            error,
            ..Default::default()
        })
    }
    /// Indicates that the order reply ID does not exist.
    pub fn order_reply_not_found(error: Option<String>) -> Self {
        Self::OrderReplyNotFound(OrderReplyNotFound {
            error,
            ..Default::default()
        })
    }
    /// Relates a message generated in response to the rejection of the submitted order ticket. In some cases, it may also present a mechanism to resubmit the same order following a prompted decision.
    pub fn advanced_order_reject() -> Self {
        Self::AdvancedOrderReject(AdvancedOrderReject::default())
    }
}
/// Request an access token for the IB username that has granted authorization to the consumer.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ReqAccessTokenRequest {
    pub header: ReqAccessTokenRequestHeader,
}
impl ReqAccessTokenRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ReqAccessTokenResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<AccessToken200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(ReqAccessTokenResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ReqAccessTokenResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ReqAccessTokenResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ReqAccessTokenResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ReqAccessTokenRequestHeader {
    /// OAuth 1.0a authorization request header for request to /access_token endpoint.
    /// - Example: `Some("OAuth oauth_verifier=\"1e1dc5666e87ca5a18e0\",oauth_token=\"e0d75b4c5c1d2c0f2af7\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"v235...456h\",oauth_signature=\"af1%252...0nd2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489450\",realm=\"test_realm\"".to_string())`
    pub authorization: Option<String>,
}
impl core::convert::TryFrom<&ReqAccessTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: &ReqAccessTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        if let Some(value) = &headers.authorization {
            let header_value = http::HeaderValue::try_from(value)?;
            map.insert(AUTHORIZATION, header_value);
        }
        Ok(map)
    }
}
impl core::convert::TryFrom<ReqAccessTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: ReqAccessTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for reqAccessToken
#[derive(Debug, Clone)]
pub enum ReqAccessTokenResponse {
    ///200: Success response with permanent OAuth access token
    Ok(AccessToken200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct ReqIDRequestBody {
    /// Request identifier to uniquely track a request.
    /// - Example: `540_608i32`
    #[serde(rename = "reqID")]
    pub req_id: i32,
}
/// Generate a Live Session Token shared secret and gain access to Web API.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ReqLiveSessionTokenRequest {
    pub header: ReqLiveSessionTokenRequestHeader,
}
impl ReqLiveSessionTokenRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ReqLiveSessionTokenResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<
                LiveSessionToken200Response,
            >::json_with_diagnostics(req)
                .await?;
            return Ok(ReqLiveSessionTokenResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ReqLiveSessionTokenResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ReqLiveSessionTokenResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ReqLiveSessionTokenResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ReqLiveSessionTokenRequestHeader {
    /// OAuth 1.0a authorization request header for request to /live_session_token endpoint.
    /// - Example: `Some("OAuth diffie_hellman_challenge=\"b393...g6f3\",oauth_token=\"56786fc07bcbabc4584\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"v235...456h\",oauth_signature=\"af1%252...0nd2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489460\",realm=\"test_realm\"".to_string())`
    pub authorization: Option<String>,
}
impl core::convert::TryFrom<&ReqLiveSessionTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: &ReqLiveSessionTokenRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        if let Some(value) = &headers.authorization {
            let header_value = http::HeaderValue::try_from(value)?;
            map.insert(AUTHORIZATION, header_value);
        }
        Ok(map)
    }
}
impl core::convert::TryFrom<ReqLiveSessionTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(
        headers: ReqLiveSessionTokenRequestHeader,
    ) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for reqLiveSessionToken
#[derive(Debug, Clone)]
pub enum ReqLiveSessionTokenResponse {
    ///200: Success response with Diffie-Hellman challenge and Signature value
    Ok(LiveSessionToken200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Request a temporary token as a third party to begin the OAuth 1.0a authorization workflow.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ReqTempTokenRequest {
    pub header: ReqTempTokenRequestHeader,
}
impl ReqTempTokenRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ReqTempTokenResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<OauthTokenResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(ReqTempTokenResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ReqTempTokenResponse::Unauthorized);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ReqTempTokenResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ReqTempTokenResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, oas3_gen_support::Default)]
pub struct ReqTempTokenRequestHeader {
    /// OAuth 1.0a authorization request header for request to /request_token endpoint.
    /// - Example: `Some("OAuth oauth_callback=\"oob\",oauth_consumer_key=\"TESTCONS\",oauth_nonce=\"b249...8f57\",oauth_signature=\"41Sx%252...ZYZ2\",oauth_signature_method=\"RSA-SHA256\",oauth_timestamp=\"1714489440\",realm=\"test_realm\"".to_string())`
    pub authorization: Option<String>,
}
impl core::convert::TryFrom<&ReqTempTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: &ReqTempTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        if let Some(value) = &headers.authorization {
            let header_value = http::HeaderValue::try_from(value)?;
            map.insert(AUTHORIZATION, header_value);
        }
        Ok(map)
    }
}
impl core::convert::TryFrom<ReqTempTokenRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: ReqTempTokenRequestHeader) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
/// Response types for reqTempToken
#[derive(Debug, Clone)]
pub enum ReqTempTokenResponse {
    ///200: Success response with temporary OAuth access token
    Ok(OauthTokenResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RequestDetail {
    #[serde(rename = "accountID")]
    pub account_id: Option<String>,
    #[serde(rename = "dateSubmitted")]
    pub date_submitted: Option<String>,
    #[serde(rename = "requestId")]
    pub request_id: Option<i64>,
    #[serde(rename = "requestType")]
    pub request_type: Option<String>,
    pub status: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct RequestDetailsRequest {
    #[serde(rename = "endDate")]
    pub end_date: chrono::NaiveDate,
    #[validate(range(min = 1i32, max = 1_000i32))]
    pub limit: Option<i32>,
    #[validate(range(min = 0i32))]
    pub offset: Option<i32>,
    #[serde(rename = "startDate")]
    pub start_date: chrono::NaiveDate,
    pub status: Option<RequestStatus>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RequestDetailsResponse {
    pub limit: Option<i32>,
    pub offset: Option<i32>,
    #[serde(rename = "requestDetails")]
    pub request_details: Option<Vec<RequestDetail>>,
    pub total: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum RequestStatus {
    #[default]
    N,
    O,
    P,
    C,
    A,
    E,
    F,
    I,
    J,
    L,
    M,
    R,
    W,
    Q,
}
impl core::fmt::Display for RequestStatus {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::N => write!(f, "N"),
            Self::O => write!(f, "O"),
            Self::P => write!(f, "P"),
            Self::C => write!(f, "C"),
            Self::A => write!(f, "A"),
            Self::E => write!(f, "E"),
            Self::F => write!(f, "F"),
            Self::I => write!(f, "I"),
            Self::J => write!(f, "J"),
            Self::L => write!(f, "L"),
            Self::M => write!(f, "M"),
            Self::R => write!(f, "R"),
            Self::W => write!(f, "W"),
            Self::Q => write!(f, "Q"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, oas3_gen_support::Default)]
pub struct RequiredFormsRequest {
    #[serde(rename = "accountType")]
    pub account_type: Option<String>,
    #[serde(rename = "additionalAccount")]
    pub additional_account: Option<bool>,
    #[serde(rename = "additionalApplicant")]
    pub additional_applicant: Option<bool>,
    #[serde(rename = "applicantType")]
    pub applicant_type: Option<String>,
    pub capability: Option<Vec<String>>,
    #[serde(rename = "faTradingAccount")]
    pub fa_trading_account: Option<bool>,
    pub ira: Option<bool>,
    #[serde(rename = "iraType")]
    pub ira_type: Option<String>,
    #[serde(rename = "mifidCategory")]
    pub mifid_category: Option<String>,
    #[serde(rename = "processType")]
    pub process_type: Option<String>,
    #[serde(rename = "requestedFCBP")]
    pub requested_fcbp: Option<bool>,
    #[serde(rename = "requestedSYEP")]
    pub requested_syep: Option<bool>,
    #[serde(rename = "residenceCountry")]
    pub residence_country: Option<String>,
    #[serde(rename = "tradingPermissions")]
    pub trading_permissions: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RequiredFormsResponse {
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    pub forms: Option<Vec<String>>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
}
/// Removes suppression of all order reply messages that were previously suppressed in the current brokerage session.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct ResetOrderSuppressionRequest {}
impl ResetOrderSuppressionRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<ResetOrderSuppressionResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<StatusResponse3>::json_with_diagnostics(req)
                .await?;
            return Ok(ResetOrderSuppressionResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ResetOrderSuppressionResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ResetOrderSuppressionResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(ResetOrderSuppressionResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(ResetOrderSuppressionResponse::Unknown);
    }
}
/// Response types for resetOrderSuppression
#[derive(Debug, Clone)]
pub enum ResetOrderSuppressionResponse {
    ///200: Request's status
    Ok(StatusResponse3),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ResponseData {
    /// specify response media types that are acceptable
    pub accept: Option<String>,
    /// the data type of the value after decoding
    #[serde(rename = "dataType")]
    pub data_type: Option<String>,
    /// encoding used for the value
    pub encoding: Option<String>,
    /// content encoding flag. Represents whether the response is compressed
    pub gzip: Option<bool>,
    /// mimeType of document after decoding and serializing the value
    #[serde(rename = "mimeType")]
    pub mime_type: Option<String>,
    /// Base 64 encoded String of byte[]. Byte[] represents compressed data when gzip is true
    pub value: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ResponseFileResponse {
    pub data: Option<serde_json::Value>,
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "isProcessed")]
    pub is_processed: Option<bool>,
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct RestrictionInfo {
    #[serde(rename = "byIB")]
    pub by_ib: Option<bool>,
    pub id: Option<i32>,
    pub name: Option<String>,
}
/// Signed JWT token
pub type RestrictionRequestBody = String;
#[derive(
    Debug, Clone, PartialEq, Serialize, Deserialize, validator::Validate, oas3_gen_support::Default,
)]
pub struct ResultError {
    #[serde(rename = "errorCode")]
    #[validate(length(min = 1u64))]
    pub error_code: String,
    #[serde(rename = "errorMessage")]
    #[validate(length(min = 1u64))]
    pub error_message: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Rule200Response {
    /// Allowed to sell shares you own.
    pub allow_sell_long: Option<bool>,
    /// Indicates the industry category of the instrument.
    pub category: Option<String>,
    /// Classification of Financial Instrument codes
    pub cfi_code: Option<String>,
    pub classifier: Option<String>,
    /// Indicates the name of the company or index.
    pub company_name: Option<String>,
    /// Indicates the contract identifier of the given contract.
    pub con_id: Option<i32>,
    pub contract_clarification_type: Option<String>,
    /// Indicates the year and month the contract expires.
    pub contract_month: Option<String>,
    /// Base currency contract is traded in.
    pub currency: Option<String>,
    /// Returns the CUSIP for the given instrument. Only used in BOND trading.
    pub cusip: Option<String>,
    /// Indicates the primary exchange for which the contract can be traded.
    pub exchange: Option<String>,
    /// Returns the expiration month of the contract.
    pub expiry_full: Option<String>,
    /// Specific group of companies or businesses.
    pub industry: Option<String>,
    /// Asset class of the instrument.
    pub instrument_type: Option<String>,
    /// Indicates if the contract supports zero commission trading.
    pub is_zero_commission_security: Option<bool>,
    /// Contract's symbol from primary exchange. For options it is the OCC symbol.
    pub local_symbol: Option<String>,
    /// Indicates the final maturity date of the given contract.
    pub maturity_date: Option<String>,
    /// Indicates the multiplier of the contract.
    pub multiplier: Option<String>,
    /// Indicates if the contract can be traded outside regular trading hours or not.
    pub r_t_h: Option<bool>,
    /// detailed contract information
    pub rules: Option<ContractRules>,
    /// Indicates if the contract can be smart routed or not.
    pub smart_available: Option<bool>,
    /// Underlying symbol
    pub symbol: Option<String>,
    /// Indicates the display name of the contract, as shown with Client Portal.
    pub text: Option<String>,
    /// Designated trading class of the contract.
    pub trading_class: Option<String>,
    /// Underlying contract identifier for the requested contract.
    pub underlying_con_id: Option<i32>,
    /// Indicates the issuer of the underlying.
    pub underlying_issuer: Option<String>,
    /// Comma separated list of support exchanges or trading venues.
    pub valid_exchanges: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct RuleRequestBody {
    /// Contract identifier for the interested contract.
    pub conid: i32,
    /// Side of the market rules apply too. Set to true for Buy Orders, set to false for Sell orders.
    #[serde(rename = "isBuy")]
    #[default(Some(true))]
    pub is_buy: Option<bool>,
    /// Used to find trading rules related to an existing order.
    #[serde(rename = "modifyOrder")]
    #[default(Some(false))]
    pub modify_order: Option<bool>,
    /// Specify the order identifier used for tracking a given order.
    #[serde(rename = "orderId")]
    pub order_id: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Save200Response {
    /// Report the behavior when attempting to save.
    pub error: Option<String>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Describes if the model is in polling mode.
    #[serde(rename = "subscriptionStatus")]
    pub subscription_status: Option<i32>,
    /// Signifies that the request was successfully submitted.
    pub success: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Save200Response2 {
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_607i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Signifies that the request was successfully submitted.
    pub success: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct SaveRequestBody {
    /// Array target cash objects
    #[serde(rename = "cashTargets")]
    pub cash_targets: Vec<SaveRequestBodyCashTarget>,
    /// Personal description of model to read in IBKR GUI elements.
    #[validate(length(min = 1u64))]
    pub desc: String,
    /// Determine if investing and rebalancing should be handled statically or dynamically.
    ///  * `true` - Static models will always use the original targets.
    ///  * `false` - Dynamic models will adjust allocation in response to market movements.
    #[serde(rename = "isStatic")]
    pub is_static: bool,
    /// Name of your model.
    /// - Example: `"Sample-Model".to_string()`
    #[validate(length(min = 1u64))]
    pub model: String,
    /// List containing all contracts to hold in the model.
    #[serde(rename = "positionTargets")]
    pub position_targets: Vec<SaveRequestBodyPositionTarget>,
    /// Request identifier to uniquely track a request.
    /// - Example: `540_607i32`
    #[serde(rename = "reqID")]
    pub req_id: i32,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SaveRequestBodyCashTarget {
    /// Currency code to hold positions.
    /// - Example: `Some("USD".to_string())`
    pub ccy: Option<String>,
    /// Percentage of model to distribute to the given currency.
    /// - Example: `Some(0.0)`
    pub target: Option<f64>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SaveRequestBodyPositionTarget {
    /// Contract identifier, conid, to designate which security to hold.
    /// - Example: `Some(265_598i32)`
    pub conid: Option<i32>,
    /// Percentage of model to distribute to the given currency.
    /// - Example: `Some(0.0)`
    pub target: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ScheduleResponse {
    /// Returns the time zone the exchange trades in.
    pub exchange_time_zone: Option<String>,
    /// Returns a series of date objects of the given contract.
    pub schedules: Option<ScheduleResponseSchedules>,
}
/// Returns a series of date objects of the given contract.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ScheduleResponseSchedules {
    /// object containing the  of hours objects detailing extended and liquid trading.
    pub date: Option<ScheduleResponseSchedulesDate>,
}
/// object containing the  of hours objects detailing extended and liquid trading.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ScheduleResponseSchedulesDate {
    pub extended_hours: Option<Vec<ScheduleResponseSchedulesDateExtendedHour>>,
    pub liquid_hours: Option<Vec<ScheduleResponseSchedulesDateLiquidHour>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ScheduleResponseSchedulesDateExtendedHour {
    /// Determines if DAY orders are canceled after 'closing' time.
    pub cancel_daily_orders: Option<bool>,
    /// Epoch timestamp of the exchange's close.
    pub closing: Option<i32>,
    /// Epoch timestamp of the exchange's open.
    pub opening: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct ScheduleResponseSchedulesDateLiquidHour {
    /// Epoch timestamp of the exchange's close.
    pub closing: Option<i32>,
    /// Epoch timestamp of the exchange's open.
    pub opening: Option<i32>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct SearchRequestBody {
    /// fund search
    pub fund: Option<bool>,
    #[serde(rename = "fundFamilyConidEx")]
    pub fund_family_conid_ex: Option<String>,
    pub more: Option<bool>,
    /// Denotes if the symbol value is the ticker symbol or part of the company's name.
    pub name: Option<bool>,
    /// pattern search
    pub pattern: Option<bool>,
    pub referrer: Option<String>,
    /// Available underlying security types:
    ///   * `STK` - Represents an underlying as a Stock security type.
    ///   * `IND` - Represents an underlying as an Index security type.
    ///   * `BOND` - Represents an underlying as a Bond security type.
    #[serde(rename = "secType")]
    #[default(Some(Default::default()))]
    pub sec_type: Option<GetContractSymbolsRequestQuerySecType>,
    /// The ticker symbol, bond issuer type, or company name of the equity you are looking to trade.
    /// - Example: `"AAPL".to_string()`
    #[validate(length(min = 1u64))]
    pub symbol: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SecDefInfoResponse {
    /// Name of the company for the given contract.
    #[serde(rename = "companyName")]
    pub company_name: Option<String>,
    /// Contract Identifier of the given contract.
    pub conid: Option<i32>,
    /// Traded currency allowed for the given contract.
    pub currency: Option<String>,
    /// Exchange requesting data for.
    pub exchange: Option<String>,
    /// Primary listing exchange for the given contract.
    #[serde(rename = "listingExchange")]
    pub listing_exchange: Option<String>,
    /// Date of expiration for the given contract.
    #[serde(rename = "maturityDate")]
    pub maturity_date: Option<String>,
    #[serde(rename = "priceRendering")]
    pub price_rendering: Option<String>,
    /// Set the right for the given contract. * `C` - for Call options. * `P` - for Put options.
    pub right: Option<IndividualPositionPutOrCall>,
    /// Security type for the given contract.
    #[serde(rename = "secType")]
    pub sec_type: Option<String>,
    /// Returns the given strike value for the given contract.
    pub strike: Option<f64>,
    /// Ticker symbol for the given contract
    pub ticker: Option<String>,
    /// Series of all valid exchanges the contract can be traded on in a single comma-separated string.
    #[serde(rename = "validExchanges")]
    pub valid_exchanges: Option<String>,
}
pub type SecdefSearchResponse = Vec<SecdefSearchResponseSecdefSearchResponse>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SecdefSearchResponseSecdefSearchResponse {
    /// applicable for bonds
    pub bondid: Option<i32>,
    /// Company Name - Exchange
    #[serde(rename = "companyHeader")]
    pub company_header: Option<String>,
    /// Formal name of the company.
    #[serde(rename = "companyName")]
    pub company_name: Option<String>,
    /// Contract identifier for the unique contract.
    pub conid: Option<String>,
    /// Primary exchange of the contract
    pub description: Option<String>,
    /// Returns a string of dates, separated by semicolons.
    pub fop: Option<String>,
    pub issuers: Option<Vec<SecdefSearchResponseSecdefSearchResponseIssuer>>,
    /// Returns a string of dates, separated by semicolons.
    pub opt: Option<String>,
    /// Returns if the contract is available for trading.
    pub restricted: Option<bool>,
    pub sections: Option<Vec<SecdefSearchResponseSecdefSearchResponseSection>>,
    /// Underlying ticker symbol.
    pub symbol: Option<String>,
    /// Returns a string of dates, separated by semicolons.
    pub war: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SecdefSearchResponseSecdefSearchResponseIssuer {
    pub id: Option<String>,
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SecdefSearchResponseSecdefSearchResponseSection {
    /// semicolon separated list of exchanges
    pub exchange: Option<String>,
    /// semicolon separated list of months
    pub months: Option<String>,
    #[serde(rename = "secType")]
    pub sec_type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SetAccountResponse {
    /// Confirms the account switched to.
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
    /// Confirms that the account change was set
    pub set: Option<bool>,
}
/// Assign an account and the amount of cash to allocate into a model.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetAccountinvestmentInModelRequest {
    pub body: InvestDivestRequestBody,
}
impl SetAccountinvestmentInModelRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SetAccountinvestmentInModelResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<InvestDivest200Response>::json_with_diagnostics(
                    req,
                )
                .await?;
            return Ok(SetAccountinvestmentInModelResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetAccountinvestmentInModelResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetAccountinvestmentInModelResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetAccountinvestmentInModelResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetAccountinvestmentInModelResponse::Unknown);
    }
}
/// Response types for setAccountinvestmentInModel
#[derive(Debug, Clone)]
pub enum SetAccountinvestmentInModelResponse {
    ///200: Successfully submitted model investment.
    Ok(InvestDivest200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Switch the active account for how you request data. Only available for financial advisors and multi-account structures.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetActiveAccountRequest {
    pub body: AcctIdRequestBody,
}
impl SetActiveAccountRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SetActiveAccountResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SetAccountResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(SetActiveAccountResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetActiveAccountResponse::Unknown);
    }
}
/// Response types for setActiveAccount
#[derive(Debug, Clone)]
pub enum SetActiveAccountResponse {
    ///200: Validates the account swapped to.
    Ok(SetAccountResponse),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: Internal Server Error. Unable to process request if incoming values are not valid. For example accountId is not correct
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Set the preset behavior for new allocation groups for specific events.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetAllocationPresetRequest {
    pub body: Presets,
}
impl SetAllocationPresetRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SetAllocationPresetResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SuccessResponse2>::json_with_diagnostics(req)
                    .await?;
            return Ok(SetAllocationPresetResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetAllocationPresetResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetAllocationPresetResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetAllocationPresetResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetAllocationPresetResponse::Unknown);
    }
}
/// Response types for setAllocationPreset
#[derive(Debug, Clone)]
pub enum SetAllocationPresetResponse {
    ///200: Successfully retrieve preset details
    Ok(SuccessResponse2),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Set the active dynamic account.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetDynamicAccountRequest {
    #[validate(nested)]
    pub body: AcctIdRequestBody2,
}
impl SetDynamicAccountRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SetActiveAccountResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<SetAccountResponse>::json_with_diagnostics(req)
                    .await?;
            return Ok(SetActiveAccountResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetActiveAccountResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetActiveAccountResponse::Unknown);
    }
}
/// Set the preset behavior for models.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetModelPresetsRequest {
    pub body: ModelPresetsResponse,
}
impl SetModelPresetsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<SetModelPresetsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<Save200Response>::json_with_diagnostics(req)
                .await?;
            return Ok(SetModelPresetsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetModelPresetsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetModelPresetsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetModelPresetsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetModelPresetsResponse::Unknown);
    }
}
/// Response types for setModelPresets
#[derive(Debug, Clone)]
pub enum SetModelPresetsResponse {
    ///200: Successfully retrieve preset details
    Ok(Save200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Create or Modify a model's target positions.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SetModelTargetPositionsRequest {
    #[validate(nested)]
    pub body: SaveRequestBody,
}
impl SetModelTargetPositionsRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SetModelTargetPositionsResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Save200Response2>::json_with_diagnostics(req)
                    .await?;
            return Ok(SetModelTargetPositionsResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SetModelTargetPositionsResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SetModelTargetPositionsResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SetModelTargetPositionsResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SetModelTargetPositionsResponse::Unknown);
    }
}
/// Response types for setModelTargetPositions
#[derive(Debug, Clone)]
pub enum SetModelTargetPositionsResponse {
    ///200: Successfully saved a model
    Ok(Save200Response2),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Side of the order ticket.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, oas3_gen_support::Default)]
pub enum Side {
    #[serde(rename = "BUY")]
    #[default]
    Buy,
    #[serde(rename = "SELL")]
    Sell,
}
impl core::fmt::Display for Side {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Buy => write!(f, "BUY"),
            Self::Sell => write!(f, "SELL"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SignatureAndOwners {
    /// Account identifier
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    pub applicant: Option<SignatureAndOwnersApplicant>,
    pub users: Option<Vec<User>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SignatureAndOwnersApplicant {
    /// All names attached to the account
    pub signatures: Option<Vec<String>>,
}
/// Object containing Bid and Ask data for a single OHLC bar.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SingleHistoricalBarBidAsk {
    /// Closing value of the bar. Indicates the time average ask during the bar.
    pub c: Option<f64>,
    /// High value of the bar. Indicates the highest ask price during the bar.
    pub h: Option<f64>,
    /// Low value of the bar. Indicates the lowest bid price during the bar.
    pub l: Option<f64>,
    /// Opening value of the bar. Indicates the time average bid during the bar.
    pub o: Option<f64>,
    /// Unix timestamp of the start (chronologically earlier) of the bar.
    pub t: Option<i32>,
    /// Volume value of the bar. Always returns 0.
    pub v: Option<f64>,
}
/// Object containing Last or Trades data for a single OHLC bar.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SingleHistoricalBarLast {
    /// Closing value of the bar. Indicates the final traded price of the bar.
    pub c: Option<f64>,
    /// High value of the bar. Indicates the highest traded price of the bar.
    pub h: Option<f64>,
    /// Low value of the bar. Indicates the lowest traded price of the bar.
    pub l: Option<f64>,
    /// Opening value of the bar. Indicates first traded price of the bar.
    pub o: Option<f64>,
    /// Unix timestamp of the start (chronologically earlier) of the bar.
    pub t: Option<i32>,
    /// Volume value of the bar, returned only for "Last" barType.
    pub v: Option<f64>,
}
/// Object containing Midpoint data for a single OHLC bar.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SingleHistoricalBarMidpoint {
    /// Closing value of the bar. Indicates the last midpoint price traded price during the bar.
    pub c: Option<f64>,
    /// High value of the bar. Indicates the highest midpoint price traded price during the bar.
    pub h: Option<f64>,
    /// Low value of the bar. Indicates the lowest midpoint price traded price during the bar.
    pub l: Option<f64>,
    /// Opening value of the bar. Indicates the starting midpoint price traded price during the bar.
    pub o: Option<f64>,
    /// Unix timestamp of the start (chronologically earlier) of the bar.
    pub t: Option<i32>,
    /// Volume value of the bar. Always returns 0.
    pub v: Option<f64>,
}
/// A single order ticket.
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct SingleOrderSubmissionRequest {
    /// Receiving account of the order ticket.
    #[serde(rename = "acctId")]
    pub acct_id: Option<String>,
    /// Instructs IB to execute the order  entirely or not execute at all.
    #[serde(rename = "allOrNone")]
    pub all_or_none: Option<bool>,
    /// Additional price value used in certain order types, such as stop orders.
    #[serde(rename = "auxPrice")]
    pub aux_price: Option<f64>,
    /// Client-configurable order identifier.
    #[serde(rename = "cOID")]
    pub c_oid: Option<String>,
    /// Quantity of currency used with cash quantity orders.
    #[serde(rename = "cashQty")]
    pub cash_qty: Option<f64>,
    /// IB contract ID of the instrument.
    pub conid: i32,
    /// Contract ID and routing destination together in format 123456@EXCHANGE.
    pub conidex: Option<String>,
    /// ExtOperator is used to identify external operator
    #[serde(rename = "extOperator")]
    pub ext_operator: Option<String>,
    /// Indicates that a forex order is for currency conversion and should not entail a virtual forex position in the account, where applicable.
    #[serde(rename = "isCcyConv")]
    pub is_ccy_conv: Option<bool>,
    /// Indicates that all orders in the containing array are to be treated as an OCA group.
    #[serde(rename = "isSingleGroup")]
    pub is_single_group: Option<bool>,
    #[serde(rename = "jsonPayload")]
    pub json_payload: Option<SingleOrderSubmissionRequestJsonPayload>,
    /// The listing exchange of the instrument.
    #[serde(rename = "listingExchange")]
    pub listing_exchange: Option<String>,
    /// For all orders for US Futures products, clients must submit this flag to indicate whether the order was originated manually (by a natural person) or automatically (by an automated trading system transmitting orders without human intervention). Submit a True value to indicate a manually originated order, and submit a False value to indicate an automated order. Orders for USFUT products that do not include this field will be rejected.
    #[serde(rename = "manualIndicator")]
    pub manual_indicator: Option<bool>,
    /// IB order type identifier.
    #[serde(rename = "orderType")]
    #[validate(length(min = 1u64))]
    pub order_type: String,
    /// Instructs IB to permit the order to execute outside of regular trading hours.
    #[serde(rename = "outsideRTH")]
    pub outside_rth: Option<bool>,
    /// If the order ticket is a child order in a bracket, the parentId field must be set equal to the cOID provided for the parent order.
    #[serde(rename = "parentId")]
    pub parent_id: Option<String>,
    /// Price of the order ticket, where applicable.
    pub price: Option<f64>,
    /// Quantity of the order ticket in units of the instrument.
    pub quantity: f64,
    /// IB internal identifier for order entry UI element.
    pub referrer: Option<String>,
    /// IB asset class identifier.
    #[serde(rename = "secType")]
    pub sec_type: Option<String>,
    /// Side of the order ticket.
    pub side: Side,
    /// The name of an execution algorithm.
    pub strategy: Option<String>,
    /// Parameters governing the selected algorithm, if applicable.
    #[serde(rename = "strategyParameters")]
    pub strategy_parameters: Option<SingleOrderSubmissionRequestStrategyParameters>,
    /// Identifies set of tax lots selected, for gains and losses management.
    #[serde(rename = "taxOptimizerId")]
    pub tax_optimizer_id: Option<String>,
    /// Ticker symbol of the instrument.
    pub ticker: Option<String>,
    /// Time in force of the order ticket.
    pub tif: OrderStatusTif,
    /// Offset used with Trailing orders.
    #[serde(rename = "trailingAmt")]
    pub trailing_amt: Option<f64>,
    /// Specifies the type of trailing used with a Trailing order.
    #[serde(rename = "trailingType")]
    pub trailing_type: Option<SingleOrderSubmissionRequestTrailingType>,
    /// Instructs IB to apply the Price Management Algo.
    #[serde(rename = "useAdaptive")]
    pub use_adaptive: Option<bool>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SingleOrderSubmissionRequestJsonPayload {
    /// The assigned contents for how the order should be allocated amongst subaccount(s).
    pub allocation_profile: Option<SingleOrderSubmissionRequestJsonPayloadAllocationProfile>,
}
/// The assigned contents for how the order should be allocated amongst subaccount(s).
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SingleOrderSubmissionRequestJsonPayloadAllocationProfile {
    /// The allocation type to define how shares should be distributed.  A warning message to be pre-approved.
    ///    * `SHARE` - Designate the allocation amounts as a quantity of shares.
    ///    * `CASH` - Designate the allocation amounts as a quantity of a cash quantity to allocate.
    pub alloc_type: Option<SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType>,
    /// List of accounts to allocate a trade and the affiliated quantity.
    pub allocations:
        Option<Vec<SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocation>>,
}
/// The allocation type to define how shares should be distributed.  A warning message to be pre-approved.
///    * `SHARE` - Designate the allocation amounts as a quantity of shares.
///    * `CASH` - Designate the allocation amounts as a quantity of a cash quantity to allocate.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType {
    #[serde(rename = "SHARE")]
    #[default]
    Share,
    #[serde(rename = "CASH")]
    Cash,
}
impl core::fmt::Display for SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Share => write!(f, "SHARE"),
            Self::Cash => write!(f, "CASH"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SingleOrderSubmissionRequestJsonPayloadAllocationProfileAllocation {
    /// Account to allocate trades to.
    pub account: Option<String>,
    /// Allocation to the given account based on the alloc_type.
    pub amount: Option<f64>,
}
/// Parameters governing the selected algorithm, if applicable.
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SingleOrderSubmissionRequestStrategyParameters {
    /// Placeholder -- these vary by algo (and not always type string, sometimes bool)
    #[serde(rename = "PLACEHOLDER")]
    pub placeholder: Option<String>,
}
/// Specifies the type of trailing used with a Trailing order.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum SingleOrderSubmissionRequestTrailingType {
    #[serde(rename = "amt")]
    #[default]
    Amt,
    #[serde(rename = "%")]
    Unnamed,
}
impl core::fmt::Display for SingleOrderSubmissionRequestTrailingType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Amt => write!(f, "amt"),
            Self::Unnamed => write!(f, "%"),
        }
    }
}
/// Object detailing a single watchlist.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SingleWatchlist {
    /// Internal use. Unique hash of the watchlist.
    pub hash: Option<String>,
    /// Identifier of the watchlist.
    pub id: Option<String>,
    /// Array of instruments contained in the watchlist.
    pub instruments: Option<Vec<SingleWatchlistEntry>>,
    /// Human-readable display name of the watchlist.
    pub name: Option<String>,
    /// Indicates whether the watchlist can be edited.
    #[serde(rename = "readOnly")]
    pub read_only: Option<bool>,
}
/// Object containing watchlist entry for a single instrument.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SingleWatchlistEntry {
    /// Instrument conid as a string.
    #[serde(rename = "C")]
    pub c: Option<String>,
    /// All-capital, shorthand security type identifier of the instrument.
    #[serde(rename = "ST")]
    pub st: Option<SingleWatchlistEntryAssetClass>,
    /// All-capital, shorthand security type identifier of the instrument.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<SingleWatchlistEntryAssetClass>,
    /// Rendering of the instrument name in Chinese.
    #[serde(rename = "chineseName")]
    pub chinese_name: Option<String>,
    /// IB contract ID of the instrument.
    pub conid: Option<i32>,
    /// Full display presentation of the instrument symbol.
    #[serde(rename = "fullName")]
    pub full_name: Option<String>,
    /// Complete display name of the instrument.
    pub name: Option<String>,
    /// Symbol of the instrument.
    pub ticker: Option<String>,
}
/// All-capital, shorthand security type identifier of the instrument.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum SingleWatchlistEntryAssetClass {
    #[serde(rename = "STK")]
    #[default]
    Stk,
    #[serde(rename = "OPT")]
    Opt,
    #[serde(rename = "FUT")]
    Fut,
    #[serde(rename = "BOND")]
    Bond,
    #[serde(rename = "FUND")]
    Fund,
    #[serde(rename = "WAR")]
    War,
    #[serde(rename = "CASH")]
    Cash,
    #[serde(rename = "CRYPTO")]
    Crypto,
}
impl core::fmt::Display for SingleWatchlistEntryAssetClass {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Stk => write!(f, "STK"),
            Self::Opt => write!(f, "OPT"),
            Self::Fut => write!(f, "FUT"),
            Self::Bond => write!(f, "BOND"),
            Self::Fund => write!(f, "FUND"),
            Self::War => write!(f, "WAR"),
            Self::Cash => write!(f, "CASH"),
            Self::Crypto => write!(f, "CRYPTO"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SsoValidateResponse {
    /// Returns the time of authentication in epoch time.
    #[serde(rename = "AUTH_TIME")]
    pub auth_time: Option<i32>,
    /// Returns the underlying username of the account.
    #[serde(rename = "CREDENTIAL")]
    pub credential: Option<String>,
    /// Returns the time until SSO session expiration in milliseconds.
    #[serde(rename = "EXPIRES")]
    pub expires: Option<i32>,
    /// Internal use only. Does not reflect the IP address of the user.
    #[serde(rename = "IP")]
    pub ip: Option<String>,
    /// Returns if the account is a trial account or a funded account.
    #[serde(rename = "IS_FREE_TRIAL")]
    pub is_free_trial: Option<bool>,
    /// Returns whether the account is a master account (true) or subaccount (false).
    #[serde(rename = "IS_MASTER")]
    pub is_master: Option<bool>,
    /// Used for Client Portal (Internal use only)
    #[serde(rename = "LANDING_APP")]
    pub landing_app: Option<String>,
    /// Returns the paper username for the account.
    #[serde(rename = "PAPER_USER_NAME")]
    pub paper_user_name: Option<String>,
    /// Returns if the customer requires two factor authentication.
    #[serde(rename = "QUALIFIED_FOR_MOBILE_AUTH")]
    pub qualified_for_mobile_auth: Option<bool>,
    /// Confirms if validation was successful. True if session was validated; false if not.
    #[serde(rename = "RESULT")]
    pub result: Option<bool>,
    /// (Internal use only)
    #[serde(rename = "SF_ENABLED")]
    pub sf_enabled: Option<bool>,
    /// Internal user identifier.
    #[serde(rename = "USER_ID")]
    pub user_id: Option<i32>,
    /// current username logged in for the session.
    #[serde(rename = "USER_NAME")]
    pub user_name: Option<String>,
    /// Returns supported features such as bonds and option trading.
    pub features: Option<SsoValidateResponseFeatures>,
    /// Returns the last time the user was accessed in epoch time.
    #[serde(rename = "lastAccessed")]
    pub last_accessed: Option<i32>,
    /// Returns the login type. 1 for Live, 2 for Paper
    #[serde(rename = "loginType")]
    pub login_type: Option<i32>,
    /// Returns the region connected to internally.
    pub region: Option<String>,
}
/// Returns supported features such as bonds and option trading.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SsoValidateResponseFeatures {
    /// Returns if bonds can be traded.
    pub bond: Option<bool>,
    /// Returns if trading calendars are enabled
    pub calendar: Option<bool>,
    /// Returns the connecting environment to distinguish production or paper.
    pub envs: Option<String>,
    /// Internal Use Only
    #[serde(rename = "newMf")]
    pub new_mf: Option<bool>,
    /// Returns if option chains can be retrieved in the account.
    #[serde(rename = "optionChains")]
    pub option_chains: Option<bool>,
    /// Returns if realtime market data is available
    pub realtime: Option<bool>,
    /// Internal Use Only
    pub wlms: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct StatusResponse {
    #[serde(rename = "dateSubmitted")]
    pub date_submitted: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "fileData")]
    pub file_data: Option<FileData>,
    #[serde(rename = "requestId")]
    pub request_id: Option<i64>,
}
/// Confirms successful reply to the server prompt.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct StatusResponse2 {
    /// Confirms the successful suppression of specified messageIds. Always returns "Submitted".
    pub status: Option<String>,
}
/// Confirms successful removal of suppression.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct StatusResponse3 {
    /// Confirms the successful removal of suppression. Always returns "Submitted".
    pub status: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct StatusResponse4 {
    /// Confirms that the logout action was performed successfully.
    pub status: Option<bool>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct StmtRequest {
    /// account id
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// array of account id's
    /// - Example: `Some(vec!["U123", "U456"].to_string())`
    #[serde(rename = "accountIds")]
    pub account_ids: Option<Vec<String>>,
    /// crypto consolidate flag, If request contains any accounts with crypto segment, will turn request into Crypto Consolidated
    #[serde(rename = "cryptoConsolIfAvailable")]
    #[default(Some(false))]
    pub crypto_consol_if_available: Option<bool>,
    /// to date
    #[serde(rename = "endDate")]
    #[validate(length(min = 1u64))]
    pub end_date: String,
    /// to gzip the whole response pass true
    #[default(Some(false))]
    pub gzip: Option<bool>,
    /// two character ISO language code
    /// - Example: `Some("en, fr defaults to en (english)".to_string())`
    #[default(Some("en".to_string()))]
    pub language: Option<String>,
    /// output format
    /// - Example: `Some("application/pdf, text/html, or text/csv".to_string())`
    #[serde(rename = "mimeType")]
    pub mime_type: Option<String>,
    /// possible values are consolidate, concatenate, or customConsolidate
    #[serde(rename = "multiAccountFormat")]
    pub multi_account_format: Option<String>,
    /// from date
    #[serde(rename = "startDate")]
    #[validate(length(min = 1u64))]
    pub start_date: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Stocks {
    /// Additional properties not defined in the schema.
    #[serde(flatten)]
    pub additional_properties: std::collections::HashMap<String, Vec<serde_json::Value>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Strike200Response {
    /// Array containing a series of comma separated values representing potential call strikes for the instrument.
    pub call: Option<Vec<f64>>,
    /// Array containing a series of comma separated values representing potential put strikes for the instrument.
    pub put: Option<Vec<f64>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SubAccounts {
    /// An array containing all sub-accounts held by the advisor.
    pub accounts: Option<Vec<SubAccountsAccount>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SubAccountsAccount {
    /// Contains Net liquidation and available equity of the given account Id.
    pub data: Option<Vec<SubAccountsAccountDatum>>,
    /// Returns the account ID affiliated with the balance data.
    pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SubAccountsAccountDatum {
    /// Defines the value of the object
    ///  * `AvailableEquity` - Indicates the value relates to the Available Equity held within the account
    ///  * `NetLiquidation` - Indicates the value relates to the Net Liquidation held within the account
    pub key: Option<SubAccountsAccountDatumKey>,
    /// Contains the price value affiliated with the key.
    pub value: Option<String>,
}
/// Defines the value of the object
///  * `AvailableEquity` - Indicates the value relates to the Available Equity held within the account
///  * `NetLiquidation` - Indicates the value relates to the Net Liquidation held within the account
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum SubAccountsAccountDatumKey {
    #[default]
    AvailableEquity,
    NetLiquidation,
}
impl core::fmt::Display for SubAccountsAccountDatumKey {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::AvailableEquity => write!(f, "AvailableEquity"),
            Self::NetLiquidation => write!(f, "NetLiquidation"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum SubType {
    #[serde(rename = "ACATS")]
    #[default]
    Acats,
    #[serde(rename = "ATON")]
    Aton,
}
impl core::fmt::Display for SubType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Acats => write!(f, "ACATS"),
            Self::Aton => write!(f, "ATON"),
        }
    }
}
pub type Subaccount200Response = Vec<AccountAttributes>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Subaccounts2Response {
    /// Metadata container describing the subaccounts.
    pub metadata: Option<Subaccounts2ResponseMetadata>,
    /// List containing all subaccounts of the account structure.
    pub subaccounts: Option<Vec<AccountAttributes>>,
}
/// Metadata container describing the subaccounts.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Subaccounts2ResponseMetadata {
    /// The active page number.
    #[serde(rename = "pageNum")]
    pub page_num: Option<i32>,
    /// Items contained in the returning page.
    #[serde(rename = "pageSize")]
    pub page_size: Option<i32>,
    /// The total number of accounts returned for the page.
    pub total: Option<i32>,
}
/// Submit all pending orders to the models. This is similar to the Model page's Submit All Orders selection.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SubmitModelOrdersRequest {
    pub body: TransferRequestBody,
}
impl SubmitModelOrdersRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SubmitModelOrdersResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Transfer200Response>::json_with_diagnostics(req)
                    .await?;
            return Ok(SubmitModelOrdersResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SubmitModelOrdersResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SubmitModelOrdersResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SubmitModelOrdersResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SubmitModelOrdersResponse::Unknown);
    }
}
/// Response types for submitModelOrders
#[derive(Debug, Clone)]
pub enum SubmitModelOrdersResponse {
    ///200: Successfully transmit all orders.
    Ok(Transfer200Response),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
/// Submit a new order(s) ticket, bracket, or OCA group.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SubmitNewOrderRequest {
    #[validate(nested)]
    pub path: SubmitNewOrderRequestPath,
    #[validate(nested)]
    pub body: OrdersSubmissionRequest,
}
impl SubmitNewOrderRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<SubmitNewOrderResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<Order200Response3>::json_with_diagnostics(req)
                    .await?;
            return Ok(SubmitNewOrderResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SubmitNewOrderResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SubmitNewOrderResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SubmitNewOrderResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SubmitNewOrderResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct SubmitNewOrderRequestPath {
    /// The account to which the order will clear.
    /// - Example: `"DU123456".to_string()`
    #[validate(length(min = 1u64))]
    pub account_id: String,
}
/// Response types for submitNewOrder
#[derive(Debug, Clone)]
pub enum SubmitNewOrderResponse {
    ///200: Order submission response (success, error, reply is required or order reject)
    Ok(Order200Response3),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessResponse {
    pub success: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessResponse2 {
    /// Signifies that the request was successfully submitted.
    pub success: Option<bool>,
}
/// Acknowledges a successful request.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessResponse3 {
    /// The sole key 'success' will have boolean value true.
    pub success: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessfulTickleResponse {
    /// (Internal Use Only)
    pub collission: Option<bool>,
    /// Returns connection details for the historical market data server.
    pub hmds: Option<SuccessfulTickleResponseHmds>,
    pub iserver: Option<SuccessfulTickleResponseIserver>,
    /// Returns the session token of the contract.
    pub session: Option<String>,
    /// Returns the number of milliseconds until the current sso session expires.
    #[serde(rename = "ssoExpires")]
    pub sso_expires: Option<i32>,
    /// (Internal Use Only)
    #[serde(rename = "userId")]
    pub user_id: Option<i32>,
}
/// Returns connection details for the historical market data server.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessfulTickleResponseHmds {
    /// Returns authentication details.
    #[serde(rename = "authStatus")]
    pub auth_status: Option<Vec<serde_json::Value>>,
    /// Relays any internal connection errors.
    pub error: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SuccessfulTickleResponseIserver {
    #[serde(rename = "authStatus")]
    pub auth_status: Option<BrokerageSessionStatus>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryMarketValueResponse {
    /// Returns an object containing market value details of the currency and positions held using that currency.
    pub currency: Option<SummaryMarketValueResponseCurrency>,
}
/// Returns an object containing market value details of the currency and positions held using that currency.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryMarketValueResponseCurrency {
    /// Total cash value of Cryptocurrencies held.
    #[serde(rename = "Cryptocurrency")]
    pub cryptocurrency: Option<String>,
    /// Exchange rate of the labeled currency to the base currency.
    #[serde(rename = "Exchange Rate")]
    pub exchange_rate: Option<String>,
    /// Total cash value of goverment bonds held.
    #[serde(rename = "Govt Bonds")]
    pub govt_bonds: Option<String>,
    /// Total Month-to-date interest.
    #[serde(rename = "MTD Interest")]
    pub mtd_interest: Option<String>,
    /// Total cash value of notional CFDs held.
    #[serde(rename = "Notional CFD")]
    pub notional_cfd: Option<String>,
    /// Total cash value of bonds held.
    pub bonds: Option<String>,
    /// Total cash value of CFDs held.
    pub cfd: Option<String>,
    /// Total cash value of commodities held.
    pub commodity: Option<String>,
    /// Total cash value of receivable dividends.
    pub dividends_receivable: Option<String>,
    /// Total cash value of funds held.
    pub funds: Option<String>,
    /// Total cash value of future options held.
    pub future_options: Option<String>,
    /// Total cash value of futures held.
    pub futures: Option<String>,
    /// Total cash value of issuer options held.
    pub issuer_option: Option<String>,
    /// Total cash value of money market securities held.
    pub money_market: Option<String>,
    /// Total cash value of mutual funds held.
    pub mutual_funds: Option<String>,
    /// Total cash value of your net liquidty.
    pub net_liquidation: Option<String>,
    /// Total cash value of options held.
    pub options: Option<String>,
    /// Total daily realized profit and loss.
    pub realized_pnl: Option<String>,
    /// Cash recognized at the time of settlement minus the purchases at time of trade, commissions, taxes, and fees.
    pub settled_cash: Option<String>,
    /// Total cash value of stocks held.
    pub stock: Option<String>,
    /// Total cash value of t-bill bonds held.
    pub t_bills: Option<String>,
    /// Lists the total cash held for the given currency.
    pub total_cash: Option<String>,
    /// Total daily unrealized profit and loss.
    pub unrealized_pnl: Option<String>,
    /// Total cash value of warrants held.
    pub warrants: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountBalancesResponse {
    /// Contains Commodity-specific balance details.
    pub commodities: Option<SummaryOfAccountBalancesResponseCommodities>,
    /// Contains Security-specific balance details.
    pub securities: Option<SummaryOfAccountBalancesResponseSecurities>,
    /// Contains total balance details for the account.
    pub total: Option<SummaryOfAccountBalancesResponseTotal>,
}
/// Contains Commodity-specific balance details.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountBalancesResponseCommodities {
    /// Total Month-to-date interest.
    #[serde(rename = "MTD Interest")]
    pub mtd_interest: Option<String>,
    /// Any pending charges for the IBKR debit account.
    #[serde(rename = "Pndng Dbt Crd Chrgs")]
    pub pndng_dbt_crd_chrgs: Option<String>,
    /// Total cash balance in the account
    pub cash: Option<String>,
    /// * `Cash Accounts` Settled cash
    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
    pub equity_with_loan: Option<String>,
    /// The basis for determining the price of the assets in your account.
    pub net_liquidation: Option<String>,
}
/// Contains Security-specific balance details.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountBalancesResponseSecurities {
    /// Total Month-to-date interest.
    #[serde(rename = "MTD Interest")]
    pub mtd_interest: Option<String>,
    /// Any pending charges for the IBKR debit account.
    #[serde(rename = "Pndng Dbt Crd Chrgs")]
    pub pndng_dbt_crd_chrgs: Option<String>,
    /// The accounts equity balance including loan value.
    #[serde(rename = "Prvs Dy Eqty Wth Ln Vl")]
    pub prvs_dy_eqty_wth_ln_vl: Option<String>,
    /// Total cash balance in the account
    pub cash: Option<String>,
    /// * `Cash Accounts` Settled cash
    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
    pub equity_with_loan: Option<String>,
    /// The basis for determining the price of the assets in your account.
    pub net_liquidation: Option<String>,
    /// Equals the sum of the absolute value of all positions except cash, index futures and US treasuries.
    pub sec_gross_pos_val: Option<String>,
}
/// Contains total balance details for the account.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountBalancesResponseTotal {
    /// Total Month-to-date interest.
    #[serde(rename = "MTD Interest")]
    pub mtd_interest: Option<String>,
    /// Displays the uncertainty of the Net Liquidating Value associated with after-hours price changes.
    #[serde(rename = "Nt Lqdtn Uncrtnty")]
    pub nt_lqdtn_uncrtnty: Option<String>,
    /// Any pending charges for the IBKR debit account.
    #[serde(rename = "Pndng Dbt Crd Chrgs")]
    pub pndng_dbt_crd_chrgs: Option<String>,
    /// The accounts equity balance including loan value.
    #[serde(rename = "Prvs Dy Eqty Wth Ln Vl")]
    pub prvs_dy_eqty_wth_ln_vl: Option<String>,
    /// Total cash balance in the account
    pub cash: Option<String>,
    /// * `Cash Accounts` Settled cash
    ///  * `Margin Accounts` Total cash value + stock value + bond value + fund value + European & Asian options value.
    pub equity_with_loan: Option<String>,
    /// The basis for determining the price of the assets in your account.
    pub net_liquidation: Option<String>,
    /// Equals the sum of the absolute value of all positions except cash, index futures and US treasuries.
    pub sec_gross_pos_val: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountMarginResponse {
    #[serde(rename = "Crypto at Paxos")]
    pub crypto_at_paxos: Option<SummaryOfAccountMarginResponseCryptoAtPaxos>,
    pub commodities: Option<SummaryOfAccountMarginResponseCommodities>,
    pub securities: Option<SummaryOfAccountMarginResponseSecurities>,
    pub total: Option<SummaryOfAccountMarginResponseCryptoAtPaxos>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountMarginResponseCommodities {
    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
    /// The current RegT margin in use.
    #[serde(rename = "RegT Margin")]
    pub reg_t_margin: Option<String>,
    /// The minimum amount required to open a new position.
    pub current_initial: Option<String>,
    /// The amount of equity required to maintain your positions.
    pub current_maint: Option<String>,
    /// Provides a projected "liquid" initial margin value based on account liquidation value.
    pub projected_liquidity_inital_margin: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    pub projected_overnight_initial_margin: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountMarginResponseCryptoAtPaxos {
    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
    /// The minimum amount required to open a new position.
    pub current_initial: Option<String>,
    /// The amount of equity required to maintain your positions.
    pub current_maint: Option<String>,
    /// Provides a projected "liquid" initial margin value based on account liquidation value.
    pub projected_liquidity_inital_margin: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    pub projected_overnight_initial_margin: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SummaryOfAccountMarginResponseSecurities {
    /// Provides a projected "at expiration" margin value based on the soon-to-expire contracts in your portfolio.
    #[serde(rename = "Prdctd Pst-xpry Mrgn @ Opn")]
    pub prdctd_pst_xpry_mrgn_opn: Option<String>,
    /// If it is 3:00 pm ET, the next calculation you're looking ahead to is after the close, or the Overnight Initial Margin. If it's 3:00 am ET, the next calculation will be at the market's open.
    ///  * `Securities` – Projected maintenance margin requirement as of next period's margin change, in the base currency of the account.
    ///  * `Commodities` – Maintenance margin requirement as of next period's margin change in the base currency of the account based on current margin requirements, which are subject to change. This value depends on when you are viewing your margin requirements.
    #[serde(rename = "Prjctd Lk Ahd Mntnnc Mrgn")]
    pub prjctd_lk_ahd_mntnnc_mrgn: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * `Securities` – Projected overnight maintenance margin requirement in the base currency of the account.
    ///   * `Commodities` – Overnight maintenance margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    #[serde(rename = "Prjctd Ovrnght Mntnnc Mrgn")]
    pub prjctd_ovrnght_mntnnc_mrgn: Option<String>,
    /// The minimum amount required to open a new position.
    pub current_initial: Option<String>,
    /// The amount of equity required to maintain your positions.
    pub current_maint: Option<String>,
    /// Provides a projected "liquid" initial margin value based on account liquidation value.
    pub projected_liquidity_inital_margin: Option<String>,
    /// Overnight refers to the window of time after the local market trading day is closed.
    ///   * Securities – Projected overnight initial margin requirement in the base currency of the account.
    ///   * Commodities – Overnight initial margin requirement in the base currency of the account based on current margin requirements, which are subject to change.
    pub projected_overnight_initial_margin: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct SummaryRequestBody {
    /// Name of your model.
    /// - Example: `Some("Sample-Model".to_string())`
    pub model: Option<String>,
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_609i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
}
/// Suppress the specified order reply messages for the duration of the brokerage session.
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct SuppressOrderRepliesRequest {
    pub body: MessageIdRequestBody,
}
impl SuppressOrderRepliesRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(
        req: reqwest::Response,
    ) -> anyhow::Result<SuppressOrderRepliesResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data = oas3_gen_support::Diagnostics::<StatusResponse2>::json_with_diagnostics(req)
                .await?;
            return Ok(SuppressOrderRepliesResponse::Ok(data));
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(SuppressOrderRepliesResponse::Unauthorized);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(SuppressOrderRepliesResponse::InternalServerError);
        }
        if status == http::StatusCode::SERVICE_UNAVAILABLE {
            let _ = req.bytes().await?;
            return Ok(SuppressOrderRepliesResponse::ServiceUnavailable);
        }
        let _ = req.bytes().await?;
        return Ok(SuppressOrderRepliesResponse::Unknown);
    }
}
/// Response types for suppressOrderReplies
#[derive(Debug, Clone)]
pub enum SuppressOrderRepliesResponse {
    ///200: Request's status
    Ok(StatusResponse2),
    ///401: Invalid or expired access token
    Unauthorized,
    /**500: internal server error, returned when incoming request cannot be processed. It can sometimes include subset of bad requests.  For example, wrong accountId passed and it can only be detected later in handling request. Error contains reason of the problem.
     */
    InternalServerError,
    /**503: service is unavailable. For example if request takes more than 10s due to some internal service unavailability,  request aborted and this status returned
     */
    ServiceUnavailable,
    ///default: Unknown response
    Unknown,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct SynchronousInstructionResponse {
    #[serde(rename = "instructionResult")]
    pub instruction_result: Option<InstructionResult>,
    /// - Example: `-1988905739.0`
    #[serde(rename = "instructionSetId")]
    pub instruction_set_id: f64,
    /// - Example: `202.0`
    pub status: f64,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum Task200Response {
    #[default]
    Registration(RegistrationTasksResponse),
    Pending(PendingTasksResponse),
}
impl Task200Response {
    pub fn registration() -> Self {
        Self::Registration(RegistrationTasksResponse::default())
    }
    pub fn pending() -> Self {
        Self::Pending(PendingTasksResponse::default())
    }
}
pub type Task200Response2 = Vec<TaskActionResponse>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TaskActionResponse {
    #[serde(rename = "accountId")]
    pub account_id: Option<String>,
    #[serde(rename = "formNumber")]
    pub form_number: Option<i32>,
    pub message: Option<String>,
    pub status: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct TaxFormRequest {
    /// Account id
    /// - Example: `"UXXXX".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// format
    /// - Example: `"HTML,CSV,PDF".to_string()`
    #[validate(length(min = 1u64))]
    pub format: String,
    /// to gzip the whole response pass true
    #[default(Some(false))]
    pub gzip: Option<bool>,
    /// Tax Form Type (can retrieve available tax documents via /api/v1/tax-documents/available)
    /// - Example: `"ALL,1099,1099R,1042S,8949".to_string()`
    #[serde(rename = "type")]
    #[validate(length(min = 1u64))]
    pub r#type: String,
    /// Tax Year
    /// - Example: `2_023i32`
    pub year: i32,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TaxFormResponse {
    pub data: Option<ResponseData>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TaxFormType {
    /// available tax form formats
    pub formats: Option<Vec<String>>,
    #[serde(rename = "isForm")]
    pub is_form: Option<bool>,
    /// - Example: `Some("1099".to_string())`
    #[serde(rename = "taxFormName")]
    pub tax_form_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum TickleResponse {
    #[default]
    Successful(SuccessfulTickleResponse),
    Failed(FailedTickleResponse),
}
impl TickleResponse {
    pub fn successful() -> Self {
        Self::Successful(SuccessfulTickleResponse::default())
    }
    pub fn failed(error: Option<String>) -> Self {
        Self::Failed(FailedTickleResponse {
            error,
            ..Default::default()
        })
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct TokenRequest {
    #[serde(rename = "clientAssertion")]
    pub client_assertion: Option<String>,
    #[serde(rename = "clientAssertionType")]
    pub client_assertion_type: Option<String>,
    #[serde(rename = "clientAuthenticationMethod")]
    pub client_authentication_method: Option<TokenRequestClientAuthenticationMethod>,
    #[serde(rename = "clientId")]
    pub client_id: Option<String>,
    #[serde(rename = "clientSecret")]
    pub client_secret: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TokenRequestClientAuthenticationMethod {
    #[serde(rename = "private_key_jwt")]
    #[default]
    PrivateKeyJwt,
    #[serde(rename = "client_secret_basic")]
    ClientSecretBasic,
    #[serde(rename = "client_secret_post")]
    ClientSecretPost,
}
impl core::fmt::Display for TokenRequestClientAuthenticationMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::PrivateKeyJwt => write!(f, "private_key_jwt"),
            Self::ClientSecretBasic => write!(f, "client_secret_basic"),
            Self::ClientSecretPost => write!(f, "client_secret_post"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TokenResponse {
    /// The serialized access token
    pub access_token: Option<String>,
    /// The number of seconds from now until the access token expires
    pub expires_in: Option<i64>,
    /// The serialized ID token if applicable
    pub id_token: Option<String>,
    /// The serialized refresh token if applicable
    pub refresh_token: Option<String>,
    /// The space-delimited list of granted scopes
    pub scope: Option<String>,
    /// The token type (e.g., Bearer)
    pub token_type: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct TradeConfirmationRequest {
    /// accound id
    /// - Example: `"UXXXX".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64))]
    pub account_id: String,
    /// to date
    /// - Example: `"20230115".to_string()`
    #[serde(rename = "endDate")]
    #[validate(length(min = 1u64))]
    pub end_date: String,
    /// output format
    /// - Example: `Some("application/pdf".to_string())`
    #[serde(rename = "mimeType")]
    pub mime_type: Option<String>,
    /// from date
    /// - Example: `"20230102".to_string()`
    #[serde(rename = "startDate")]
    #[validate(length(min = 1u64))]
    pub start_date: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradeConfirmationResponse {
    pub data: Option<ResponseData>,
}
/// Array of objects representing executions.
pub type TradesResponse = Vec<TradesResponseTradesResponse>;
/// Object containing details of a single execution.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradesResponseTradesResponse {
    /// The IB account ID of the account that received the execution.
    pub account: Option<String>,
    /// The IB account ID of the account that received the execution.
    #[serde(rename = "accountCode")]
    pub account_code: Option<String>,
    /// The IB account ID of the account that received the execution.
    pub account_allocation_name: Option<String>,
    /// Identifier of the firm clearing the trade. Value is "IB" if account is cleared by Interactive Brokers.
    pub clearing_id: Option<String>,
    /// Name of the firm clearing the trade. Value is "IB" if account is cleared by Interactive Brokers.
    pub clearing_name: Option<String>,
    /// Commissions incurred by the execution. May also include
    pub commission: Option<String>,
    /// Name of business associated with instrument, or otherwise description of instrument.
    pub company_name: Option<String>,
    /// Contract ID of the order's instrument.
    pub conid: Option<String>,
    /// Contract ID and routing destination in format 123456@EXCHANGE.
    #[serde(rename = "conidEx")]
    pub conid_ex: Option<String>,
    /// Human-readable description of the order's instrument.
    pub contract_description_1: Option<String>,
    /// The exchange or other venue on which the execution occurred.
    pub exchange: Option<String>,
    /// IB-assigned execution identifier.
    pub execution_id: Option<String>,
    /// Indicates whether the order ticket is an Event Trading order.
    pub is_event_trading: Option<AlertActivationRequestAlertActive>,
    /// Indicates whether the trade is the result of a liquidiation by IB.
    pub liquidation_trade: Option<AlertActivationRequestAlertActive>,
    /// The primary exchange on which the instrument is listed.
    pub listing_exchange: Option<String>,
    /// net_amount
    pub net_amount: Option<f64>,
    /// Human-readable description of the outcome of the execution.
    pub order_description: Option<String>,
    /// Order ID
    pub order_id: Option<f64>,
    /// The client-provided customer order identifier. Specified via cOID during order submission in the Web API.
    pub order_ref: Option<String>,
    /// The price at which the execution occurred.
    pub price: Option<String>,
    /// IB asset class identifier.
    pub sec_type: Option<OrderStatusSecType>,
    /// Side of the execution.
    pub side: Option<TradesResponseTradesResponseSide>,
    /// The size of the execution in units of the instrument.
    pub size: Option<f64>,
    /// The IB username that originated the order ticket against which the execution occurred.
    pub submitter: Option<String>,
    /// Indicates whether the order is supported by IB's Tax Optimization tool.
    pub supports_tax_opt: Option<AlertActivationRequestAlertActive>,
    /// Symbol of the instrument involved in the execution.
    pub symbol: Option<String>,
    /// UTC date and time of the execution in format YYYYMMDD-hh:mm:ss.
    pub trade_time: Option<String>,
    /// Unix timestamp of the execution time in milliseconds.
    pub trade_time_r: Option<i64>,
}
/// Side of the execution.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum TradesResponseTradesResponseSide {
    #[default]
    B,
    S,
}
impl core::fmt::Display for TradesResponseTradesResponseSide {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::B => write!(f, "B"),
            Self::S => write!(f, "S"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum TradingInstrument {
    #[default]
    Variant0(TradingInstrumentVariant0),
    TradingInstrumentDescription(TradingInstrumentTradingInstrumentDescription),
}
impl TradingInstrument {
    pub fn variant0(conid: f64) -> Self {
        Self::Variant0(TradingInstrumentVariant0 {
            conid,
            ..Default::default()
        })
    }
    pub fn description(
        trading_instrument_description: TradingInstrumentTradingInstrumentDescriptionDescription,
    ) -> Self {
        Self::TradingInstrumentDescription(TradingInstrumentTradingInstrumentDescription {
            trading_instrument_description,
            ..Default::default()
        })
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct TradingInstrumentTradingInstrumentDescription {
    #[serde(rename = "tradingInstrumentDescription")]
    #[validate(nested)]
    pub trading_instrument_description: TradingInstrumentTradingInstrumentDescriptionDescription,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct TradingInstrumentTradingInstrumentDescriptionDescription {
    /// - Example: `"STK"`
    #[serde(rename = "assetType")]
    pub asset_type: TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType,
    /// - Example: `"459200101".to_string()`
    #[serde(rename = "securityId")]
    #[validate(length(min = 1u64))]
    pub security_id: String,
    /// - Example: `"ISIN"`
    #[serde(rename = "securityIdType")]
    pub security_id_type: TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType {
    #[serde(rename = "STK")]
    #[default]
    Stk,
    #[serde(rename = "CASH")]
    Cash,
    #[serde(rename = "UNKNOWN")]
    Unknown,
    #[serde(rename = "BILL")]
    Bill,
    #[serde(rename = "BOND")]
    Bond,
    #[serde(rename = "FUND")]
    Fund,
    #[serde(rename = "OPT")]
    Opt,
    #[serde(rename = "WAR")]
    War,
}
impl core::fmt::Display for TradingInstrumentTradingInstrumentDescriptionDescriptionAssetType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Stk => write!(f, "STK"),
            Self::Cash => write!(f, "CASH"),
            Self::Unknown => write!(f, "UNKNOWN"),
            Self::Bill => write!(f, "BILL"),
            Self::Bond => write!(f, "BOND"),
            Self::Fund => write!(f, "FUND"),
            Self::Opt => write!(f, "OPT"),
            Self::War => write!(f, "WAR"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType {
    #[serde(rename = "CUSIP")]
    #[default]
    Cusip,
    #[serde(rename = "ISIN")]
    Isin,
    #[serde(rename = "CASH")]
    Cash,
}
impl core::fmt::Display for TradingInstrumentTradingInstrumentDescriptionDescriptionSecurityIdType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Cusip => write!(f, "CUSIP"),
            Self::Isin => write!(f, "ISIN"),
            Self::Cash => write!(f, "CASH"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct TradingInstrumentVariant0 {
    /// - Example: `459200101.0`
    pub conid: f64,
}
/// trading's schedules
pub type TradingSchedule = Vec<TradingScheduleTradingSchedule>;
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradingScheduleTradingSchedule {
    /// exchange description
    pub description: Option<String>,
    /// short exchange name
    pub exchange: Option<String>,
    /// Exchange parameter id
    pub id: Option<String>,
    /// Always contains at least one 'tradingTime' and zero or more 'sessionTime' tags
    pub schedules: Option<Vec<TradingScheduleTradingScheduleSchedule>>,
    /// References the time zone corresponding to the listed dates and times.
    pub timezone: Option<String>,
    /// Reference on a trade venue of given exchange parameter
    #[serde(rename = "tradeVenueId")]
    pub trade_venue_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradingScheduleTradingScheduleSchedule {
    /// End time of clearing cycle.
    #[serde(rename = "clearingCycleEndTime")]
    pub clearing_cycle_end_time: Option<String>,
    /// Lists the avialble trading sessions. This displays the regular trading hours. If the LIQUID hours differs from the total trading day then a separate 'session' tag is returned.
    pub sessions: Option<Vec<TradingScheduleTradingScheduleScheduleSession>>,
    /// Date of the clearing schedule. 20000101 stands for any Sat, 20000102 stands for any Sun, … 20000107 stands for any Fri.  Any other date stands for itself.
    #[serde(rename = "tradingScheduleDate")]
    pub trading_schedule_date: Option<String>,
    /// Object containing trading times.
    #[serde(rename = "tradingTimes")]
    pub trading_times: Option<Vec<TradingScheduleTradingScheduleScheduleTime>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradingScheduleTradingScheduleScheduleSession {
    /// Closing date time of the sesion.
    #[serde(rename = "closingTime")]
    pub closing_time: Option<String>,
    /// Opening date time of the session.
    #[serde(rename = "openingTime")]
    pub opening_time: Option<String>,
    /// If the whole trading day is considered LIQUID then the value 'LIQUID' is returned.
    /// - Example: `Some("LIQUID".to_string())`
    pub prop: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TradingScheduleTradingScheduleScheduleTime {
    /// Cancel time for day orders.
    /// - Example: `Some("Y".to_string())`
    #[serde(rename = "cancelDayOrders")]
    pub cancel_day_orders: Option<String>,
    /// Closing time of the trading day.
    #[serde(rename = "closingTime")]
    pub closing_time: Option<String>,
    /// Opening time of the trading day.
    #[serde(rename = "openingTime")]
    pub opening_time: Option<String>,
    /// - Example: `Some("LIQUID".to_string())`
    pub prop: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct TraditionalBankInstructionVerification {
    /// - Example: `"U453454".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `"ACHUS"`
    #[serde(rename = "bankInstructionCode")]
    pub bank_instruction_code: TraditionalBankInstructionVerificationBankInstructionCode,
    /// - Example: `"TestInstr".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 100u64))]
    pub bank_instruction_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `1.0`
    #[serde(rename = "creditAmount1")]
    pub credit_amount1: f64,
    /// - Example: `2.0`
    #[serde(rename = "creditAmount2")]
    pub credit_amount2: f64,
    /// - Example: `35354345.0`
    #[serde(rename = "pendingInstructionId")]
    pub pending_instruction_id: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TraditionalBankInstructionVerificationBankInstructionCode {
    #[serde(rename = "USACH")]
    #[default]
    Usach,
    #[serde(rename = "CAACH")]
    Caach,
    #[serde(rename = "ACHUS")]
    Achus,
    #[serde(rename = "WIRE")]
    Wire,
}
impl core::fmt::Display for TraditionalBankInstructionVerificationBankInstructionCode {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Usach => write!(f, "USACH"),
            Self::Caach => write!(f, "CAACH"),
            Self::Achus => write!(f, "ACHUS"),
            Self::Wire => write!(f, "WIRE"),
        }
    }
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct TransactionRequestBody {
    #[serde(rename = "acctIds")]
    pub acct_ids: Option<Vec<String>>,
    pub conids: Option<Vec<i32>>,
    /// Define the currency to display price amounts with.
    #[default(Some("USD".to_string()))]
    pub currency: Option<String>,
    /// Specify the number of days to receive transaction data for.
    #[default(Some(90i32))]
    pub days: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TransactionsResponse {
    /// Returns the currency the account is traded in.
    pub currency: Option<String>,
    /// Returns the epoch time for the start of requests.
    pub from: Option<i32>,
    /// Returns the request identifier, getTransactions.
    pub id: Option<String>,
    /// Returns if the trades are up to date or not.
    #[serde(rename = "includesRealTime")]
    pub includes_real_time: Option<bool>,
    /// Client portal use only
    pub nd: Option<i32>,
    /// Client portal use only
    pub rc: Option<i32>,
    /// Returns the object containing the realized pnl for the contract on the date.
    pub rpnl: Option<TransactionsResponseRpnl>,
    /// Returns the epoch time for the end of requests.
    pub to: Option<i32>,
    /// Lists all supported transaction values.
    pub transactions: Option<Vec<TransactionsResponseTransaction>>,
}
/// Returns the object containing the realized pnl for the contract on the date.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TransactionsResponseRpnl {
    /// Provides the total amount gained or lost from all days returned
    pub amt: Option<String>,
    /// Returns an array of realized pnl objects.
    pub data: Option<Vec<serde_json::Value>>,
    pub items: Option<TransactionsResponseRpnlItems>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TransactionsResponseRpnlItems {
    /// Returns the account ID the trade transacted on.
    pub acctid: Option<String>,
    /// Returns the amount gained or lost on the day.
    pub amt: Option<String>,
    /// Returns the contract ID of the transaction.
    pub conid: Option<String>,
    /// Specifies the currency of the realized value.
    pub cur: Option<String>,
    /// Specifies the date for the transaction.
    pub date: Option<String>,
    /// Returns the foreign exchnage rate.
    #[serde(rename = "fxRate")]
    pub fx_rate: Option<i32>,
    /// Determines if the day was a loss or gain * `L` - LOSS * `G` - GAIN
    pub side: Option<TransactionsResponseRpnlItemsSide>,
}
/// Determines if the day was a loss or gain * `L` - LOSS * `G` - GAIN
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum TransactionsResponseRpnlItemsSide {
    #[default]
    L,
    G,
}
impl core::fmt::Display for TransactionsResponseRpnlItemsSide {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::L => write!(f, "L"),
            Self::G => write!(f, "G"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TransactionsResponseTransaction {
    /// Returns the account which made the transaction.
    pub acctid: Option<String>,
    /// Returns the total value of the trade.
    pub amt: Option<f64>,
    /// Returns the contract identifier.
    pub conid: Option<i32>,
    /// Returns the currency of the traded insturment.
    pub cur: Option<String>,
    /// Reutrns the human-readable datetime of the transaction.
    pub date: Option<String>,
    /// Returns the long name for the company.
    pub desc: Option<String>,
    /// Returns the forex conversion rate.
    #[serde(rename = "fxRate")]
    pub fx_rate: Option<i32>,
    /// Returns the price per share of the transaction.
    pub pr: Option<f64>,
    /// Returns the total quantity traded. Will display a negative value for sell orders, and a positive value for buy orders.
    pub qty: Option<i32>,
    /// Returns the order side.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Transfer200Response {
    /// Request identifier to uniquely track a request.
    /// - Example: `Some(540_608i32)`
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
    /// Signifies that the request was successfully submitted.
    pub success: Option<bool>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct TransferRequestBody {
    /// Order identifier to monitor the order transmissions. Will be set to a valid id if and only if any transfers are present in the response. Otherwise, -1 is returned.
    #[serde(rename = "fpOrderId")]
    pub fp_order_id: Option<i32>,
    /// Request identifier to uniquely track a request.
    #[serde(rename = "reqID")]
    pub req_id: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct TransferRequestBody2 {
    pub instruction: TransferRequestBody2Instruction,
    #[serde(rename = "instructionType")]
    pub instruction_type: TransferRequestBody2InstructionType,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum TransferRequestBody2Instruction {
    #[default]
    FopInstruction(FopInstruction),
    DwacInstruction(DwacInstruction),
    ComplexAssetTransferInstruction(ComplexAssetTransferInstruction),
    ExternalPositionTransfer(ExternalPositionTransfer),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TransferRequestBody2InstructionType {
    #[serde(rename = "DWAC")]
    #[default]
    Dwac,
    #[serde(rename = "FOP")]
    Fop,
    #[serde(rename = "COMPLEX_ASSET_TRANSFER")]
    ComplexAssetTransfer,
    #[serde(rename = "EXTERNAL_POSITION_TRANSFER")]
    ExternalPositionTransfer,
}
impl core::fmt::Display for TransferRequestBody2InstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Dwac => write!(f, "DWAC"),
            Self::Fop => write!(f, "FOP"),
            Self::ComplexAssetTransfer => write!(f, "COMPLEX_ASSET_TRANSFER"),
            Self::ExternalPositionTransfer => write!(f, "EXTERNAL_POSITION_TRANSFER"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct TransferRequestBody3 {
    pub instruction: TransferRequestBody3Instruction,
    #[serde(rename = "instructionType")]
    pub instruction_type: TransferRequestBody3InstructionType,
}
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
#[serde(untagged)]
pub enum TransferRequestBody3Instruction {
    #[default]
    Deposit(DepositFundsInstruction),
    Withdraw(WithdrawFundsInstruction),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum TransferRequestBody3InstructionType {
    #[serde(rename = "DEPOSIT")]
    #[default]
    Deposit,
    #[serde(rename = "WITHDRAWAL")]
    Withdrawal,
}
impl core::fmt::Display for TransferRequestBody3InstructionType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Deposit => write!(f, "DEPOSIT"),
            Self::Withdrawal => write!(f, "WITHDRAWAL"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct TransferRequestBody4 {
    #[validate(nested)]
    pub instruction: InternalPositionTransferInstruction,
    #[serde(rename = "instructionType")]
    #[default("INTERNAL_POSITION_TRANSFER".to_string())]
    pub instruction_type: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
#[serde(default)]
pub struct TransferRequestBody5 {
    #[validate(nested)]
    pub instruction: InternalCashTransferInstruction,
    #[serde(rename = "instructionType")]
    #[default("INTERNAL_CASH_TRANSFER".to_string())]
    pub instruction_type: String,
}
/// a contract's security definition
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TrsrvSecDefResponse {
    pub secdef: Option<Vec<TrsrvSecDefResponseSecdef>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TrsrvSecDefResponseSecdef {
    /// A series of exchanges the given symbol can trade on.
    #[serde(rename = "allExchanges")]
    pub all_exchanges: Option<String>,
    /// The asset class or security type of the contract.
    #[serde(rename = "assetClass")]
    pub asset_class: Option<String>,
    /// The Chinese characters for the symbol.
    #[serde(rename = "chineseName")]
    pub chinese_name: Option<String>,
    /// The conID
    pub conid: Option<i32>,
    /// The country code the contract is traded on.
    #[serde(rename = "countryCode")]
    pub country_code: Option<String>,
    /// The traded currency for the contract.
    pub currency: Option<String>,
    /// Returns rules regarding incrementation for order placement. Not functional for all exchanges. Please see /iserver/contract/rules for more accurate rule details.
    #[serde(rename = "displayRule")]
    pub display_rule: Option<Vec<TrsrvSecDefResponseSecdefDisplayRule>>,
    /// The expiry of the contract. Returns null for non-expiry instruments.
    pub expiry: Option<String>,
    /// Returns symbol name for requested contract.
    #[serde(rename = "fullName")]
    pub full_name: Option<String>,
    /// The group or industry the contract is affilated with.
    pub group: Option<String>,
    /// contract has tradable options contracts.
    #[serde(rename = "hasOptions")]
    pub has_options: Option<bool>,
    /// Indicates increment rule values including lowerEdge and increment value.
    #[serde(rename = "incrementRules")]
    pub increment_rules: Option<Vec<TrsrvSecDefResponseSecdefIncrementRule>>,
    /// The contract is an event contract or not.
    #[serde(rename = "isEventContract")]
    pub is_event_contract: Option<bool>,
    /// The contract is US based or not.
    #[serde(rename = "isUS")]
    pub is_us: Option<bool>,
    /// The last trading day of the contract.
    #[serde(rename = "lastTradingDay")]
    pub last_trading_day: Option<String>,
    /// The primary or listing exchange the contract is hosted on.
    #[serde(rename = "listingExchange")]
    pub listing_exchange: Option<String>,
    /// The contract multiplier.
    pub multiplier: Option<f64>,
    /// The company name.
    pub name: Option<String>,
    /// Returns the content size of the request.
    #[serde(rename = "pageSize")]
    pub page_size: Option<i32>,
    /// a Put or Call option.
    #[serde(rename = "putOrCall")]
    pub put_or_call: Option<String>,
    /// The contract's sector.
    pub sector: Option<String>,
    /// The sector's group.
    #[serde(rename = "sectorGroup")]
    pub sector_group: Option<String>,
    /// The strike of the contract.
    pub strike: Option<String>,
    /// The ticker symbol of the traded contract.
    pub ticker: Option<String>,
    /// Amount of time in ms to generate the data.
    pub time: Option<i32>,
    /// Stock type.
    #[serde(rename = "type")]
    pub r#type: Option<String>,
    /// The contract's underlyer.
    #[serde(rename = "undConid")]
    pub und_conid: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TrsrvSecDefResponseSecdefDisplayRule {
    #[serde(rename = "displayRuleStep")]
    pub display_rule_step: Option<Vec<TrsrvSecDefResponseSecdefDisplayRuleDisplayRuleStep>>,
    /// If the displayed contract information is multiplied based on a given magnitude, the value will be reflected here.
    pub magnification: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TrsrvSecDefResponseSecdefDisplayRuleDisplayRuleStep {
    /// Displays the total number of digits used after the decimal value.
    #[serde(rename = "decimalDigits")]
    pub decimal_digits: Option<i32>,
    /// The lowerEdge display value to correspond to increment rules.
    #[serde(rename = "lowerEdge")]
    pub lower_edge: Option<f64>,
    /// Displays valid display prices for before and after the decimal value.
    #[serde(rename = "wholeDigits")]
    pub whole_digits: Option<i32>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct TrsrvSecDefResponseSecdefIncrementRule {
    /// The price of the instrument must be submitted as a mulitple of the increment value.
    /// - Example: `Some(0.0)`
    pub increment: Option<f64>,
    /// If the current mark price of the instrument is at or above the lower edge, the given increment value is used for order prices.
    /// - Example: `Some(0.0)`
    #[serde(rename = "lowerEdge")]
    pub lower_edge: Option<f64>,
}
/// Many FYI endpoints reference a "typecode" value. The table below lists the available codes and what they correspond to.
///   * `BA` - Borrow Availability
///   * `CA` - Comparable Algo
///   * `DA` - Dividends Advisory
///   * `EA` - Upcoming Earnings
///   * `MF` - Mutual Fund Advisory
///   * `OE` - Option Expiration
///   * `PR` - Portfolio Builder Rebalance
///   * `SE` - Suspend Order on Economic Event
///   * `SG` - Short Term Gain turning Long Term
///   * `SM` - System Messages
///   * `T2` - Assignment Realizing Long-Term Gains
///   * `TO` - Takeover
///   * `UA` - User Alert
///   * `M8` - M871 Trades
///   * `PS` - Platform Use Suggestions
///   * `DL` - Unexercised Option Loss Prevention Reminder
///   * `PT` - Position Transfer
///   * `CB` - Missing Cost Basis
///   * `MS` - Milestones
///   * `TD` - MiFID || 10% Deprecation Notice
///   * `ST` - Save Taxes
///   * `TI` - Trade Idea
///   * `CT` - Cash Transfer
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum Typecodes {
    #[serde(rename = "BA")]
    #[default]
    Ba,
    #[serde(rename = "CA")]
    Ca,
    #[serde(rename = "DA")]
    Da,
    #[serde(rename = "EA")]
    Ea,
    #[serde(rename = "MF")]
    Mf,
    #[serde(rename = "OE")]
    Oe,
    #[serde(rename = "PR")]
    Pr,
    #[serde(rename = "SE")]
    Se,
    #[serde(rename = "SG")]
    Sg,
    #[serde(rename = "SM")]
    Sm,
    T2,
    #[serde(rename = "TO")]
    To,
    #[serde(rename = "UA")]
    Ua,
    M8,
    #[serde(rename = "PS")]
    Ps,
    #[serde(rename = "DL")]
    Dl,
    #[serde(rename = "PT")]
    Pt,
    #[serde(rename = "CB")]
    Cb,
    #[serde(rename = "MS")]
    Ms,
    #[serde(rename = "TD")]
    Td,
    #[serde(rename = "ST")]
    St,
    #[serde(rename = "TI")]
    Ti,
    #[serde(rename = "CT")]
    Ct,
}
impl core::fmt::Display for Typecodes {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Ba => write!(f, "BA"),
            Self::Ca => write!(f, "CA"),
            Self::Da => write!(f, "DA"),
            Self::Ea => write!(f, "EA"),
            Self::Mf => write!(f, "MF"),
            Self::Oe => write!(f, "OE"),
            Self::Pr => write!(f, "PR"),
            Self::Se => write!(f, "SE"),
            Self::Sg => write!(f, "SG"),
            Self::Sm => write!(f, "SM"),
            Self::T2 => write!(f, "T2"),
            Self::To => write!(f, "TO"),
            Self::Ua => write!(f, "UA"),
            Self::M8 => write!(f, "M8"),
            Self::Ps => write!(f, "PS"),
            Self::Dl => write!(f, "DL"),
            Self::Pt => write!(f, "PT"),
            Self::Cb => write!(f, "CB"),
            Self::Ms => write!(f, "MS"),
            Self::Td => write!(f, "TD"),
            Self::St => write!(f, "ST"),
            Self::Ti => write!(f, "TI"),
            Self::Ct => write!(f, "CT"),
        }
    }
}
/// Indicates a successful request to unsubscribe all streams.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UnsubscribedResponse {
    /// The sole key 'unsubscribed' will have boolean value true.
    pub unsubscribed: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct User {
    /// Provide information about the particular entity
    pub entity: Option<UserEntity>,
    /// Internally used
    #[serde(rename = "hasRightCodeInd")]
    pub has_right_code_ind: Option<bool>,
    /// The role of the username as it relates to the account
    #[serde(rename = "roleId")]
    pub role_id: Option<String>,
    /// Identifies the username for the designated entity.
    #[serde(rename = "userName")]
    pub user_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponse {
    /// Returns an array of all accessible accountIds.
    pub accounts: Option<Vec<String>>,
    /// Returns an json object for each accessible account's properties.
    #[serde(rename = "acctProps")]
    pub acct_props: Option<UserAccountsResponseAcctProps>,
    pub aliases: Option<UserAccountsResponseAliases>,
    #[serde(rename = "allowFeatures")]
    pub allow_features: Option<UserAccountsResponseAllowFeatures>,
    #[serde(rename = "chartPeriods")]
    pub chart_periods: Option<UserAccountsResponseChartPeriods>,
    pub groups: Option<Vec<String>>,
    #[serde(rename = "isFt")]
    pub is_ft: Option<bool>,
    #[serde(rename = "isPaper")]
    pub is_paper: Option<bool>,
    pub profiles: Option<Vec<String>>,
    #[serde(rename = "selectedAccount")]
    pub selected_account: Option<String>,
    #[serde(rename = "serverInfo")]
    pub server_info: Option<UserAccountsResponseServerInfo>,
    #[serde(rename = "sessionId")]
    pub session_id: Option<String>,
}
/// Returns an json object for each accessible account's properties.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseAcctProps {
    #[serde(rename = "U1234567")]
    pub u1234567: Option<UserAccountsResponseAcctPropsU1234567>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseAcctPropsU1234567 {
    #[serde(rename = "allowCustomerTime")]
    pub allow_customer_time: Option<bool>,
    #[serde(rename = "autoFx")]
    pub auto_fx: Option<bool>,
    #[serde(rename = "hasChildAccounts")]
    pub has_child_accounts: Option<bool>,
    #[serde(rename = "isProp")]
    pub is_prop: Option<bool>,
    #[serde(rename = "liteUnderPro")]
    pub lite_under_pro: Option<bool>,
    #[serde(rename = "noFXConv")]
    pub no_fxconv: Option<bool>,
    #[serde(rename = "supportsCashQty")]
    pub supports_cash_qty: Option<bool>,
    #[serde(rename = "supportsFractions")]
    pub supports_fractions: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseAliases {
    #[serde(rename = "U1234567")]
    pub u1234567: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseAllowFeatures {
    #[serde(rename = "allowCrypto")]
    pub allow_crypto: Option<bool>,
    #[serde(rename = "allowDynAccount")]
    pub allow_dyn_account: Option<bool>,
    #[serde(rename = "allowEventContract")]
    pub allow_event_contract: Option<bool>,
    #[serde(rename = "allowEventTrading")]
    pub allow_event_trading: Option<bool>,
    #[serde(rename = "allowFXConv")]
    pub allow_fxconv: Option<bool>,
    #[serde(rename = "allowFinancialLens")]
    pub allow_financial_lens: Option<bool>,
    #[serde(rename = "allowMTA")]
    pub allow_mta: Option<bool>,
    #[serde(rename = "allowTypeAhead")]
    pub allow_type_ahead: Option<bool>,
    #[serde(rename = "allowedAssetTypes")]
    pub allowed_asset_types: Option<String>,
    #[serde(rename = "debugPnl")]
    pub debug_pnl: Option<bool>,
    #[serde(rename = "liteUser")]
    pub lite_user: Option<bool>,
    pub research: Option<bool>,
    #[serde(rename = "restrictTradeSubscription")]
    pub restrict_trade_subscription: Option<bool>,
    #[serde(rename = "showEUCostReport")]
    pub show_eucost_report: Option<bool>,
    #[serde(rename = "showGFIS")]
    pub show_gfis: Option<bool>,
    #[serde(rename = "showImpactDashboard")]
    pub show_impact_dashboard: Option<bool>,
    #[serde(rename = "showTaxOpt")]
    pub show_tax_opt: Option<bool>,
    #[serde(rename = "showUkUserLabels")]
    pub show_uk_user_labels: Option<bool>,
    #[serde(rename = "showWebNews")]
    pub show_web_news: Option<bool>,
    #[serde(rename = "sideBySide")]
    pub side_by_side: Option<bool>,
    /// - Example: `Some(30i64)`
    #[serde(rename = "snapshotRefreshTimeout")]
    pub snapshot_refresh_timeout: Option<i64>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseChartPeriods {
    #[serde(rename = "BOND")]
    pub bond: Option<Vec<String>>,
    #[serde(rename = "CASH")]
    pub cash: Option<Vec<String>>,
    #[serde(rename = "CFD")]
    pub cfd: Option<Vec<String>>,
    #[serde(rename = "CMDTY")]
    pub cmdty: Option<Vec<String>>,
    #[serde(rename = "CRYPTO")]
    pub crypto: Option<Vec<String>>,
    #[serde(rename = "FOP")]
    pub fop: Option<Vec<String>>,
    #[serde(rename = "FUND")]
    pub fund: Option<Vec<String>>,
    #[serde(rename = "FUT")]
    pub fut: Option<Vec<String>>,
    #[serde(rename = "IND")]
    pub ind: Option<Vec<String>>,
    #[serde(rename = "IOPT")]
    pub iopt: Option<Vec<String>>,
    #[serde(rename = "OPT")]
    pub opt: Option<Vec<String>>,
    #[serde(rename = "PHYSS")]
    pub physs: Option<Vec<String>>,
    #[serde(rename = "STK")]
    pub stk: Option<Vec<String>>,
    #[serde(rename = "WAR")]
    pub war: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserAccountsResponseServerInfo {
    #[serde(rename = "serverName")]
    pub server_name: Option<String>,
    #[serde(rename = "serverVersion")]
    pub server_version: Option<String>,
}
/// Provide information about the particular entity
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserEntity {
    /// The full entity's name, concatenating the first and last name fields
    #[serde(rename = "entityName")]
    pub entity_name: Option<String>,
    /// The type of entity assigned to the user
    #[serde(rename = "entityType")]
    pub entity_type: Option<UserEntityEntityType>,
    /// The first name of the user
    #[serde(rename = "firstName")]
    pub first_name: Option<String>,
    /// The last name of the user
    #[serde(rename = "lastName")]
    pub last_name: Option<String>,
}
/// The type of entity assigned to the user
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize, oas3_gen_support::Default)]
pub enum UserEntityEntityType {
    #[serde(rename = "INDIVIDUAL")]
    #[default]
    Individual,
    Joint,
    #[serde(rename = "ORG")]
    Org,
}
impl core::fmt::Display for UserEntityEntityType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Individual => write!(f, "INDIVIDUAL"),
            Self::Joint => write!(f, "Joint"),
            Self::Org => write!(f, "ORG"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct UserNameAvailableResponse {
    pub error: Option<Box<ErrorResponse>>,
    #[serde(rename = "errorDescription")]
    pub error_description: Option<String>,
    #[serde(rename = "hasError")]
    pub has_error: Option<bool>,
    #[serde(rename = "isAvailable")]
    pub is_available: Option<bool>,
    #[serde(rename = "isValid")]
    pub is_valid: Option<bool>,
    #[serde(rename = "suggestedUserName")]
    pub suggested_user_name: Option<Vec<String>>,
}
/// UTC datetime string in format YYYYMMDD-hh:mm:ss.
pub type UtcDateTime = String;
/// Validates CSV structure, restriction names, and rule parameters without applying changes. Must be called before /csv/v2/apply with the same requestId.<br><br>**Scope**: `restrictions.write`<br>**Security Policy**: `Signed JWT`
#[derive(Debug, Clone, validator::Validate, oas3_gen_support::Default)]
pub struct VerifyCsvRequest {
    #[validate(nested)]
    pub header: VerifyCsvRequestHeader,
    /// JSON with userName, requestId, and Base64-encoded CSV payload
    #[validate(nested)]
    pub body: VerifyRequest,
}
impl VerifyCsvRequest {
    /// Parse the HTTP response into the response enum.
    pub async fn parse_response(req: reqwest::Response) -> anyhow::Result<ApplyCsvResponse> {
        let status = req.status();
        if status == http::StatusCode::OK {
            let data =
                oas3_gen_support::Diagnostics::<CSVResponse>::json_with_diagnostics(req).await?;
            return Ok(ApplyCsvResponse::Ok(data));
        }
        if status == http::StatusCode::BAD_REQUEST {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::BadRequest);
        }
        if status == http::StatusCode::UNAUTHORIZED {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::Unauthorized);
        }
        if status == http::StatusCode::FORBIDDEN {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::Forbidden);
        }
        if status == http::StatusCode::INTERNAL_SERVER_ERROR {
            let _ = req.bytes().await?;
            return Ok(ApplyCsvResponse::InternalServerError);
        }
        let _ = req.bytes().await?;
        return Ok(ApplyCsvResponse::Unknown);
    }
}
#[derive(Debug, Clone, PartialEq, validator::Validate, oas3_gen_support::Default)]
pub struct VerifyCsvRequestHeader {
    /// OAuth 2.0 Bearer token. Format: Bearer {access_token}. Token contains accountId claim. Validity: ~50 minutes.
    /// - Example: `"Bearer eyJ0eXAiOiJhdCtKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjFkOTEx...".to_string()`
    #[validate(length(min = 1u64))]
    pub authorization: String,
}
impl core::convert::TryFrom<&VerifyCsvRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: &VerifyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
        let mut map = http::HeaderMap::with_capacity(1usize);
        let header_value = http::HeaderValue::try_from(&headers.authorization)?;
        map.insert(AUTHORIZATION, header_value);
        Ok(map)
    }
}
impl core::convert::TryFrom<VerifyCsvRequestHeader> for http::HeaderMap {
    type Error = http::header::InvalidHeaderValue;
    fn try_from(headers: VerifyCsvRequestHeader) -> core::result::Result<Self, Self::Error> {
        http::HeaderMap::try_from(&headers)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct VerifyRequest {
    /// Base64-encoded CSV content. Supported operations: RESTR_ADD, RESTR_DELETE, RESTR_ASSOC_ADD, RESTR_ASSOC_DELETE. Account ID extracted from OAuth token - do NOT include masterAcctId.
    pub payload: Vec<u8>,
    /// Unique request identifier
    /// - Example: `127i32`
    #[serde(rename = "requestId")]
    #[validate(range(min = 1i32))]
    pub request_id: i32,
    /// IBKR username
    /// - Example: `"hatty597".to_string()`
    #[serde(rename = "userName")]
    #[validate(length(min = 1u64, max = 64u64))]
    pub user_name: String,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct Watchlist200Response {
    /// IB's internal hash of the submitted watchlist.
    pub hash: Option<String>,
    /// The submitted watchlist ID.
    pub id: Option<String>,
    /// Array will always be empty. Contents can be queried via `GET /iserver/watchlist?id=`
    pub instruments: Option<Vec<serde_json::Value>>,
    /// The submitted human-readable watchlist name.
    pub name: Option<String>,
    /// Indicates whether watchlist is write-restricted. User-created watchlists will always show false.
    #[serde(rename = "readOnly")]
    pub read_only: Option<bool>,
}
/// Object detailing the successful deletion of a watchlist.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct WatchlistDeleteSuccess {
    /// Internal use. Number of times endpoint has been visited during session.
    #[serde(rename = "MID")]
    pub mid: Option<String>,
    /// Internal use. Always has value 'context'.
    #[default(Some("context".to_string()))]
    pub action: Option<String>,
    pub data: Option<WatchlistDeleteSuccessData>,
}
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct WatchlistDeleteSuccessData {
    /// Watchlist ID of the deleted watchlist.
    pub deleted: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct WatchlistRequestBody {
    /// Must be a number, digits 0-9 only. Must be unique relative to other watchlist IDs.
    #[validate(length(min = 1u64))]
    pub id: String,
    /// Arbitrary human-readable name to be displayed in TWS and Client Portal.
    #[validate(length(min = 1u64))]
    pub name: String,
    /// Array of JSON objects corresponding to watchlist rows, one per instruments.
    pub rows: Vec<WatchlistRequestBodyRow>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, oas3_gen_support::Default)]
pub struct WatchlistRequestBodyRow {
    /// Conid as string.
    #[serde(rename = "C")]
    pub c: Option<String>,
}
/// Object containing a successful query for watchlists saved for the username in use in the current Web API session.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct WatchlistsResponse {
    /// Internal use. Number of times endpoint has been visited during session.
    #[serde(rename = "MID")]
    pub mid: Option<String>,
    /// Internal use. Always has value 'content'.
    #[default(Some("content".to_string()))]
    pub action: Option<String>,
    /// Contains the watchlist query results.
    pub data: Option<WatchlistsResponseData>,
}
/// Contains the watchlist query results.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
pub struct WatchlistsResponseData {
    /// Indicates if username's watchlists can be bulk-deleted.
    pub bulk_delete: Option<bool>,
    /// Indicates if query results contain only market scanners.
    pub scanners_only: Option<bool>,
    /// Indicates if market scanners are included in query results.
    pub show_scanners: Option<bool>,
    /// Array of objects detailing the watchlists saved for the username in use in the current Web API session.
    pub user_lists: Option<Vec<WatchlistsResponseDataUserList>>,
}
/// Details of a single watchlist.
#[derive(Debug, Clone, PartialEq, Deserialize, oas3_gen_support::Default)]
#[serde(default)]
pub struct WatchlistsResponseDataUserList {
    /// Watchlist ID of the watchlist.
    pub id: Option<String>,
    /// Internal use. Indicates if the watchlist is currently in use.
    pub is_open: Option<bool>,
    /// Unix timestamp in milliseconds of the last modification of the watchlist.
    pub modified: Option<i32>,
    /// Display name of the watchlist.
    pub name: Option<String>,
    /// Indicates if the watchlist can be edited.
    pub read_only: Option<bool>,
    /// Always has value 'watchlist'.
    #[serde(rename = "type")]
    #[default(Some("watchlist".to_string()))]
    pub r#type: Option<String>,
}
#[serde_with::skip_serializing_none]
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct WithdrawFundsInstruction {
    /// - Example: `"U46377".to_string()`
    #[serde(rename = "accountId")]
    #[validate(length(min = 1u64, max = 32u64))]
    pub account_id: String,
    /// - Example: `100.0`
    pub amount: f64,
    /// - Example: `"WIRE"`
    #[serde(rename = "bankInstructionMethod")]
    pub bank_instruction_method: WithdrawFundsInstructionBankInstructionMethod,
    /// - Example: `"Instruction".to_string()`
    #[serde(rename = "bankInstructionName")]
    #[validate(length(min = 1u64, max = 150u64))]
    pub bank_instruction_name: String,
    /// - Example: `1012983.0`
    #[serde(rename = "clientInstructionId")]
    pub client_instruction_id: f64,
    /// - Example: `"USD".to_string()`
    #[validate(length(min = 1u64, max = 3u64))]
    pub currency: String,
    #[serde(rename = "dateTimeToOccur")]
    pub date_time_to_occur: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(rename = "iraWithdrawalDetail")]
    #[validate(nested)]
    pub ira_withdrawal_detail: Option<WithdrawFundsInstructionIraWithdrawalDetail>,
    #[serde(rename = "recurringInstructionDetail")]
    #[validate(nested)]
    pub recurring_instruction_detail: Option<RecurringInstructionDetail>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum WithdrawFundsInstructionBankInstructionMethod {
    #[serde(rename = "ACH")]
    #[default]
    Ach,
    #[serde(rename = "WIRE")]
    Wire,
    #[serde(rename = "SEPA")]
    Sepa,
}
impl core::fmt::Display for WithdrawFundsInstructionBankInstructionMethod {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Ach => write!(f, "ACH"),
            Self::Wire => write!(f, "WIRE"),
            Self::Sepa => write!(f, "SEPA"),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, validator::Validate, oas3_gen_support::Default)]
pub struct WithdrawFundsInstructionIraWithdrawalDetail {
    /// - Example: `12.0`
    #[serde(rename = "fedIncomeTaxPercentage")]
    pub fed_income_tax_percentage: f64,
    /// - Example: `"NORMAL"`
    #[serde(rename = "iraWithholdType")]
    pub ira_withhold_type: WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType,
    /// - Example: `"TE".to_string()`
    #[serde(rename = "stateCd")]
    #[validate(length(min = 1u64, max = 2u64))]
    pub state_cd: String,
    /// - Example: `10.0`
    #[serde(rename = "stateIncomeTaxPercentage")]
    pub state_income_tax_percentage: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, oas3_gen_support::Default)]
pub enum WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType {
    #[serde(rename = "DIRECT_ROLLOVER")]
    #[default]
    DirectRollover,
    #[serde(rename = "ROTH_DISTRIBUTION")]
    RothDistribution,
    #[serde(rename = "NORMAL")]
    Normal,
    #[serde(rename = "EARLY")]
    Early,
    #[serde(rename = "DEATH")]
    Death,
    #[serde(rename = "EXCESS_CY")]
    ExcessCy,
    #[serde(rename = "EXCESS_PY")]
    ExcessPy,
    #[serde(rename = "EXCESS_SC")]
    ExcessSc,
}
impl core::fmt::Display for WithdrawFundsInstructionIraWithdrawalDetailIraWithholdType {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::DirectRollover => write!(f, "DIRECT_ROLLOVER"),
            Self::RothDistribution => write!(f, "ROTH_DISTRIBUTION"),
            Self::Normal => write!(f, "NORMAL"),
            Self::Early => write!(f, "EARLY"),
            Self::Death => write!(f, "DEATH"),
            Self::ExcessCy => write!(f, "EXCESS_CY"),
            Self::ExcessPy => write!(f, "EXCESS_PY"),
            Self::ExcessSc => write!(f, "EXCESS_SC"),
        }
    }
}