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
#[allow(warnings)]
use hyper::Client;
use hyper::status::StatusCode;
use rusoto_core::request::DispatchSignedRequest;
use rusoto_core::region;
use std::fmt;
use std::error::Error;
use rusoto_core::request::HttpDispatchError;
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use serde_json;
use rusoto_core::signature::SignedRequest;
use serde_json::Value as SerdeJsonValue;
use serde_json::from_str;
#[doc="<p>Autonomous system (AS) number for Border Gateway Protocol (BGP) configuration.</p> <p>Example: 65000</p>"]
pub type ASN = i64;
#[doc="<p>Indicates the address family for the BGP peer.</p> <ul> <li> <p> <b>ipv4</b>: IPv4 address family</p> </li> <li> <p> <b>ipv6</b>: IPv6 address family</p> </li> </ul>"]
pub type AddressFamily = String;
#[doc="<p>Container for the parameters to the AllocateConnectionOnInterconnect operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct AllocateConnectionOnInterconnectRequest {
#[doc="<p>Bandwidth of the connection.</p> <p>Example: \"<i>500Mbps</i>\"</p> <p>Default: None</p> <p>Values: 50M, 100M, 200M, 300M, 400M, or 500M</p>"]
#[serde(rename="bandwidth")]
pub bandwidth: Bandwidth,
#[doc="<p>Name of the provisioned connection.</p> <p>Example: \"<i>500M Connection to AWS</i>\"</p> <p>Default: None</p>"]
#[serde(rename="connectionName")]
pub connection_name: ConnectionName,
#[doc="<p>ID of the interconnect on which the connection will be provisioned.</p> <p>Example: dxcon-456abc78</p> <p>Default: None</p>"]
#[serde(rename="interconnectId")]
pub interconnect_id: InterconnectId,
#[doc="<p>Numeric account Id of the customer for whom the connection will be provisioned.</p> <p>Example: 123443215678</p> <p>Default: None</p>"]
#[serde(rename="ownerAccount")]
pub owner_account: OwnerAccount,
#[doc="<p>The dedicated VLAN provisioned to the connection.</p> <p>Example: 101</p> <p>Default: None</p>"]
#[serde(rename="vlan")]
pub vlan: VLAN,
}
#[doc="<p>Container for the parameters to the AllocatePrivateVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct AllocatePrivateVirtualInterfaceRequest {
#[doc="<p>The connection ID on which the private virtual interface is provisioned.</p> <p>Default: None</p>"]
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
#[doc="<p>Detailed information for the private virtual interface to be provisioned.</p> <p>Default: None</p>"]
#[serde(rename="newPrivateVirtualInterfaceAllocation")]
pub new_private_virtual_interface_allocation: NewPrivateVirtualInterfaceAllocation,
#[doc="<p>The AWS account that will own the new private virtual interface.</p> <p>Default: None</p>"]
#[serde(rename="ownerAccount")]
pub owner_account: OwnerAccount,
}
#[doc="<p>Container for the parameters to the AllocatePublicVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct AllocatePublicVirtualInterfaceRequest {
#[doc="<p>The connection ID on which the public virtual interface is provisioned.</p> <p>Default: None</p>"]
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
#[doc="<p>Detailed information for the public virtual interface to be provisioned.</p> <p>Default: None</p>"]
#[serde(rename="newPublicVirtualInterfaceAllocation")]
pub new_public_virtual_interface_allocation: NewPublicVirtualInterfaceAllocation,
#[doc="<p>The AWS account that will own the new public virtual interface.</p> <p>Default: None</p>"]
#[serde(rename="ownerAccount")]
pub owner_account: OwnerAccount,
}
#[doc="<p>IP address assigned to the Amazon interface.</p> <p>Example: 192.168.1.1/30 or 2001:db8::1/125</p>"]
pub type AmazonAddress = String;
#[doc="<p>Authentication key for BGP configuration.</p> <p>Example: asdf34example</p>"]
pub type BGPAuthKey = String;
#[doc="<p>A structure containing information about a BGP peer.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct BGPPeer {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: Option<ASN>,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="bgpPeerState")]
pub bgp_peer_state: Option<BGPPeerState>,
#[serde(rename="bgpStatus")]
pub bgp_status: Option<BGPStatus>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
}
#[doc="<p>A list of the BGP peers configured on this virtual interface.</p>"]
pub type BGPPeerList = Vec<BGPPeer>;
#[doc="<p>The state of the BGP peer.</p> <ul> <li> <p> <b>Verifying</b>: The BGP peering addresses or ASN require validation before the BGP peer can be created. This state only applies to BGP peers on a public virtual interface. </p> </li> <li> <p> <b>Pending</b>: The BGP peer has been created, and is in this state until it is ready to be established.</p> </li> <li> <p> <b>Available</b>: The BGP peer can be established.</p> </li> <li> <p> <b>Deleting</b>: The BGP peer is in the process of being deleted.</p> </li> <li> <p> <b>Deleted</b>: The BGP peer has been deleted and cannot be established.</p> </li> </ul>"]
pub type BGPPeerState = String;
#[doc="<p>The Up/Down state of the BGP peer.</p> <ul> <li> <p> <b>Up</b>: The BGP peer is established.</p> </li> <li> <p> <b>Down</b>: The BGP peer is down.</p> </li> </ul>"]
pub type BGPStatus = String;
#[doc="<p>Bandwidth of the connection.</p> <p>Example: 1Gbps</p> <p>Default: None</p>"]
pub type Bandwidth = String;
pub type CIDR = String;
#[doc="<p>Container for the parameters to the ConfirmConnection operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct ConfirmConnectionRequest {
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
}
#[doc="<p>The response received when ConfirmConnection is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct ConfirmConnectionResponse {
#[serde(rename="connectionState")]
pub connection_state: Option<ConnectionState>,
}
#[doc="<p>Container for the parameters to the ConfirmPrivateVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct ConfirmPrivateVirtualInterfaceRequest {
#[doc="<p>ID of the virtual private gateway that will be attached to the virtual interface.</p> <p> A virtual private gateway can be managed via the Amazon Virtual Private Cloud (VPC) console or the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVpnGateway.html\">EC2 CreateVpnGateway</a> action.</p> <p>Default: None</p>"]
#[serde(rename="virtualGatewayId")]
pub virtual_gateway_id: VirtualGatewayId,
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: VirtualInterfaceId,
}
#[doc="<p>The response received when ConfirmPrivateVirtualInterface is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct ConfirmPrivateVirtualInterfaceResponse {
#[serde(rename="virtualInterfaceState")]
pub virtual_interface_state: Option<VirtualInterfaceState>,
}
#[doc="<p>Container for the parameters to the ConfirmPublicVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct ConfirmPublicVirtualInterfaceRequest {
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: VirtualInterfaceId,
}
#[doc="<p>The response received when ConfirmPublicVirtualInterface is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct ConfirmPublicVirtualInterfaceResponse {
#[serde(rename="virtualInterfaceState")]
pub virtual_interface_state: Option<VirtualInterfaceState>,
}
#[doc="<p>A connection represents the physical network connection between the AWS Direct Connect location and the customer.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Connection {
#[doc="<p>Bandwidth of the connection.</p> <p>Example: 1Gbps (for regular connections), or 500Mbps (for hosted connections)</p> <p>Default: None</p>"]
#[serde(rename="bandwidth")]
pub bandwidth: Option<Bandwidth>,
#[serde(rename="connectionId")]
pub connection_id: Option<ConnectionId>,
#[serde(rename="connectionName")]
pub connection_name: Option<ConnectionName>,
#[serde(rename="connectionState")]
pub connection_state: Option<ConnectionState>,
#[doc="<p>The time of the most recent call to DescribeConnectionLoa for this Connection.</p>"]
#[serde(rename="loaIssueTime")]
pub loa_issue_time: Option<LoaIssueTime>,
#[serde(rename="location")]
pub location: Option<LocationCode>,
#[doc="<p>The AWS account that will own the new connection.</p>"]
#[serde(rename="ownerAccount")]
pub owner_account: Option<OwnerAccount>,
#[doc="<p>The name of the AWS Direct Connect service provider associated with the connection.</p>"]
#[serde(rename="partnerName")]
pub partner_name: Option<PartnerName>,
#[serde(rename="region")]
pub region: Option<Region>,
#[serde(rename="vlan")]
pub vlan: Option<VLAN>,
}
#[doc="<p>ID of the connection.</p> <p>Example: dxcon-fg5678gh</p> <p>Default: None</p>"]
pub type ConnectionId = String;
#[doc="<p>A list of connections.</p>"]
pub type ConnectionList = Vec<Connection>;
#[doc="<p>The name of the connection.</p> <p>Example: \"<i>My Connection to AWS</i>\"</p> <p>Default: None</p>"]
pub type ConnectionName = String;
#[doc="<p>State of the connection.</p> <ul> <li> <p> <b>Ordering</b>: The initial state of a hosted connection provisioned on an interconnect. The connection stays in the ordering state until the owner of the hosted connection confirms or declines the connection order.</p> </li> <li> <p> <b>Requested</b>: The initial state of a standard connection. The connection stays in the requested state until the Letter of Authorization (LOA) is sent to the customer.</p> </li> <li> <p> <b>Pending</b>: The connection has been approved, and is being initialized.</p> </li> <li> <p> <b>Available</b>: The network link is up, and the connection is ready for use.</p> </li> <li> <p> <b>Down</b>: The network link is down.</p> </li> <li> <p> <b>Deleting</b>: The connection is in the process of being deleted.</p> </li> <li> <p> <b>Deleted</b>: The connection has been deleted.</p> </li> <li> <p> <b>Rejected</b>: A hosted connection in the 'Ordering' state will enter the 'Rejected' state if it is deleted by the end customer.</p> </li> </ul>"]
pub type ConnectionState = String;
#[doc="<p>A structure containing a list of connections.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Connections {
#[doc="<p>A list of connections.</p>"]
#[serde(rename="connections")]
pub connections: Option<ConnectionList>,
}
#[doc="<p>Container for the parameters to the CreateBGPPeer operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct CreateBGPPeerRequest {
#[doc="<p>Detailed information for the BGP peer to be created.</p> <p>Default: None</p>"]
#[serde(rename="newBGPPeer")]
pub new_bgp_peer: Option<NewBGPPeer>,
#[doc="<p>The ID of the virtual interface on which the BGP peer will be provisioned.</p> <p>Example: dxvif-456abc78</p> <p>Default: None</p>"]
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: Option<VirtualInterfaceId>,
}
#[doc="<p>The response received when CreateBGPPeer is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct CreateBGPPeerResponse {
#[serde(rename="virtualInterface")]
pub virtual_interface: Option<VirtualInterface>,
}
#[doc="<p>Container for the parameters to the CreateConnection operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct CreateConnectionRequest {
#[serde(rename="bandwidth")]
pub bandwidth: Bandwidth,
#[serde(rename="connectionName")]
pub connection_name: ConnectionName,
#[serde(rename="location")]
pub location: LocationCode,
}
#[doc="<p>Container for the parameters to the CreateInterconnect operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct CreateInterconnectRequest {
#[doc="<p>The port bandwidth</p> <p>Example: 1Gbps</p> <p>Default: None</p> <p>Available values: 1Gbps,10Gbps</p>"]
#[serde(rename="bandwidth")]
pub bandwidth: Bandwidth,
#[doc="<p>The name of the interconnect.</p> <p>Example: \"<i>1G Interconnect to AWS</i>\"</p> <p>Default: None</p>"]
#[serde(rename="interconnectName")]
pub interconnect_name: InterconnectName,
#[doc="<p>Where the interconnect is located</p> <p>Example: EqSV5</p> <p>Default: None</p>"]
#[serde(rename="location")]
pub location: LocationCode,
}
#[doc="<p>Container for the parameters to the CreatePrivateVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct CreatePrivateVirtualInterfaceRequest {
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
#[doc="<p>Detailed information for the private virtual interface to be created.</p> <p>Default: None</p>"]
#[serde(rename="newPrivateVirtualInterface")]
pub new_private_virtual_interface: NewPrivateVirtualInterface,
}
#[doc="<p>Container for the parameters to the CreatePublicVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct CreatePublicVirtualInterfaceRequest {
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
#[doc="<p>Detailed information for the public virtual interface to be created.</p> <p>Default: None</p>"]
#[serde(rename="newPublicVirtualInterface")]
pub new_public_virtual_interface: NewPublicVirtualInterface,
}
#[doc="<p>IP address assigned to the customer interface.</p> <p>Example: 192.168.1.2/30 or 2001:db8::2/125</p>"]
pub type CustomerAddress = String;
#[doc="<p>Container for the parameters to the DeleteBGPPeer operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DeleteBGPPeerRequest {
#[serde(rename="asn")]
pub asn: Option<ASN>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[doc="<p>The ID of the virtual interface from which the BGP peer will be deleted.</p> <p>Example: dxvif-456abc78</p> <p>Default: None</p>"]
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: Option<VirtualInterfaceId>,
}
#[doc="<p>The response received when DeleteBGPPeer is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DeleteBGPPeerResponse {
#[serde(rename="virtualInterface")]
pub virtual_interface: Option<VirtualInterface>,
}
#[doc="<p>Container for the parameters to the DeleteConnection operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DeleteConnectionRequest {
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
}
#[doc="<p>Container for the parameters to the DeleteInterconnect operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DeleteInterconnectRequest {
#[serde(rename="interconnectId")]
pub interconnect_id: InterconnectId,
}
#[doc="<p>The response received when DeleteInterconnect is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DeleteInterconnectResponse {
#[serde(rename="interconnectState")]
pub interconnect_state: Option<InterconnectState>,
}
#[doc="<p>Container for the parameters to the DeleteVirtualInterface operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DeleteVirtualInterfaceRequest {
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: VirtualInterfaceId,
}
#[doc="<p>The response received when DeleteVirtualInterface is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DeleteVirtualInterfaceResponse {
#[serde(rename="virtualInterfaceState")]
pub virtual_interface_state: Option<VirtualInterfaceState>,
}
#[doc="<p>Container for the parameters to the DescribeConnectionLoa operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeConnectionLoaRequest {
#[serde(rename="connectionId")]
pub connection_id: ConnectionId,
#[serde(rename="loaContentType")]
pub loa_content_type: Option<LoaContentType>,
#[doc="<p>The name of the APN partner or service provider who establishes connectivity on your behalf. If you supply this parameter, the LOA-CFA lists the provider name alongside your company name as the requester of the cross connect.</p> <p>Default: None</p>"]
#[serde(rename="providerName")]
pub provider_name: Option<ProviderName>,
}
#[doc="<p>The response received when DescribeConnectionLoa is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DescribeConnectionLoaResponse {
#[serde(rename="loa")]
pub loa: Option<Loa>,
}
#[doc="<p>Container for the parameters to the DescribeConnectionsOnInterconnect operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeConnectionsOnInterconnectRequest {
#[doc="<p>ID of the interconnect on which a list of connection is provisioned.</p> <p>Example: dxcon-abc123</p> <p>Default: None</p>"]
#[serde(rename="interconnectId")]
pub interconnect_id: InterconnectId,
}
#[doc="<p>Container for the parameters to the DescribeConnections operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeConnectionsRequest {
#[serde(rename="connectionId")]
pub connection_id: Option<ConnectionId>,
}
#[doc="<p>Container for the parameters to the DescribeInterconnectLoa operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeInterconnectLoaRequest {
#[serde(rename="interconnectId")]
pub interconnect_id: InterconnectId,
#[serde(rename="loaContentType")]
pub loa_content_type: Option<LoaContentType>,
#[doc="<p>The name of the service provider who establishes connectivity on your behalf. If you supply this parameter, the LOA-CFA lists the provider name alongside your company name as the requester of the cross connect.</p> <p>Default: None</p>"]
#[serde(rename="providerName")]
pub provider_name: Option<ProviderName>,
}
#[doc="<p>The response received when DescribeInterconnectLoa is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DescribeInterconnectLoaResponse {
#[serde(rename="loa")]
pub loa: Option<Loa>,
}
#[doc="<p>Container for the parameters to the DescribeInterconnects operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeInterconnectsRequest {
#[serde(rename="interconnectId")]
pub interconnect_id: Option<InterconnectId>,
}
#[doc="<p>Container for the parameters to the DescribeTags operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeTagsRequest {
#[doc="<p>The Amazon Resource Names (ARNs) of the Direct Connect resources.</p>"]
#[serde(rename="resourceArns")]
pub resource_arns: ResourceArnList,
}
#[doc="<p>The response received when DescribeTags is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct DescribeTagsResponse {
#[doc="<p>Information about the tags.</p>"]
#[serde(rename="resourceTags")]
pub resource_tags: Option<ResourceTagList>,
}
#[doc="<p>Container for the parameters to the DescribeVirtualInterfaces operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct DescribeVirtualInterfacesRequest {
#[serde(rename="connectionId")]
pub connection_id: Option<ConnectionId>,
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: Option<VirtualInterfaceId>,
}
pub type ErrorMessage = String;
#[doc="<p>An interconnect is a connection that can host other connections.</p> <p>Like a standard AWS Direct Connect connection, an interconnect represents the physical connection between an AWS Direct Connect partner's network and a specific Direct Connect location. An AWS Direct Connect partner who owns an interconnect can provision hosted connections on the interconnect for their end customers, thereby providing the end customers with connectivity to AWS services.</p> <p>The resources of the interconnect, including bandwidth and VLAN numbers, are shared by all of the hosted connections on the interconnect, and the owner of the interconnect determines how these resources are assigned.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Interconnect {
#[serde(rename="bandwidth")]
pub bandwidth: Option<Bandwidth>,
#[serde(rename="interconnectId")]
pub interconnect_id: Option<InterconnectId>,
#[serde(rename="interconnectName")]
pub interconnect_name: Option<InterconnectName>,
#[serde(rename="interconnectState")]
pub interconnect_state: Option<InterconnectState>,
#[doc="<p>The time of the most recent call to DescribeInterconnectLoa for this Interconnect.</p>"]
#[serde(rename="loaIssueTime")]
pub loa_issue_time: Option<LoaIssueTime>,
#[serde(rename="location")]
pub location: Option<LocationCode>,
#[serde(rename="region")]
pub region: Option<Region>,
}
#[doc="<p>The ID of the interconnect.</p> <p>Example: dxcon-abc123</p>"]
pub type InterconnectId = String;
#[doc="<p>A list of interconnects.</p>"]
pub type InterconnectList = Vec<Interconnect>;
#[doc="<p>The name of the interconnect.</p> <p>Example: \"<i>1G Interconnect to AWS</i>\"</p>"]
pub type InterconnectName = String;
#[doc="<p>State of the interconnect.</p> <ul> <li> <p> <b>Requested</b>: The initial state of an interconnect. The interconnect stays in the requested state until the Letter of Authorization (LOA) is sent to the customer.</p> </li> <li> <p> <b>Pending</b>>: The interconnect has been approved, and is being initialized.</p> </li> <li> <p> <b>Available</b>: The network link is up, and the interconnect is ready for use.</p> </li> <li> <p> <b>Down</b>: The network link is down.</p> </li> <li> <p> <b>Deleting</b>: The interconnect is in the process of being deleted.</p> </li> <li> <p> <b>Deleted</b>: The interconnect has been deleted.</p> </li> </ul>"]
pub type InterconnectState = String;
#[doc="<p>A structure containing a list of interconnects.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Interconnects {
#[doc="<p>A list of interconnects.</p>"]
#[serde(rename="interconnects")]
pub interconnects: Option<InterconnectList>,
}
#[doc="<p>A structure containing the Letter of Authorization - Connecting Facility Assignment (LOA-CFA) for a connection.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Loa {
#[serde(rename="loaContent")]
#[serde(
deserialize_with="::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with="::rusoto_core::serialization::SerdeBlob::serialize_blob",
default,
)]
pub loa_content: Option<LoaContent>,
#[serde(rename="loaContentType")]
pub loa_content_type: Option<LoaContentType>,
}
#[doc="<p>The binary contents of the LOA-CFA document.</p>"]
pub type LoaContent = Vec<u8>;
#[doc="<p>A standard media type indicating the content type of the LOA-CFA document. Currently, the only supported value is \"application/pdf\".</p> <p>Default: application/pdf</p>"]
pub type LoaContentType = String;
pub type LoaIssueTime = f64;
#[doc="<p>An AWS Direct Connect location where connections and interconnects can be requested.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Location {
#[doc="<p>The code used to indicate the AWS Direct Connect location.</p>"]
#[serde(rename="locationCode")]
pub location_code: Option<LocationCode>,
#[doc="<p>The name of the AWS Direct Connect location. The name includes the colocation partner name and the physical site of the lit building.</p>"]
#[serde(rename="locationName")]
pub location_name: Option<LocationName>,
}
#[doc="<p>Where the connection is located.</p> <p>Example: EqSV5</p> <p>Default: None</p>"]
pub type LocationCode = String;
pub type LocationList = Vec<Location>;
pub type LocationName = String;
#[doc="<p>A location is a network facility where AWS Direct Connect routers are available to be connected. Generally, these are colocation hubs where many network providers have equipment, and where cross connects can be delivered. Locations include a name and facility code, and must be provided when creating a connection.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct Locations {
#[doc="<p>A list of colocation hubs where network providers have equipment. Most regions have multiple locations available.</p>"]
#[serde(rename="locations")]
pub locations: Option<LocationList>,
}
#[doc="<p>A structure containing information about a new BGP peer.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct NewBGPPeer {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: Option<ASN>,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
}
#[doc="<p>A structure containing information about a new private virtual interface.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct NewPrivateVirtualInterface {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: ASN,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[serde(rename="virtualGatewayId")]
pub virtual_gateway_id: VirtualGatewayId,
#[serde(rename="virtualInterfaceName")]
pub virtual_interface_name: VirtualInterfaceName,
#[serde(rename="vlan")]
pub vlan: VLAN,
}
#[doc="<p>A structure containing information about a private virtual interface that will be provisioned on a connection.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct NewPrivateVirtualInterfaceAllocation {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: ASN,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[serde(rename="virtualInterfaceName")]
pub virtual_interface_name: VirtualInterfaceName,
#[serde(rename="vlan")]
pub vlan: VLAN,
}
#[doc="<p>A structure containing information about a new public virtual interface.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct NewPublicVirtualInterface {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: ASN,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[serde(rename="routeFilterPrefixes")]
pub route_filter_prefixes: Option<RouteFilterPrefixList>,
#[serde(rename="virtualInterfaceName")]
pub virtual_interface_name: VirtualInterfaceName,
#[serde(rename="vlan")]
pub vlan: VLAN,
}
#[doc="<p>A structure containing information about a public virtual interface that will be provisioned on a connection.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct NewPublicVirtualInterfaceAllocation {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: ASN,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[serde(rename="routeFilterPrefixes")]
pub route_filter_prefixes: Option<RouteFilterPrefixList>,
#[serde(rename="virtualInterfaceName")]
pub virtual_interface_name: VirtualInterfaceName,
#[serde(rename="vlan")]
pub vlan: VLAN,
}
pub type OwnerAccount = String;
pub type PartnerName = String;
pub type ProviderName = String;
#[doc="<p>The AWS region where the connection is located.</p> <p>Example: us-east-1</p> <p>Default: None</p>"]
pub type Region = String;
pub type ResourceArn = String;
pub type ResourceArnList = Vec<ResourceArn>;
#[doc="<p>The tags associated with a Direct Connect resource.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct ResourceTag {
#[doc="<p>The Amazon Resource Name (ARN) of the Direct Connect resource.</p>"]
#[serde(rename="resourceArn")]
pub resource_arn: Option<ResourceArn>,
#[doc="<p>The tags.</p>"]
#[serde(rename="tags")]
pub tags: Option<TagList>,
}
pub type ResourceTagList = Vec<ResourceTag>;
#[doc="<p>A route filter prefix that the customer can advertise through Border Gateway Protocol (BGP) over a public virtual interface.</p>"]
#[derive(Default,Debug,Clone,Serialize,Deserialize)]
pub struct RouteFilterPrefix {
#[doc="<p>CIDR notation for the advertised route. Multiple routes are separated by commas.</p> <p>IPv6 CIDRs must be at least a /64 or shorter</p> <p>Example: 10.10.10.0/24,10.10.11.0/24,2001:db8::/64</p>"]
#[serde(rename="cidr")]
pub cidr: Option<CIDR>,
}
#[doc="<p>A list of routes to be advertised to the AWS network in this region (public virtual interface).</p>"]
pub type RouteFilterPrefixList = Vec<RouteFilterPrefix>;
pub type RouterConfig = String;
#[doc="<p>Information about a tag.</p>"]
#[derive(Default,Debug,Clone,Serialize,Deserialize)]
pub struct Tag {
#[doc="<p>The key of the tag.</p>"]
#[serde(rename="key")]
pub key: TagKey,
#[doc="<p>The value of the tag.</p>"]
#[serde(rename="value")]
pub value: Option<TagValue>,
}
pub type TagKey = String;
pub type TagKeyList = Vec<TagKey>;
pub type TagList = Vec<Tag>;
#[doc="<p>Container for the parameters to the TagResource operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct TagResourceRequest {
#[doc="<p>The Amazon Resource Name (ARN) of the Direct Connect resource.</p> <p>Example: arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-fg5678gh</p>"]
#[serde(rename="resourceArn")]
pub resource_arn: ResourceArn,
#[doc="<p>The list of tags to add.</p>"]
#[serde(rename="tags")]
pub tags: TagList,
}
#[doc="<p>The response received when TagResource is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct TagResourceResponse;
pub type TagValue = String;
#[doc="<p>Container for the parameters to the UntagResource operation.</p>"]
#[derive(Default,Debug,Clone,Serialize)]
pub struct UntagResourceRequest {
#[doc="<p>The Amazon Resource Name (ARN) of the Direct Connect resource.</p>"]
#[serde(rename="resourceArn")]
pub resource_arn: ResourceArn,
#[doc="<p>The list of tag keys to remove.</p>"]
#[serde(rename="tagKeys")]
pub tag_keys: TagKeyList,
}
#[doc="<p>The response received when UntagResource is called.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct UntagResourceResponse;
#[doc="<p>The VLAN ID.</p> <p>Example: 101</p>"]
pub type VLAN = i64;
#[doc="<p>You can create one or more AWS Direct Connect private virtual interfaces linking to your virtual private gateway.</p> <p>Virtual private gateways can be managed using the Amazon Virtual Private Cloud (Amazon VPC) console or the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVpnGateway.html\">Amazon EC2 CreateVpnGateway action</a>.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct VirtualGateway {
#[serde(rename="virtualGatewayId")]
pub virtual_gateway_id: Option<VirtualGatewayId>,
#[serde(rename="virtualGatewayState")]
pub virtual_gateway_state: Option<VirtualGatewayState>,
}
#[doc="<p>The ID of the virtual private gateway to a VPC. This only applies to private virtual interfaces.</p> <p>Example: vgw-123er56</p>"]
pub type VirtualGatewayId = String;
#[doc="<p>A list of virtual private gateways.</p>"]
pub type VirtualGatewayList = Vec<VirtualGateway>;
#[doc="<p>State of the virtual private gateway.</p> <ul> <li> <p> <b>Pending</b>: This is the initial state after calling <i>CreateVpnGateway</i>.</p> </li> <li> <p> <b>Available</b>: Ready for use by a private virtual interface.</p> </li> <li> <p> <b>Deleting</b>: This is the initial state after calling <i>DeleteVpnGateway</i>.</p> </li> <li> <p> <b>Deleted</b>: In this state, a private virtual interface is unable to send traffic over this gateway.</p> </li> </ul>"]
pub type VirtualGatewayState = String;
#[doc="<p>A structure containing a list of virtual private gateways.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct VirtualGateways {
#[doc="<p>A list of virtual private gateways.</p>"]
#[serde(rename="virtualGateways")]
pub virtual_gateways: Option<VirtualGatewayList>,
}
#[doc="<p>A virtual interface (VLAN) transmits the traffic between the AWS Direct Connect location and the customer.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct VirtualInterface {
#[serde(rename="addressFamily")]
pub address_family: Option<AddressFamily>,
#[serde(rename="amazonAddress")]
pub amazon_address: Option<AmazonAddress>,
#[serde(rename="asn")]
pub asn: Option<ASN>,
#[serde(rename="authKey")]
pub auth_key: Option<BGPAuthKey>,
#[serde(rename="bgpPeers")]
pub bgp_peers: Option<BGPPeerList>,
#[serde(rename="connectionId")]
pub connection_id: Option<ConnectionId>,
#[serde(rename="customerAddress")]
pub customer_address: Option<CustomerAddress>,
#[doc="<p>Information for generating the customer router configuration.</p>"]
#[serde(rename="customerRouterConfig")]
pub customer_router_config: Option<RouterConfig>,
#[serde(rename="location")]
pub location: Option<LocationCode>,
#[doc="<p>The AWS account that will own the new virtual interface.</p>"]
#[serde(rename="ownerAccount")]
pub owner_account: Option<OwnerAccount>,
#[serde(rename="routeFilterPrefixes")]
pub route_filter_prefixes: Option<RouteFilterPrefixList>,
#[serde(rename="virtualGatewayId")]
pub virtual_gateway_id: Option<VirtualGatewayId>,
#[serde(rename="virtualInterfaceId")]
pub virtual_interface_id: Option<VirtualInterfaceId>,
#[serde(rename="virtualInterfaceName")]
pub virtual_interface_name: Option<VirtualInterfaceName>,
#[serde(rename="virtualInterfaceState")]
pub virtual_interface_state: Option<VirtualInterfaceState>,
#[serde(rename="virtualInterfaceType")]
pub virtual_interface_type: Option<VirtualInterfaceType>,
#[serde(rename="vlan")]
pub vlan: Option<VLAN>,
}
#[doc="<p>ID of the virtual interface.</p> <p>Example: dxvif-123dfg56</p> <p>Default: None</p>"]
pub type VirtualInterfaceId = String;
#[doc="<p>A list of virtual interfaces.</p>"]
pub type VirtualInterfaceList = Vec<VirtualInterface>;
#[doc="<p>The name of the virtual interface assigned by the customer.</p> <p>Example: \"My VPC\"</p>"]
pub type VirtualInterfaceName = String;
#[doc="<p>State of the virtual interface.</p> <ul> <li> <p> <b>Confirming</b>: The creation of the virtual interface is pending confirmation from the virtual interface owner. If the owner of the virtual interface is different from the owner of the connection on which it is provisioned, then the virtual interface will remain in this state until it is confirmed by the virtual interface owner.</p> </li> <li> <p> <b>Verifying</b>: This state only applies to public virtual interfaces. Each public virtual interface needs validation before the virtual interface can be created.</p> </li> <li> <p> <b>Pending</b>: A virtual interface is in this state from the time that it is created until the virtual interface is ready to forward traffic.</p> </li> <li> <p> <b>Available</b>: A virtual interface that is able to forward traffic.</p> </li> <li> <p> <b>Down</b>: A virtual interface that is BGP down.</p> </li> <li> <p> <b>Deleting</b>: A virtual interface is in this state immediately after calling <i>DeleteVirtualInterface</i> until it can no longer forward traffic.</p> </li> <li> <p> <b>Deleted</b>: A virtual interface that cannot forward traffic.</p> </li> <li> <p> <b>Rejected</b>: The virtual interface owner has declined creation of the virtual interface. If a virtual interface in the 'Confirming' state is deleted by the virtual interface owner, the virtual interface will enter the 'Rejected' state.</p> </li> </ul>"]
pub type VirtualInterfaceState = String;
#[doc="<p>The type of virtual interface.</p> <p>Example: private (Amazon VPC) or public (Amazon S3, Amazon DynamoDB, and so on.)</p>"]
pub type VirtualInterfaceType = String;
#[doc="<p>A structure containing a list of virtual interfaces.</p>"]
#[derive(Default,Debug,Clone,Deserialize)]
pub struct VirtualInterfaces {
#[doc="<p>A list of virtual interfaces.</p>"]
#[serde(rename="virtualInterfaces")]
pub virtual_interfaces: Option<VirtualInterfaceList>,
}
#[derive(Debug, PartialEq)]
pub enum AllocateConnectionOnInterconnectError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl AllocateConnectionOnInterconnectError {
pub fn from_body(body: &str) -> AllocateConnectionOnInterconnectError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => AllocateConnectionOnInterconnectError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => AllocateConnectionOnInterconnectError::DirectConnectServer(String::from(error_message)),
"ValidationException" => AllocateConnectionOnInterconnectError::Validation(error_message.to_string()),
_ => AllocateConnectionOnInterconnectError::Unknown(String::from(body))
}
},
Err(_) => AllocateConnectionOnInterconnectError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for AllocateConnectionOnInterconnectError {
fn from(err: serde_json::error::Error) -> AllocateConnectionOnInterconnectError {
AllocateConnectionOnInterconnectError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for AllocateConnectionOnInterconnectError {
fn from(err: CredentialsError) -> AllocateConnectionOnInterconnectError {
AllocateConnectionOnInterconnectError::Credentials(err)
}
}
impl From<HttpDispatchError> for AllocateConnectionOnInterconnectError {
fn from(err: HttpDispatchError) -> AllocateConnectionOnInterconnectError {
AllocateConnectionOnInterconnectError::HttpDispatch(err)
}
}
impl fmt::Display for AllocateConnectionOnInterconnectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AllocateConnectionOnInterconnectError {
fn description(&self) -> &str {
match *self {
AllocateConnectionOnInterconnectError::DirectConnectClient(ref cause) => cause,
AllocateConnectionOnInterconnectError::DirectConnectServer(ref cause) => cause,
AllocateConnectionOnInterconnectError::Validation(ref cause) => cause,
AllocateConnectionOnInterconnectError::Credentials(ref err) => err.description(),
AllocateConnectionOnInterconnectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AllocateConnectionOnInterconnectError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum AllocatePrivateVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl AllocatePrivateVirtualInterfaceError {
pub fn from_body(body: &str) -> AllocatePrivateVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => AllocatePrivateVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => AllocatePrivateVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => AllocatePrivateVirtualInterfaceError::Validation(error_message.to_string()),
_ => AllocatePrivateVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => AllocatePrivateVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for AllocatePrivateVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> AllocatePrivateVirtualInterfaceError {
AllocatePrivateVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for AllocatePrivateVirtualInterfaceError {
fn from(err: CredentialsError) -> AllocatePrivateVirtualInterfaceError {
AllocatePrivateVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for AllocatePrivateVirtualInterfaceError {
fn from(err: HttpDispatchError) -> AllocatePrivateVirtualInterfaceError {
AllocatePrivateVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for AllocatePrivateVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AllocatePrivateVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
AllocatePrivateVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
AllocatePrivateVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
AllocatePrivateVirtualInterfaceError::Validation(ref cause) => cause,
AllocatePrivateVirtualInterfaceError::Credentials(ref err) => err.description(),
AllocatePrivateVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AllocatePrivateVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum AllocatePublicVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl AllocatePublicVirtualInterfaceError {
pub fn from_body(body: &str) -> AllocatePublicVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => AllocatePublicVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => AllocatePublicVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => AllocatePublicVirtualInterfaceError::Validation(error_message.to_string()),
_ => AllocatePublicVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => AllocatePublicVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for AllocatePublicVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> AllocatePublicVirtualInterfaceError {
AllocatePublicVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for AllocatePublicVirtualInterfaceError {
fn from(err: CredentialsError) -> AllocatePublicVirtualInterfaceError {
AllocatePublicVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for AllocatePublicVirtualInterfaceError {
fn from(err: HttpDispatchError) -> AllocatePublicVirtualInterfaceError {
AllocatePublicVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for AllocatePublicVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AllocatePublicVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
AllocatePublicVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
AllocatePublicVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
AllocatePublicVirtualInterfaceError::Validation(ref cause) => cause,
AllocatePublicVirtualInterfaceError::Credentials(ref err) => err.description(),
AllocatePublicVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
AllocatePublicVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum ConfirmConnectionError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl ConfirmConnectionError {
pub fn from_body(body: &str) -> ConfirmConnectionError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => ConfirmConnectionError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => ConfirmConnectionError::DirectConnectServer(String::from(error_message)),
"ValidationException" => ConfirmConnectionError::Validation(error_message.to_string()),
_ => ConfirmConnectionError::Unknown(String::from(body))
}
},
Err(_) => ConfirmConnectionError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for ConfirmConnectionError {
fn from(err: serde_json::error::Error) -> ConfirmConnectionError {
ConfirmConnectionError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for ConfirmConnectionError {
fn from(err: CredentialsError) -> ConfirmConnectionError {
ConfirmConnectionError::Credentials(err)
}
}
impl From<HttpDispatchError> for ConfirmConnectionError {
fn from(err: HttpDispatchError) -> ConfirmConnectionError {
ConfirmConnectionError::HttpDispatch(err)
}
}
impl fmt::Display for ConfirmConnectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ConfirmConnectionError {
fn description(&self) -> &str {
match *self {
ConfirmConnectionError::DirectConnectClient(ref cause) => cause,
ConfirmConnectionError::DirectConnectServer(ref cause) => cause,
ConfirmConnectionError::Validation(ref cause) => cause,
ConfirmConnectionError::Credentials(ref err) => err.description(),
ConfirmConnectionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ConfirmConnectionError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum ConfirmPrivateVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl ConfirmPrivateVirtualInterfaceError {
pub fn from_body(body: &str) -> ConfirmPrivateVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => ConfirmPrivateVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => ConfirmPrivateVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => ConfirmPrivateVirtualInterfaceError::Validation(error_message.to_string()),
_ => ConfirmPrivateVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => ConfirmPrivateVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for ConfirmPrivateVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> ConfirmPrivateVirtualInterfaceError {
ConfirmPrivateVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for ConfirmPrivateVirtualInterfaceError {
fn from(err: CredentialsError) -> ConfirmPrivateVirtualInterfaceError {
ConfirmPrivateVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for ConfirmPrivateVirtualInterfaceError {
fn from(err: HttpDispatchError) -> ConfirmPrivateVirtualInterfaceError {
ConfirmPrivateVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for ConfirmPrivateVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ConfirmPrivateVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
ConfirmPrivateVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
ConfirmPrivateVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
ConfirmPrivateVirtualInterfaceError::Validation(ref cause) => cause,
ConfirmPrivateVirtualInterfaceError::Credentials(ref err) => err.description(),
ConfirmPrivateVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ConfirmPrivateVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum ConfirmPublicVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl ConfirmPublicVirtualInterfaceError {
pub fn from_body(body: &str) -> ConfirmPublicVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => ConfirmPublicVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => ConfirmPublicVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => ConfirmPublicVirtualInterfaceError::Validation(error_message.to_string()),
_ => ConfirmPublicVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => ConfirmPublicVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for ConfirmPublicVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> ConfirmPublicVirtualInterfaceError {
ConfirmPublicVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for ConfirmPublicVirtualInterfaceError {
fn from(err: CredentialsError) -> ConfirmPublicVirtualInterfaceError {
ConfirmPublicVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for ConfirmPublicVirtualInterfaceError {
fn from(err: HttpDispatchError) -> ConfirmPublicVirtualInterfaceError {
ConfirmPublicVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for ConfirmPublicVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ConfirmPublicVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
ConfirmPublicVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
ConfirmPublicVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
ConfirmPublicVirtualInterfaceError::Validation(ref cause) => cause,
ConfirmPublicVirtualInterfaceError::Credentials(ref err) => err.description(),
ConfirmPublicVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ConfirmPublicVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateBGPPeerError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl CreateBGPPeerError {
pub fn from_body(body: &str) -> CreateBGPPeerError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => CreateBGPPeerError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => CreateBGPPeerError::DirectConnectServer(String::from(error_message)),
"ValidationException" => CreateBGPPeerError::Validation(error_message.to_string()),
_ => CreateBGPPeerError::Unknown(String::from(body))
}
},
Err(_) => CreateBGPPeerError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for CreateBGPPeerError {
fn from(err: serde_json::error::Error) -> CreateBGPPeerError {
CreateBGPPeerError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for CreateBGPPeerError {
fn from(err: CredentialsError) -> CreateBGPPeerError {
CreateBGPPeerError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateBGPPeerError {
fn from(err: HttpDispatchError) -> CreateBGPPeerError {
CreateBGPPeerError::HttpDispatch(err)
}
}
impl fmt::Display for CreateBGPPeerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateBGPPeerError {
fn description(&self) -> &str {
match *self {
CreateBGPPeerError::DirectConnectClient(ref cause) => cause,
CreateBGPPeerError::DirectConnectServer(ref cause) => cause,
CreateBGPPeerError::Validation(ref cause) => cause,
CreateBGPPeerError::Credentials(ref err) => err.description(),
CreateBGPPeerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateBGPPeerError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateConnectionError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl CreateConnectionError {
pub fn from_body(body: &str) -> CreateConnectionError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => CreateConnectionError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => CreateConnectionError::DirectConnectServer(String::from(error_message)),
"ValidationException" => CreateConnectionError::Validation(error_message.to_string()),
_ => CreateConnectionError::Unknown(String::from(body))
}
},
Err(_) => CreateConnectionError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for CreateConnectionError {
fn from(err: serde_json::error::Error) -> CreateConnectionError {
CreateConnectionError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for CreateConnectionError {
fn from(err: CredentialsError) -> CreateConnectionError {
CreateConnectionError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateConnectionError {
fn from(err: HttpDispatchError) -> CreateConnectionError {
CreateConnectionError::HttpDispatch(err)
}
}
impl fmt::Display for CreateConnectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateConnectionError {
fn description(&self) -> &str {
match *self {
CreateConnectionError::DirectConnectClient(ref cause) => cause,
CreateConnectionError::DirectConnectServer(ref cause) => cause,
CreateConnectionError::Validation(ref cause) => cause,
CreateConnectionError::Credentials(ref err) => err.description(),
CreateConnectionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateConnectionError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateInterconnectError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl CreateInterconnectError {
pub fn from_body(body: &str) -> CreateInterconnectError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => CreateInterconnectError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => CreateInterconnectError::DirectConnectServer(String::from(error_message)),
"ValidationException" => CreateInterconnectError::Validation(error_message.to_string()),
_ => CreateInterconnectError::Unknown(String::from(body))
}
},
Err(_) => CreateInterconnectError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for CreateInterconnectError {
fn from(err: serde_json::error::Error) -> CreateInterconnectError {
CreateInterconnectError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for CreateInterconnectError {
fn from(err: CredentialsError) -> CreateInterconnectError {
CreateInterconnectError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateInterconnectError {
fn from(err: HttpDispatchError) -> CreateInterconnectError {
CreateInterconnectError::HttpDispatch(err)
}
}
impl fmt::Display for CreateInterconnectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateInterconnectError {
fn description(&self) -> &str {
match *self {
CreateInterconnectError::DirectConnectClient(ref cause) => cause,
CreateInterconnectError::DirectConnectServer(ref cause) => cause,
CreateInterconnectError::Validation(ref cause) => cause,
CreateInterconnectError::Credentials(ref err) => err.description(),
CreateInterconnectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateInterconnectError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePrivateVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl CreatePrivateVirtualInterfaceError {
pub fn from_body(body: &str) -> CreatePrivateVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => CreatePrivateVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => CreatePrivateVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => CreatePrivateVirtualInterfaceError::Validation(error_message.to_string()),
_ => CreatePrivateVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => CreatePrivateVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for CreatePrivateVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> CreatePrivateVirtualInterfaceError {
CreatePrivateVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for CreatePrivateVirtualInterfaceError {
fn from(err: CredentialsError) -> CreatePrivateVirtualInterfaceError {
CreatePrivateVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreatePrivateVirtualInterfaceError {
fn from(err: HttpDispatchError) -> CreatePrivateVirtualInterfaceError {
CreatePrivateVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for CreatePrivateVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePrivateVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
CreatePrivateVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
CreatePrivateVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
CreatePrivateVirtualInterfaceError::Validation(ref cause) => cause,
CreatePrivateVirtualInterfaceError::Credentials(ref err) => err.description(),
CreatePrivateVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreatePrivateVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreatePublicVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl CreatePublicVirtualInterfaceError {
pub fn from_body(body: &str) -> CreatePublicVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => CreatePublicVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => CreatePublicVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => CreatePublicVirtualInterfaceError::Validation(error_message.to_string()),
_ => CreatePublicVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => CreatePublicVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for CreatePublicVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> CreatePublicVirtualInterfaceError {
CreatePublicVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for CreatePublicVirtualInterfaceError {
fn from(err: CredentialsError) -> CreatePublicVirtualInterfaceError {
CreatePublicVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreatePublicVirtualInterfaceError {
fn from(err: HttpDispatchError) -> CreatePublicVirtualInterfaceError {
CreatePublicVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for CreatePublicVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreatePublicVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
CreatePublicVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
CreatePublicVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
CreatePublicVirtualInterfaceError::Validation(ref cause) => cause,
CreatePublicVirtualInterfaceError::Credentials(ref err) => err.description(),
CreatePublicVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreatePublicVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteBGPPeerError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DeleteBGPPeerError {
pub fn from_body(body: &str) -> DeleteBGPPeerError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DeleteBGPPeerError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DeleteBGPPeerError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DeleteBGPPeerError::Validation(error_message.to_string()),
_ => DeleteBGPPeerError::Unknown(String::from(body))
}
},
Err(_) => DeleteBGPPeerError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DeleteBGPPeerError {
fn from(err: serde_json::error::Error) -> DeleteBGPPeerError {
DeleteBGPPeerError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteBGPPeerError {
fn from(err: CredentialsError) -> DeleteBGPPeerError {
DeleteBGPPeerError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteBGPPeerError {
fn from(err: HttpDispatchError) -> DeleteBGPPeerError {
DeleteBGPPeerError::HttpDispatch(err)
}
}
impl fmt::Display for DeleteBGPPeerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteBGPPeerError {
fn description(&self) -> &str {
match *self {
DeleteBGPPeerError::DirectConnectClient(ref cause) => cause,
DeleteBGPPeerError::DirectConnectServer(ref cause) => cause,
DeleteBGPPeerError::Validation(ref cause) => cause,
DeleteBGPPeerError::Credentials(ref err) => err.description(),
DeleteBGPPeerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteBGPPeerError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteConnectionError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DeleteConnectionError {
pub fn from_body(body: &str) -> DeleteConnectionError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DeleteConnectionError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DeleteConnectionError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DeleteConnectionError::Validation(error_message.to_string()),
_ => DeleteConnectionError::Unknown(String::from(body))
}
},
Err(_) => DeleteConnectionError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DeleteConnectionError {
fn from(err: serde_json::error::Error) -> DeleteConnectionError {
DeleteConnectionError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteConnectionError {
fn from(err: CredentialsError) -> DeleteConnectionError {
DeleteConnectionError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteConnectionError {
fn from(err: HttpDispatchError) -> DeleteConnectionError {
DeleteConnectionError::HttpDispatch(err)
}
}
impl fmt::Display for DeleteConnectionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteConnectionError {
fn description(&self) -> &str {
match *self {
DeleteConnectionError::DirectConnectClient(ref cause) => cause,
DeleteConnectionError::DirectConnectServer(ref cause) => cause,
DeleteConnectionError::Validation(ref cause) => cause,
DeleteConnectionError::Credentials(ref err) => err.description(),
DeleteConnectionError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteConnectionError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteInterconnectError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DeleteInterconnectError {
pub fn from_body(body: &str) -> DeleteInterconnectError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DeleteInterconnectError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DeleteInterconnectError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DeleteInterconnectError::Validation(error_message.to_string()),
_ => DeleteInterconnectError::Unknown(String::from(body))
}
},
Err(_) => DeleteInterconnectError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DeleteInterconnectError {
fn from(err: serde_json::error::Error) -> DeleteInterconnectError {
DeleteInterconnectError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteInterconnectError {
fn from(err: CredentialsError) -> DeleteInterconnectError {
DeleteInterconnectError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteInterconnectError {
fn from(err: HttpDispatchError) -> DeleteInterconnectError {
DeleteInterconnectError::HttpDispatch(err)
}
}
impl fmt::Display for DeleteInterconnectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteInterconnectError {
fn description(&self) -> &str {
match *self {
DeleteInterconnectError::DirectConnectClient(ref cause) => cause,
DeleteInterconnectError::DirectConnectServer(ref cause) => cause,
DeleteInterconnectError::Validation(ref cause) => cause,
DeleteInterconnectError::Credentials(ref err) => err.description(),
DeleteInterconnectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteInterconnectError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteVirtualInterfaceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DeleteVirtualInterfaceError {
pub fn from_body(body: &str) -> DeleteVirtualInterfaceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DeleteVirtualInterfaceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DeleteVirtualInterfaceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DeleteVirtualInterfaceError::Validation(error_message.to_string()),
_ => DeleteVirtualInterfaceError::Unknown(String::from(body))
}
},
Err(_) => DeleteVirtualInterfaceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DeleteVirtualInterfaceError {
fn from(err: serde_json::error::Error) -> DeleteVirtualInterfaceError {
DeleteVirtualInterfaceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteVirtualInterfaceError {
fn from(err: CredentialsError) -> DeleteVirtualInterfaceError {
DeleteVirtualInterfaceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteVirtualInterfaceError {
fn from(err: HttpDispatchError) -> DeleteVirtualInterfaceError {
DeleteVirtualInterfaceError::HttpDispatch(err)
}
}
impl fmt::Display for DeleteVirtualInterfaceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteVirtualInterfaceError {
fn description(&self) -> &str {
match *self {
DeleteVirtualInterfaceError::DirectConnectClient(ref cause) => cause,
DeleteVirtualInterfaceError::DirectConnectServer(ref cause) => cause,
DeleteVirtualInterfaceError::Validation(ref cause) => cause,
DeleteVirtualInterfaceError::Credentials(ref err) => err.description(),
DeleteVirtualInterfaceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteVirtualInterfaceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConnectionLoaError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeConnectionLoaError {
pub fn from_body(body: &str) -> DescribeConnectionLoaError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeConnectionLoaError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeConnectionLoaError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeConnectionLoaError::Validation(error_message.to_string()),
_ => DescribeConnectionLoaError::Unknown(String::from(body))
}
},
Err(_) => DescribeConnectionLoaError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeConnectionLoaError {
fn from(err: serde_json::error::Error) -> DescribeConnectionLoaError {
DescribeConnectionLoaError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConnectionLoaError {
fn from(err: CredentialsError) -> DescribeConnectionLoaError {
DescribeConnectionLoaError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConnectionLoaError {
fn from(err: HttpDispatchError) -> DescribeConnectionLoaError {
DescribeConnectionLoaError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeConnectionLoaError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConnectionLoaError {
fn description(&self) -> &str {
match *self {
DescribeConnectionLoaError::DirectConnectClient(ref cause) => cause,
DescribeConnectionLoaError::DirectConnectServer(ref cause) => cause,
DescribeConnectionLoaError::Validation(ref cause) => cause,
DescribeConnectionLoaError::Credentials(ref err) => err.description(),
DescribeConnectionLoaError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeConnectionLoaError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConnectionsError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeConnectionsError {
pub fn from_body(body: &str) -> DescribeConnectionsError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeConnectionsError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeConnectionsError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeConnectionsError::Validation(error_message.to_string()),
_ => DescribeConnectionsError::Unknown(String::from(body))
}
},
Err(_) => DescribeConnectionsError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeConnectionsError {
fn from(err: serde_json::error::Error) -> DescribeConnectionsError {
DescribeConnectionsError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConnectionsError {
fn from(err: CredentialsError) -> DescribeConnectionsError {
DescribeConnectionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConnectionsError {
fn from(err: HttpDispatchError) -> DescribeConnectionsError {
DescribeConnectionsError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeConnectionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConnectionsError {
fn description(&self) -> &str {
match *self {
DescribeConnectionsError::DirectConnectClient(ref cause) => cause,
DescribeConnectionsError::DirectConnectServer(ref cause) => cause,
DescribeConnectionsError::Validation(ref cause) => cause,
DescribeConnectionsError::Credentials(ref err) => err.description(),
DescribeConnectionsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeConnectionsError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConnectionsOnInterconnectError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeConnectionsOnInterconnectError {
pub fn from_body(body: &str) -> DescribeConnectionsOnInterconnectError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeConnectionsOnInterconnectError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeConnectionsOnInterconnectError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeConnectionsOnInterconnectError::Validation(error_message.to_string()),
_ => DescribeConnectionsOnInterconnectError::Unknown(String::from(body))
}
},
Err(_) => DescribeConnectionsOnInterconnectError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeConnectionsOnInterconnectError {
fn from(err: serde_json::error::Error) -> DescribeConnectionsOnInterconnectError {
DescribeConnectionsOnInterconnectError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConnectionsOnInterconnectError {
fn from(err: CredentialsError) -> DescribeConnectionsOnInterconnectError {
DescribeConnectionsOnInterconnectError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConnectionsOnInterconnectError {
fn from(err: HttpDispatchError) -> DescribeConnectionsOnInterconnectError {
DescribeConnectionsOnInterconnectError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeConnectionsOnInterconnectError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConnectionsOnInterconnectError {
fn description(&self) -> &str {
match *self {
DescribeConnectionsOnInterconnectError::DirectConnectClient(ref cause) => cause,
DescribeConnectionsOnInterconnectError::DirectConnectServer(ref cause) => cause,
DescribeConnectionsOnInterconnectError::Validation(ref cause) => cause,
DescribeConnectionsOnInterconnectError::Credentials(ref err) => err.description(),
DescribeConnectionsOnInterconnectError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeConnectionsOnInterconnectError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeInterconnectLoaError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeInterconnectLoaError {
pub fn from_body(body: &str) -> DescribeInterconnectLoaError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeInterconnectLoaError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeInterconnectLoaError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeInterconnectLoaError::Validation(error_message.to_string()),
_ => DescribeInterconnectLoaError::Unknown(String::from(body))
}
},
Err(_) => DescribeInterconnectLoaError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeInterconnectLoaError {
fn from(err: serde_json::error::Error) -> DescribeInterconnectLoaError {
DescribeInterconnectLoaError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeInterconnectLoaError {
fn from(err: CredentialsError) -> DescribeInterconnectLoaError {
DescribeInterconnectLoaError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeInterconnectLoaError {
fn from(err: HttpDispatchError) -> DescribeInterconnectLoaError {
DescribeInterconnectLoaError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeInterconnectLoaError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeInterconnectLoaError {
fn description(&self) -> &str {
match *self {
DescribeInterconnectLoaError::DirectConnectClient(ref cause) => cause,
DescribeInterconnectLoaError::DirectConnectServer(ref cause) => cause,
DescribeInterconnectLoaError::Validation(ref cause) => cause,
DescribeInterconnectLoaError::Credentials(ref err) => err.description(),
DescribeInterconnectLoaError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeInterconnectLoaError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeInterconnectsError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeInterconnectsError {
pub fn from_body(body: &str) -> DescribeInterconnectsError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeInterconnectsError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeInterconnectsError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeInterconnectsError::Validation(error_message.to_string()),
_ => DescribeInterconnectsError::Unknown(String::from(body))
}
},
Err(_) => DescribeInterconnectsError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeInterconnectsError {
fn from(err: serde_json::error::Error) -> DescribeInterconnectsError {
DescribeInterconnectsError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeInterconnectsError {
fn from(err: CredentialsError) -> DescribeInterconnectsError {
DescribeInterconnectsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeInterconnectsError {
fn from(err: HttpDispatchError) -> DescribeInterconnectsError {
DescribeInterconnectsError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeInterconnectsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeInterconnectsError {
fn description(&self) -> &str {
match *self {
DescribeInterconnectsError::DirectConnectClient(ref cause) => cause,
DescribeInterconnectsError::DirectConnectServer(ref cause) => cause,
DescribeInterconnectsError::Validation(ref cause) => cause,
DescribeInterconnectsError::Credentials(ref err) => err.description(),
DescribeInterconnectsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeInterconnectsError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLocationsError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeLocationsError {
pub fn from_body(body: &str) -> DescribeLocationsError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeLocationsError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeLocationsError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeLocationsError::Validation(error_message.to_string()),
_ => DescribeLocationsError::Unknown(String::from(body))
}
},
Err(_) => DescribeLocationsError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeLocationsError {
fn from(err: serde_json::error::Error) -> DescribeLocationsError {
DescribeLocationsError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeLocationsError {
fn from(err: CredentialsError) -> DescribeLocationsError {
DescribeLocationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeLocationsError {
fn from(err: HttpDispatchError) -> DescribeLocationsError {
DescribeLocationsError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeLocationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLocationsError {
fn description(&self) -> &str {
match *self {
DescribeLocationsError::DirectConnectClient(ref cause) => cause,
DescribeLocationsError::DirectConnectServer(ref cause) => cause,
DescribeLocationsError::Validation(ref cause) => cause,
DescribeLocationsError::Credentials(ref err) => err.description(),
DescribeLocationsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeLocationsError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeTagsError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeTagsError {
pub fn from_body(body: &str) -> DescribeTagsError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeTagsError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeTagsError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeTagsError::Validation(error_message.to_string()),
_ => DescribeTagsError::Unknown(String::from(body))
}
},
Err(_) => DescribeTagsError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeTagsError {
fn from(err: serde_json::error::Error) -> DescribeTagsError {
DescribeTagsError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeTagsError {
fn from(err: CredentialsError) -> DescribeTagsError {
DescribeTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeTagsError {
fn from(err: HttpDispatchError) -> DescribeTagsError {
DescribeTagsError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeTagsError {
fn description(&self) -> &str {
match *self {
DescribeTagsError::DirectConnectClient(ref cause) => cause,
DescribeTagsError::DirectConnectServer(ref cause) => cause,
DescribeTagsError::Validation(ref cause) => cause,
DescribeTagsError::Credentials(ref err) => err.description(),
DescribeTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeTagsError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeVirtualGatewaysError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeVirtualGatewaysError {
pub fn from_body(body: &str) -> DescribeVirtualGatewaysError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeVirtualGatewaysError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeVirtualGatewaysError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeVirtualGatewaysError::Validation(error_message.to_string()),
_ => DescribeVirtualGatewaysError::Unknown(String::from(body))
}
},
Err(_) => DescribeVirtualGatewaysError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeVirtualGatewaysError {
fn from(err: serde_json::error::Error) -> DescribeVirtualGatewaysError {
DescribeVirtualGatewaysError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeVirtualGatewaysError {
fn from(err: CredentialsError) -> DescribeVirtualGatewaysError {
DescribeVirtualGatewaysError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeVirtualGatewaysError {
fn from(err: HttpDispatchError) -> DescribeVirtualGatewaysError {
DescribeVirtualGatewaysError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeVirtualGatewaysError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeVirtualGatewaysError {
fn description(&self) -> &str {
match *self {
DescribeVirtualGatewaysError::DirectConnectClient(ref cause) => cause,
DescribeVirtualGatewaysError::DirectConnectServer(ref cause) => cause,
DescribeVirtualGatewaysError::Validation(ref cause) => cause,
DescribeVirtualGatewaysError::Credentials(ref err) => err.description(),
DescribeVirtualGatewaysError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeVirtualGatewaysError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeVirtualInterfacesError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl DescribeVirtualInterfacesError {
pub fn from_body(body: &str) -> DescribeVirtualInterfacesError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => DescribeVirtualInterfacesError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => DescribeVirtualInterfacesError::DirectConnectServer(String::from(error_message)),
"ValidationException" => DescribeVirtualInterfacesError::Validation(error_message.to_string()),
_ => DescribeVirtualInterfacesError::Unknown(String::from(body))
}
},
Err(_) => DescribeVirtualInterfacesError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for DescribeVirtualInterfacesError {
fn from(err: serde_json::error::Error) -> DescribeVirtualInterfacesError {
DescribeVirtualInterfacesError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeVirtualInterfacesError {
fn from(err: CredentialsError) -> DescribeVirtualInterfacesError {
DescribeVirtualInterfacesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeVirtualInterfacesError {
fn from(err: HttpDispatchError) -> DescribeVirtualInterfacesError {
DescribeVirtualInterfacesError::HttpDispatch(err)
}
}
impl fmt::Display for DescribeVirtualInterfacesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeVirtualInterfacesError {
fn description(&self) -> &str {
match *self {
DescribeVirtualInterfacesError::DirectConnectClient(ref cause) => cause,
DescribeVirtualInterfacesError::DirectConnectServer(ref cause) => cause,
DescribeVirtualInterfacesError::Validation(ref cause) => cause,
DescribeVirtualInterfacesError::Credentials(ref err) => err.description(),
DescribeVirtualInterfacesError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeVirtualInterfacesError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
DirectConnectClient(String),
DirectConnectServer(String),
DuplicateTagKeys(String),
TooManyTags(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl TagResourceError {
pub fn from_body(body: &str) -> TagResourceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => TagResourceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => TagResourceError::DirectConnectServer(String::from(error_message)),
"DuplicateTagKeysException" => TagResourceError::DuplicateTagKeys(String::from(error_message)),
"TooManyTagsException" => TagResourceError::TooManyTags(String::from(error_message)),
"ValidationException" => TagResourceError::Validation(error_message.to_string()),
_ => TagResourceError::Unknown(String::from(body))
}
},
Err(_) => TagResourceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for TagResourceError {
fn from(err: serde_json::error::Error) -> TagResourceError {
TagResourceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for TagResourceError {
fn from(err: CredentialsError) -> TagResourceError {
TagResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for TagResourceError {
fn from(err: HttpDispatchError) -> TagResourceError {
TagResourceError::HttpDispatch(err)
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::DirectConnectClient(ref cause) => cause,
TagResourceError::DirectConnectServer(ref cause) => cause,
TagResourceError::DuplicateTagKeys(ref cause) => cause,
TagResourceError::TooManyTags(ref cause) => cause,
TagResourceError::Validation(ref cause) => cause,
TagResourceError::Credentials(ref err) => err.description(),
TagResourceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
TagResourceError::Unknown(ref cause) => cause
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
DirectConnectClient(String),
DirectConnectServer(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
Unknown(String)
}
impl UntagResourceError {
pub fn from_body(body: &str) -> UntagResourceError {
match from_str::<SerdeJsonValue>(body) {
Ok(json) => {
let raw_error_type = json.get("__type").and_then(|e| e.as_str()).unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or(body);
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"DirectConnectClientException" => UntagResourceError::DirectConnectClient(String::from(error_message)),
"DirectConnectServerException" => UntagResourceError::DirectConnectServer(String::from(error_message)),
"ValidationException" => UntagResourceError::Validation(error_message.to_string()),
_ => UntagResourceError::Unknown(String::from(body))
}
},
Err(_) => UntagResourceError::Unknown(String::from(body))
}
}
}
impl From<serde_json::error::Error> for UntagResourceError {
fn from(err: serde_json::error::Error) -> UntagResourceError {
UntagResourceError::Unknown(err.description().to_string())
}
}
impl From<CredentialsError> for UntagResourceError {
fn from(err: CredentialsError) -> UntagResourceError {
UntagResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for UntagResourceError {
fn from(err: HttpDispatchError) -> UntagResourceError {
UntagResourceError::HttpDispatch(err)
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::DirectConnectClient(ref cause) => cause,
UntagResourceError::DirectConnectServer(ref cause) => cause,
UntagResourceError::Validation(ref cause) => cause,
UntagResourceError::Credentials(ref err) => err.description(),
UntagResourceError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UntagResourceError::Unknown(ref cause) => cause
}
}
}
pub trait DirectConnect {
#[doc="<p>Creates a hosted connection on an interconnect.</p> <p>Allocates a VLAN number and a specified amount of bandwidth for use by a hosted connection on the given interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn allocate_connection_on_interconnect(&self, input: &AllocateConnectionOnInterconnectRequest) -> Result<Connection, AllocateConnectionOnInterconnectError>;
#[doc="<p>Provisions a private virtual interface to be owned by a different customer.</p> <p>The owner of a connection calls this function to provision a private virtual interface which will be owned by another AWS customer.</p> <p>Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</p>"]
fn allocate_private_virtual_interface(&self, input: &AllocatePrivateVirtualInterfaceRequest) -> Result<VirtualInterface, AllocatePrivateVirtualInterfaceError>;
#[doc="<p>Provisions a public virtual interface to be owned by a different customer.</p> <p>The owner of a connection calls this function to provision a public virtual interface which will be owned by another AWS customer.</p> <p>Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPublicVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</p> <p>When creating an IPv6 public virtual interface (addressFamily is 'ipv6'), the customer and amazon address fields should be left blank to use auto-assigned IPv6 space. Custom IPv6 Addresses are currently not supported.</p>"]
fn allocate_public_virtual_interface(&self, input: &AllocatePublicVirtualInterfaceRequest) -> Result<VirtualInterface, AllocatePublicVirtualInterfaceError>;
#[doc="<p>Confirm the creation of a hosted connection on an interconnect.</p> <p>Upon creation, the hosted connection is initially in the 'Ordering' state, and will remain in this state until the owner calls ConfirmConnection to confirm creation of the hosted connection.</p>"]
fn confirm_connection(&self, input: &ConfirmConnectionRequest) -> Result<ConfirmConnectionResponse, ConfirmConnectionError>;
#[doc="<p>Accept ownership of a private virtual interface created by another customer.</p> <p>After the virtual interface owner calls this function, the virtual interface will be created and attached to the given virtual private gateway, and will be available for handling traffic.</p>"]
fn confirm_private_virtual_interface(&self, input: &ConfirmPrivateVirtualInterfaceRequest) -> Result<ConfirmPrivateVirtualInterfaceResponse, ConfirmPrivateVirtualInterfaceError>;
#[doc="<p>Accept ownership of a public virtual interface created by another customer.</p> <p>After the virtual interface owner calls this function, the specified virtual interface will be created and made available for handling traffic.</p>"]
fn confirm_public_virtual_interface(&self, input: &ConfirmPublicVirtualInterfaceRequest) -> Result<ConfirmPublicVirtualInterfaceResponse, ConfirmPublicVirtualInterfaceError>;
#[doc="<p>Creates a new BGP peer on a specified virtual interface. The BGP peer cannot be in the same address family (IPv4/IPv6) of an existing BGP peer on the virtual interface.</p> <p>You must create a BGP peer for the corresponding address family in order to access AWS resources that also use that address family.</p> <p>When creating a IPv6 BGP peer, the Amazon address and customer address fields must be left blank. IPv6 addresses are automatically assigned from Amazon's pool of IPv6 addresses; you cannot specify custom IPv6 addresses.</p> <p>For a public virtual interface, the Autonomous System Number (ASN) must be private or already whitelisted for the virtual interface.</p>"]
fn create_bgp_peer(&self, input: &CreateBGPPeerRequest) -> Result<CreateBGPPeerResponse, CreateBGPPeerError>;
#[doc="<p>Creates a new connection between the customer network and a specific AWS Direct Connect location.</p> <p>A connection links your internal network to an AWS Direct Connect location over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end of the cable is connected to your router, the other to an AWS Direct Connect router. An AWS Direct Connect location provides access to Amazon Web Services in the region it is associated with. You can establish connections with AWS Direct Connect locations in multiple regions, but a connection in one region does not provide connectivity to other regions.</p>"]
fn create_connection(&self, input: &CreateConnectionRequest) -> Result<Connection, CreateConnectionError>;
#[doc="<p>Creates a new interconnect between a AWS Direct Connect partner's network and a specific AWS Direct Connect location.</p> <p>An interconnect is a connection which is capable of hosting other connections. The AWS Direct Connect partner can use an interconnect to provide sub-1Gbps AWS Direct Connect service to tier 2 customers who do not have their own connections. Like a standard connection, an interconnect links the AWS Direct Connect partner's network to an AWS Direct Connect location over a standard 1 Gbps or 10 Gbps Ethernet fiber-optic cable. One end is connected to the partner's router, the other to an AWS Direct Connect router.</p> <p>For each end customer, the AWS Direct Connect partner provisions a connection on their interconnect by calling AllocateConnectionOnInterconnect. The end customer can then connect to AWS resources by creating a virtual interface on their connection, using the VLAN assigned to them by the AWS Direct Connect partner.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn create_interconnect(&self, input: &CreateInterconnectRequest) -> Result<Interconnect, CreateInterconnectError>;
#[doc="<p>Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private virtual interface supports sending traffic to a single virtual private cloud (VPC).</p>"]
fn create_private_virtual_interface(&self, input: &CreatePrivateVirtualInterfaceRequest) -> Result<VirtualInterface, CreatePrivateVirtualInterfaceError>;
#[doc="<p>Creates a new public virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A public virtual interface supports sending traffic to public services of AWS such as Amazon Simple Storage Service (Amazon S3).</p> <p>When creating an IPv6 public virtual interface (addressFamily is 'ipv6'), the customer and amazon address fields should be left blank to use auto-assigned IPv6 space. Custom IPv6 Addresses are currently not supported.</p>"]
fn create_public_virtual_interface(&self, input: &CreatePublicVirtualInterfaceRequest) -> Result<VirtualInterface, CreatePublicVirtualInterfaceError>;
#[doc="<p>Deletes a BGP peer on the specified virtual interface that matches the specified customer address and ASN. You cannot delete the last BGP peer from a virtual interface.</p>"]
fn delete_bgp_peer(&self, input: &DeleteBGPPeerRequest) -> Result<DeleteBGPPeerResponse, DeleteBGPPeerError>;
#[doc="<p>Deletes the connection.</p> <p>Deleting a connection only stops the AWS Direct Connect port hour and data transfer charges. You need to cancel separately with the providers any services or charges for cross-connects or network circuits that connect you to the AWS Direct Connect location.</p>"]
fn delete_connection(&self, input: &DeleteConnectionRequest) -> Result<Connection, DeleteConnectionError>;
#[doc="<p>Deletes the specified interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn delete_interconnect(&self, input: &DeleteInterconnectRequest) -> Result<DeleteInterconnectResponse, DeleteInterconnectError>;
#[doc="<p>Deletes a virtual interface.</p>"]
fn delete_virtual_interface(&self, input: &DeleteVirtualInterfaceRequest) -> Result<DeleteVirtualInterfaceResponse, DeleteVirtualInterfaceError>;
#[doc="<p>Returns the LOA-CFA for a Connection.</p> <p>The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that your APN partner or service provider uses when establishing your cross connect to AWS at the colocation facility. For more information, see <a href=\"http://docs.aws.amazon.com/directconnect/latest/UserGuide/Colocation.html\">Requesting Cross Connects at AWS Direct Connect Locations</a> in the AWS Direct Connect user guide.</p>"]
fn describe_connection_loa(&self, input: &DescribeConnectionLoaRequest) -> Result<DescribeConnectionLoaResponse, DescribeConnectionLoaError>;
#[doc="<p>Displays all connections in this region.</p> <p>If a connection ID is provided, the call returns only that particular connection.</p>"]
fn describe_connections(&self, input: &DescribeConnectionsRequest) -> Result<Connections, DescribeConnectionsError>;
#[doc="<p>Return a list of connections that have been provisioned on the given interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn describe_connections_on_interconnect(&self, input: &DescribeConnectionsOnInterconnectRequest) -> Result<Connections, DescribeConnectionsOnInterconnectError>;
#[doc="<p>Returns the LOA-CFA for an Interconnect.</p> <p>The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that is used when establishing your cross connect to AWS at the colocation facility. For more information, see <a href=\"http://docs.aws.amazon.com/directconnect/latest/UserGuide/Colocation.html\">Requesting Cross Connects at AWS Direct Connect Locations</a> in the AWS Direct Connect user guide.</p>"]
fn describe_interconnect_loa(&self, input: &DescribeInterconnectLoaRequest) -> Result<DescribeInterconnectLoaResponse, DescribeInterconnectLoaError>;
#[doc="<p>Returns a list of interconnects owned by the AWS account.</p> <p>If an interconnect ID is provided, it will only return this particular interconnect.</p>"]
fn describe_interconnects(&self, input: &DescribeInterconnectsRequest) -> Result<Interconnects, DescribeInterconnectsError>;
#[doc="<p>Returns the list of AWS Direct Connect locations in the current AWS region. These are the locations that may be selected when calling CreateConnection or CreateInterconnect.</p>"]
fn describe_locations(&self) -> Result<Locations, DescribeLocationsError>;
#[doc="<p>Describes the tags associated with the specified Direct Connect resources.</p>"]
fn describe_tags(&self, input: &DescribeTagsRequest) -> Result<DescribeTagsResponse, DescribeTagsError>;
#[doc="<p>Returns a list of virtual private gateways owned by the AWS account.</p> <p>You can create one or more AWS Direct Connect private virtual interfaces linking to a virtual private gateway. A virtual private gateway can be managed via Amazon Virtual Private Cloud (VPC) console or the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVpnGateway.html\">EC2 CreateVpnGateway</a> action.</p>"]
fn describe_virtual_gateways(&self) -> Result<VirtualGateways, DescribeVirtualGatewaysError>;
#[doc="<p>Displays all virtual interfaces for an AWS account. Virtual interfaces deleted fewer than 15 minutes before DescribeVirtualInterfaces is called are also returned. If a connection ID is included then only virtual interfaces associated with this connection will be returned. If a virtual interface ID is included then only a single virtual interface will be returned.</p> <p>A virtual interface (VLAN) transmits the traffic between the AWS Direct Connect location and the customer.</p> <p>If a connection ID is provided, only virtual interfaces provisioned on the specified connection will be returned. If a virtual interface ID is provided, only this particular virtual interface will be returned.</p>"]
fn describe_virtual_interfaces(&self, input: &DescribeVirtualInterfacesRequest) -> Result<VirtualInterfaces, DescribeVirtualInterfacesError>;
#[doc="<p>Adds the specified tags to the specified Direct Connect resource. Each Direct Connect resource can have a maximum of 50 tags.</p> <p>Each tag consists of a key and an optional value. If a tag with the same key is already associated with the Direct Connect resource, this action updates its value.</p>"]
fn tag_resource(&self, input: &TagResourceRequest) -> Result<TagResourceResponse, TagResourceError>;
#[doc="<p>Removes one or more tags from the specified Direct Connect resource.</p>"]
fn untag_resource(&self, input: &UntagResourceRequest) -> Result<UntagResourceResponse, UntagResourceError>;
}
pub struct DirectConnectClient<P, D> where P: ProvideAwsCredentials, D: DispatchSignedRequest {
credentials_provider: P,
region: region::Region,
dispatcher: D,
}
impl<P, D> DirectConnectClient<P, D> where P: ProvideAwsCredentials, D: DispatchSignedRequest {
pub fn new(request_dispatcher: D, credentials_provider: P, region: region::Region) -> Self {
DirectConnectClient {
credentials_provider: credentials_provider,
region: region,
dispatcher: request_dispatcher
}
}
}
impl<P, D> DirectConnect for DirectConnectClient<P, D> where P: ProvideAwsCredentials, D: DispatchSignedRequest {
#[doc="<p>Creates a hosted connection on an interconnect.</p> <p>Allocates a VLAN number and a specified amount of bandwidth for use by a hosted connection on the given interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn allocate_connection_on_interconnect(&self, input: &AllocateConnectionOnInterconnectRequest) -> Result<Connection, AllocateConnectionOnInterconnectError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.AllocateConnectionOnInterconnect");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Connection>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(AllocateConnectionOnInterconnectError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Provisions a private virtual interface to be owned by a different customer.</p> <p>The owner of a connection calls this function to provision a private virtual interface which will be owned by another AWS customer.</p> <p>Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPrivateVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</p>"]
fn allocate_private_virtual_interface(&self, input: &AllocatePrivateVirtualInterfaceRequest) -> Result<VirtualInterface, AllocatePrivateVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.AllocatePrivateVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualInterface>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(AllocatePrivateVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Provisions a public virtual interface to be owned by a different customer.</p> <p>The owner of a connection calls this function to provision a public virtual interface which will be owned by another AWS customer.</p> <p>Virtual interfaces created using this function must be confirmed by the virtual interface owner by calling ConfirmPublicVirtualInterface. Until this step has been completed, the virtual interface will be in 'Confirming' state, and will not be available for handling traffic.</p> <p>When creating an IPv6 public virtual interface (addressFamily is 'ipv6'), the customer and amazon address fields should be left blank to use auto-assigned IPv6 space. Custom IPv6 Addresses are currently not supported.</p>"]
fn allocate_public_virtual_interface(&self, input: &AllocatePublicVirtualInterfaceRequest) -> Result<VirtualInterface, AllocatePublicVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.AllocatePublicVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualInterface>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(AllocatePublicVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Confirm the creation of a hosted connection on an interconnect.</p> <p>Upon creation, the hosted connection is initially in the 'Ordering' state, and will remain in this state until the owner calls ConfirmConnection to confirm creation of the hosted connection.</p>"]
fn confirm_connection(&self, input: &ConfirmConnectionRequest) -> Result<ConfirmConnectionResponse, ConfirmConnectionError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.ConfirmConnection");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<ConfirmConnectionResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(ConfirmConnectionError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Accept ownership of a private virtual interface created by another customer.</p> <p>After the virtual interface owner calls this function, the virtual interface will be created and attached to the given virtual private gateway, and will be available for handling traffic.</p>"]
fn confirm_private_virtual_interface(&self, input: &ConfirmPrivateVirtualInterfaceRequest) -> Result<ConfirmPrivateVirtualInterfaceResponse, ConfirmPrivateVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.ConfirmPrivateVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<ConfirmPrivateVirtualInterfaceResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(ConfirmPrivateVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Accept ownership of a public virtual interface created by another customer.</p> <p>After the virtual interface owner calls this function, the specified virtual interface will be created and made available for handling traffic.</p>"]
fn confirm_public_virtual_interface(&self, input: &ConfirmPublicVirtualInterfaceRequest) -> Result<ConfirmPublicVirtualInterfaceResponse, ConfirmPublicVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.ConfirmPublicVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<ConfirmPublicVirtualInterfaceResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(ConfirmPublicVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Creates a new BGP peer on a specified virtual interface. The BGP peer cannot be in the same address family (IPv4/IPv6) of an existing BGP peer on the virtual interface.</p> <p>You must create a BGP peer for the corresponding address family in order to access AWS resources that also use that address family.</p> <p>When creating a IPv6 BGP peer, the Amazon address and customer address fields must be left blank. IPv6 addresses are automatically assigned from Amazon's pool of IPv6 addresses; you cannot specify custom IPv6 addresses.</p> <p>For a public virtual interface, the Autonomous System Number (ASN) must be private or already whitelisted for the virtual interface.</p>"]
fn create_bgp_peer(&self, input: &CreateBGPPeerRequest) -> Result<CreateBGPPeerResponse, CreateBGPPeerError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.CreateBGPPeer");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<CreateBGPPeerResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(CreateBGPPeerError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Creates a new connection between the customer network and a specific AWS Direct Connect location.</p> <p>A connection links your internal network to an AWS Direct Connect location over a standard 1 gigabit or 10 gigabit Ethernet fiber-optic cable. One end of the cable is connected to your router, the other to an AWS Direct Connect router. An AWS Direct Connect location provides access to Amazon Web Services in the region it is associated with. You can establish connections with AWS Direct Connect locations in multiple regions, but a connection in one region does not provide connectivity to other regions.</p>"]
fn create_connection(&self, input: &CreateConnectionRequest) -> Result<Connection, CreateConnectionError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.CreateConnection");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Connection>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(CreateConnectionError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Creates a new interconnect between a AWS Direct Connect partner's network and a specific AWS Direct Connect location.</p> <p>An interconnect is a connection which is capable of hosting other connections. The AWS Direct Connect partner can use an interconnect to provide sub-1Gbps AWS Direct Connect service to tier 2 customers who do not have their own connections. Like a standard connection, an interconnect links the AWS Direct Connect partner's network to an AWS Direct Connect location over a standard 1 Gbps or 10 Gbps Ethernet fiber-optic cable. One end is connected to the partner's router, the other to an AWS Direct Connect router.</p> <p>For each end customer, the AWS Direct Connect partner provisions a connection on their interconnect by calling AllocateConnectionOnInterconnect. The end customer can then connect to AWS resources by creating a virtual interface on their connection, using the VLAN assigned to them by the AWS Direct Connect partner.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn create_interconnect(&self, input: &CreateInterconnectRequest) -> Result<Interconnect, CreateInterconnectError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.CreateInterconnect");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Interconnect>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(CreateInterconnectError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Creates a new private virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A private virtual interface supports sending traffic to a single virtual private cloud (VPC).</p>"]
fn create_private_virtual_interface(&self, input: &CreatePrivateVirtualInterfaceRequest) -> Result<VirtualInterface, CreatePrivateVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.CreatePrivateVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualInterface>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(CreatePrivateVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Creates a new public virtual interface. A virtual interface is the VLAN that transports AWS Direct Connect traffic. A public virtual interface supports sending traffic to public services of AWS such as Amazon Simple Storage Service (Amazon S3).</p> <p>When creating an IPv6 public virtual interface (addressFamily is 'ipv6'), the customer and amazon address fields should be left blank to use auto-assigned IPv6 space. Custom IPv6 Addresses are currently not supported.</p>"]
fn create_public_virtual_interface(&self, input: &CreatePublicVirtualInterfaceRequest) -> Result<VirtualInterface, CreatePublicVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.CreatePublicVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualInterface>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(CreatePublicVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Deletes a BGP peer on the specified virtual interface that matches the specified customer address and ASN. You cannot delete the last BGP peer from a virtual interface.</p>"]
fn delete_bgp_peer(&self, input: &DeleteBGPPeerRequest) -> Result<DeleteBGPPeerResponse, DeleteBGPPeerError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DeleteBGPPeer");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DeleteBGPPeerResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DeleteBGPPeerError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Deletes the connection.</p> <p>Deleting a connection only stops the AWS Direct Connect port hour and data transfer charges. You need to cancel separately with the providers any services or charges for cross-connects or network circuits that connect you to the AWS Direct Connect location.</p>"]
fn delete_connection(&self, input: &DeleteConnectionRequest) -> Result<Connection, DeleteConnectionError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DeleteConnection");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Connection>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DeleteConnectionError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Deletes the specified interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn delete_interconnect(&self, input: &DeleteInterconnectRequest) -> Result<DeleteInterconnectResponse, DeleteInterconnectError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DeleteInterconnect");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DeleteInterconnectResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DeleteInterconnectError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Deletes a virtual interface.</p>"]
fn delete_virtual_interface(&self, input: &DeleteVirtualInterfaceRequest) -> Result<DeleteVirtualInterfaceResponse, DeleteVirtualInterfaceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DeleteVirtualInterface");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DeleteVirtualInterfaceResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DeleteVirtualInterfaceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Returns the LOA-CFA for a Connection.</p> <p>The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that your APN partner or service provider uses when establishing your cross connect to AWS at the colocation facility. For more information, see <a href=\"http://docs.aws.amazon.com/directconnect/latest/UserGuide/Colocation.html\">Requesting Cross Connects at AWS Direct Connect Locations</a> in the AWS Direct Connect user guide.</p>"]
fn describe_connection_loa(&self, input: &DescribeConnectionLoaRequest) -> Result<DescribeConnectionLoaResponse, DescribeConnectionLoaError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeConnectionLoa");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DescribeConnectionLoaResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeConnectionLoaError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Displays all connections in this region.</p> <p>If a connection ID is provided, the call returns only that particular connection.</p>"]
fn describe_connections(&self, input: &DescribeConnectionsRequest) -> Result<Connections, DescribeConnectionsError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeConnections");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Connections>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeConnectionsError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Return a list of connections that have been provisioned on the given interconnect.</p> <note> <p>This is intended for use by AWS Direct Connect partners only.</p> </note>"]
fn describe_connections_on_interconnect(&self, input: &DescribeConnectionsOnInterconnectRequest) -> Result<Connections, DescribeConnectionsOnInterconnectError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeConnectionsOnInterconnect");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Connections>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeConnectionsOnInterconnectError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Returns the LOA-CFA for an Interconnect.</p> <p>The Letter of Authorization - Connecting Facility Assignment (LOA-CFA) is a document that is used when establishing your cross connect to AWS at the colocation facility. For more information, see <a href=\"http://docs.aws.amazon.com/directconnect/latest/UserGuide/Colocation.html\">Requesting Cross Connects at AWS Direct Connect Locations</a> in the AWS Direct Connect user guide.</p>"]
fn describe_interconnect_loa(&self, input: &DescribeInterconnectLoaRequest) -> Result<DescribeInterconnectLoaResponse, DescribeInterconnectLoaError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeInterconnectLoa");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DescribeInterconnectLoaResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeInterconnectLoaError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Returns a list of interconnects owned by the AWS account.</p> <p>If an interconnect ID is provided, it will only return this particular interconnect.</p>"]
fn describe_interconnects(&self, input: &DescribeInterconnectsRequest) -> Result<Interconnects, DescribeInterconnectsError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeInterconnects");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Interconnects>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeInterconnectsError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Returns the list of AWS Direct Connect locations in the current AWS region. These are the locations that may be selected when calling CreateConnection or CreateInterconnect.</p>"]
fn describe_locations(&self) -> Result<Locations, DescribeLocationsError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeLocations");
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<Locations>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeLocationsError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Describes the tags associated with the specified Direct Connect resources.</p>"]
fn describe_tags(&self, input: &DescribeTagsRequest) -> Result<DescribeTagsResponse, DescribeTagsError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeTags");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<DescribeTagsResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeTagsError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Returns a list of virtual private gateways owned by the AWS account.</p> <p>You can create one or more AWS Direct Connect private virtual interfaces linking to a virtual private gateway. A virtual private gateway can be managed via Amazon Virtual Private Cloud (VPC) console or the <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-CreateVpnGateway.html\">EC2 CreateVpnGateway</a> action.</p>"]
fn describe_virtual_gateways(&self) -> Result<VirtualGateways, DescribeVirtualGatewaysError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeVirtualGateways");
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualGateways>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeVirtualGatewaysError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Displays all virtual interfaces for an AWS account. Virtual interfaces deleted fewer than 15 minutes before DescribeVirtualInterfaces is called are also returned. If a connection ID is included then only virtual interfaces associated with this connection will be returned. If a virtual interface ID is included then only a single virtual interface will be returned.</p> <p>A virtual interface (VLAN) transmits the traffic between the AWS Direct Connect location and the customer.</p> <p>If a connection ID is provided, only virtual interfaces provisioned on the specified connection will be returned. If a virtual interface ID is provided, only this particular virtual interface will be returned.</p>"]
fn describe_virtual_interfaces(&self, input: &DescribeVirtualInterfacesRequest) -> Result<VirtualInterfaces, DescribeVirtualInterfacesError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.DescribeVirtualInterfaces");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<VirtualInterfaces>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(DescribeVirtualInterfacesError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Adds the specified tags to the specified Direct Connect resource. Each Direct Connect resource can have a maximum of 50 tags.</p> <p>Each tag consists of a key and an optional value. If a tag with the same key is already associated with the Direct Connect resource, this action updates its value.</p>"]
fn tag_resource(&self, input: &TagResourceRequest) -> Result<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.TagResource");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<TagResourceResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(TagResourceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
#[doc="<p>Removes one or more tags from the specified Direct Connect resource.</p>"]
fn untag_resource(&self, input: &UntagResourceRequest) -> Result<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "directconnect", self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "OvertureService.UntagResource");
let encoded = serde_json::to_string(input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
request.sign(&try!(self.credentials_provider.credentials()));
let response = try!(self.dispatcher.dispatch(&request));
match response.status {
StatusCode::Ok => {
Ok(serde_json::from_str::<UntagResourceResponse>(String::from_utf8_lossy(&response.body).as_ref()).unwrap())
}
_ => Err(UntagResourceError::from_body(String::from_utf8_lossy(&response.body).as_ref())),
}
}
}
#[cfg(test)]
mod protocol_tests {
}