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
// =================================================================
//
//                           * WARNING *
//
//                    This file is generated!
//
//  Changes made to this file will be overwritten. If changes are
//  required to the generated code, the service_crategen project
//  must be updated to generate the changes.
//
// =================================================================

use std::error::Error;
use std::fmt;

use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};

use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

impl BudgetsClient {
    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
        let mut request = SignedRequest::new(http_method, "budgets", &self.region, request_uri);

        request.set_content_type("application/x-amz-json-1.1".to_owned());

        request
    }

    async fn sign_and_dispatch<E>(
        &self,
        request: SignedRequest,
        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
    ) -> Result<HttpResponse, RusotoError<E>> {
        let mut response = self.client.sign_and_dispatch(request).await?;
        if !response.status.is_success() {
            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
            return Err(from_response(response));
        }

        Ok(response)
    }
}

use serde_json;
/// <p> A budget action resource. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Action {
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    /// <p> The trigger threshold of the action. </p>
    #[serde(rename = "ActionThreshold")]
    pub action_threshold: ActionThreshold,
    /// <p> The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. </p>
    #[serde(rename = "ActionType")]
    pub action_type: String,
    /// <p> This specifies if the action needs manual or automatic approval. </p>
    #[serde(rename = "ApprovalModel")]
    pub approval_model: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p> Where you specify all of the type-specific parameters. </p>
    #[serde(rename = "Definition")]
    pub definition: Definition,
    /// <p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>
    #[serde(rename = "ExecutionRoleArn")]
    pub execution_role_arn: String,
    #[serde(rename = "NotificationType")]
    pub notification_type: String,
    /// <p> The status of action. </p>
    #[serde(rename = "Status")]
    pub status: String,
    #[serde(rename = "Subscribers")]
    pub subscribers: Vec<Subscriber>,
}

/// <p> The historical records for a budget action. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ActionHistory {
    /// <p> The description of details of the event. </p>
    #[serde(rename = "ActionHistoryDetails")]
    pub action_history_details: ActionHistoryDetails,
    /// <p> This distinguishes between whether the events are triggered by the user or generated by the system. </p>
    #[serde(rename = "EventType")]
    pub event_type: String,
    /// <p> The status of action at the time of the event. </p>
    #[serde(rename = "Status")]
    pub status: String,
    #[serde(rename = "Timestamp")]
    pub timestamp: f64,
}

/// <p> The description of details of the event. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ActionHistoryDetails {
    /// <p> The budget action resource. </p>
    #[serde(rename = "Action")]
    pub action: Action,
    #[serde(rename = "Message")]
    pub message: String,
}

/// <p> The trigger threshold of the action. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ActionThreshold {
    #[serde(rename = "ActionThresholdType")]
    pub action_threshold_type: String,
    #[serde(rename = "ActionThresholdValue")]
    pub action_threshold_value: f64,
}

/// <p>Represents the output of the <code>CreateBudget</code> operation. The content consists of the detailed metadata and data file information, and the current status of the <code>budget</code> object.</p> <p>This is the ARN pattern for a budget: </p> <p> <code>arn:aws:budgets::AccountId:budget/budgetName</code> </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Budget {
    /// <p>The total amount of cost, usage, RI utilization, RI coverage, Savings Plans utilization, or Savings Plans coverage that you want to track with your budget.</p> <p> <code>BudgetLimit</code> is required for cost or usage budgets, but optional for RI or Savings Plans utilization or coverage budgets. RI and Savings Plans utilization or coverage budgets default to <code>100</code>, which is the only valid value for RI or Savings Plans utilization or coverage budgets. You can't use <code>BudgetLimit</code> with <code>PlannedBudgetLimits</code> for <code>CreateBudget</code> and <code>UpdateBudget</code> actions. </p>
    #[serde(rename = "BudgetLimit")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget_limit: Option<Spend>,
    /// <p>The name of a budget. The name must be unique within an account. The <code>:</code> and <code>&bsol;</code> characters aren't allowed in <code>BudgetName</code>.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>Whether this budget tracks costs, usage, RI utilization, RI coverage, Savings Plans utilization, or Savings Plans coverage.</p>
    #[serde(rename = "BudgetType")]
    pub budget_type: String,
    /// <p>The actual and forecasted cost or usage that the budget tracks.</p>
    #[serde(rename = "CalculatedSpend")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub calculated_spend: Option<CalculatedSpend>,
    /// <p><p>The cost filters, such as service or tag, that are applied to a budget.</p> <p>AWS Budgets supports the following services as a filter for RI budgets:</p> <ul> <li> <p>Amazon Elastic Compute Cloud - Compute</p> </li> <li> <p>Amazon Redshift</p> </li> <li> <p>Amazon Relational Database Service</p> </li> <li> <p>Amazon ElastiCache</p> </li> <li> <p>Amazon Elasticsearch Service</p> </li> </ul></p>
    #[serde(rename = "CostFilters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost_filters: Option<::std::collections::HashMap<String, Vec<String>>>,
    /// <p>The types of costs that are included in this <code>COST</code> budget.</p> <p> <code>USAGE</code>, <code>RI_UTILIZATION</code>, <code>RI_COVERAGE</code>, <code>SAVINGS_PLANS_UTILIZATION</code>, and <code>SAVINGS_PLANS_COVERAGE</code> budgets do not have <code>CostTypes</code>.</p>
    #[serde(rename = "CostTypes")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost_types: Option<CostTypes>,
    /// <p>The last time that you updated this budget.</p>
    #[serde(rename = "LastUpdatedTime")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_updated_time: Option<f64>,
    /// <p>A map containing multiple <code>BudgetLimit</code>, including current or future limits.</p> <p> <code>PlannedBudgetLimits</code> is available for cost or usage budget and supports monthly and quarterly <code>TimeUnit</code>. </p> <p>For monthly budgets, provide 12 months of <code>PlannedBudgetLimits</code> values. This must start from the current month and include the next 11 months. The <code>key</code> is the start of the month, <code>UTC</code> in epoch seconds. </p> <p>For quarterly budgets, provide 4 quarters of <code>PlannedBudgetLimits</code> value entries in standard calendar quarter increments. This must start from the current quarter and include the next 3 quarters. The <code>key</code> is the start of the quarter, <code>UTC</code> in epoch seconds. </p> <p>If the planned budget expires before 12 months for monthly or 4 quarters for quarterly, provide the <code>PlannedBudgetLimits</code> values only for the remaining periods.</p> <p>If the budget begins at a date in the future, provide <code>PlannedBudgetLimits</code> values from the start date of the budget. </p> <p>After all of the <code>BudgetLimit</code> values in <code>PlannedBudgetLimits</code> are used, the budget continues to use the last limit as the <code>BudgetLimit</code>. At that point, the planned budget provides the same experience as a fixed budget. </p> <p> <code>DescribeBudget</code> and <code>DescribeBudgets</code> response along with <code>PlannedBudgetLimits</code> will also contain <code>BudgetLimit</code> representing the current month or quarter limit present in <code>PlannedBudgetLimits</code>. This only applies to budgets created with <code>PlannedBudgetLimits</code>. Budgets created without <code>PlannedBudgetLimits</code> will only contain <code>BudgetLimit</code>, and no <code>PlannedBudgetLimits</code>.</p>
    #[serde(rename = "PlannedBudgetLimits")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub planned_budget_limits: Option<::std::collections::HashMap<String, Spend>>,
    /// <p>The period of time that is covered by a budget. The period has a start date and an end date. The start date must come before the end date. The end date must come before <code>06/15/87 00:00 UTC</code>. </p> <p>If you create your budget and don't specify a start date, AWS defaults to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and didn't set a start date, AWS set your start date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>, AWS set your start date to <code>01/01/18 00:00 UTC</code>. If you didn't specify an end date, AWS set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are the same for the AWS Billing and Cost Management console and the API. </p> <p>You can change either date with the <code>UpdateBudget</code> operation.</p> <p>After the end date, AWS deletes the budget and all associated notifications and subscribers.</p>
    #[serde(rename = "TimePeriod")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_period: Option<TimePeriod>,
    /// <p>The length of time until a budget resets the actual and forecasted spend.</p>
    #[serde(rename = "TimeUnit")]
    pub time_unit: String,
}

/// <p>A history of the state of a budget at the end of the budget's specified time period.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BudgetPerformanceHistory {
    #[serde(rename = "BudgetName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget_name: Option<String>,
    #[serde(rename = "BudgetType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget_type: Option<String>,
    /// <p>A list of amounts of cost or usage that you created budgets for, compared to your actual costs or usage.</p>
    #[serde(rename = "BudgetedAndActualAmountsList")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budgeted_and_actual_amounts_list: Option<Vec<BudgetedAndActualAmounts>>,
    /// <p>The history of the cost filters for a budget during the specified time period.</p>
    #[serde(rename = "CostFilters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost_filters: Option<::std::collections::HashMap<String, Vec<String>>>,
    /// <p>The history of the cost types for a budget during the specified time period.</p>
    #[serde(rename = "CostTypes")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cost_types: Option<CostTypes>,
    #[serde(rename = "TimeUnit")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_unit: Option<String>,
}

/// <p>The amount of cost or usage that you created the budget for, compared to your actual costs or usage.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct BudgetedAndActualAmounts {
    /// <p>Your actual costs or usage for a budget period.</p>
    #[serde(rename = "ActualAmount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub actual_amount: Option<Spend>,
    /// <p>The amount of cost or usage that you created the budget for.</p>
    #[serde(rename = "BudgetedAmount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budgeted_amount: Option<Spend>,
    /// <p>The time period covered by this budget comparison.</p>
    #[serde(rename = "TimePeriod")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_period: Option<TimePeriod>,
}

/// <p>The spend objects that are associated with this budget. The <code>actualSpend</code> tracks how much you've used, cost, usage, RI units, or Savings Plans units and the <code>forecastedSpend</code> tracks how much you are predicted to spend based on your historical usage profile.</p> <p>For example, if it is the 20th of the month and you have spent <code>50</code> dollars on Amazon EC2, your <code>actualSpend</code> is <code>50 USD</code>, and your <code>forecastedSpend</code> is <code>75 USD</code>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CalculatedSpend {
    /// <p>The amount of cost, usage, RI units, or Savings Plans units that you have used.</p>
    #[serde(rename = "ActualSpend")]
    pub actual_spend: Spend,
    /// <p>The amount of cost, usage, RI units, or Savings Plans units that you are forecasted to use.</p>
    #[serde(rename = "ForecastedSpend")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub forecasted_spend: Option<Spend>,
}

/// <p>The types of cost that are included in a <code>COST</code> budget, such as tax and subscriptions.</p> <p> <code>USAGE</code>, <code>RI_UTILIZATION</code>, <code>RI_COVERAGE</code>, <code>SAVINGS_PLANS_UTILIZATION</code>, and <code>SAVINGS_PLANS_COVERAGE</code> budgets do not have <code>CostTypes</code>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CostTypes {
    /// <p>Specifies whether a budget includes credits.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeCredit")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_credit: Option<bool>,
    /// <p>Specifies whether a budget includes discounts.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeDiscount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_discount: Option<bool>,
    /// <p>Specifies whether a budget includes non-RI subscription costs.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeOtherSubscription")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_other_subscription: Option<bool>,
    /// <p>Specifies whether a budget includes recurring fees such as monthly RI fees.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeRecurring")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_recurring: Option<bool>,
    /// <p>Specifies whether a budget includes refunds.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeRefund")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_refund: Option<bool>,
    /// <p>Specifies whether a budget includes subscriptions.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeSubscription")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_subscription: Option<bool>,
    /// <p>Specifies whether a budget includes support subscription fees.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeSupport")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_support: Option<bool>,
    /// <p>Specifies whether a budget includes taxes.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeTax")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_tax: Option<bool>,
    /// <p>Specifies whether a budget includes upfront RI costs.</p> <p>The default value is <code>true</code>.</p>
    #[serde(rename = "IncludeUpfront")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_upfront: Option<bool>,
    /// <p>Specifies whether a budget uses the amortized rate.</p> <p>The default value is <code>false</code>.</p>
    #[serde(rename = "UseAmortized")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub use_amortized: Option<bool>,
    /// <p>Specifies whether a budget uses a blended rate.</p> <p>The default value is <code>false</code>.</p>
    #[serde(rename = "UseBlended")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub use_blended: Option<bool>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateBudgetActionRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "ActionThreshold")]
    pub action_threshold: ActionThreshold,
    /// <p> The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition. </p>
    #[serde(rename = "ActionType")]
    pub action_type: String,
    /// <p> This specifies if the action needs manual or automatic approval. </p>
    #[serde(rename = "ApprovalModel")]
    pub approval_model: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    #[serde(rename = "Definition")]
    pub definition: Definition,
    /// <p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>
    #[serde(rename = "ExecutionRoleArn")]
    pub execution_role_arn: String,
    #[serde(rename = "NotificationType")]
    pub notification_type: String,
    #[serde(rename = "Subscribers")]
    pub subscribers: Vec<Subscriber>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateBudgetActionResponse {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

/// <p> Request of CreateBudget </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateBudgetRequest {
    /// <p>The <code>accountId</code> that is associated with the budget.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The budget object that you want to create.</p>
    #[serde(rename = "Budget")]
    pub budget: Budget,
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, AWS creates the notifications and subscribers for you.</p>
    #[serde(rename = "NotificationsWithSubscribers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub notifications_with_subscribers: Option<Vec<NotificationWithSubscribers>>,
}

/// <p> Response of CreateBudget </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateBudgetResponse {}

/// <p> Request of CreateNotification </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateNotificationRequest {
    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a notification for.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget that you want AWS to notify you about. Budget names must be unique within an account.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The notification that you want to create.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
    /// <p>A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.</p>
    #[serde(rename = "Subscribers")]
    pub subscribers: Vec<Subscriber>,
}

/// <p> Response of CreateNotification </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateNotificationResponse {}

/// <p> Request of CreateSubscriber </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateSubscriberRequest {
    /// <p>The <code>accountId</code> that is associated with the budget that you want to create a subscriber for.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget that you want to subscribe to. Budget names must be unique within an account.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The notification that you want to create a subscriber for.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
    /// <p>The subscriber that you want to associate with a budget notification.</p>
    #[serde(rename = "Subscriber")]
    pub subscriber: Subscriber,
}

/// <p> Response of CreateSubscriber </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateSubscriberResponse {}

/// <p> Specifies all of the type-specific parameters. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Definition {
    /// <p> The AWS Identity and Access Management (IAM) action definition details. </p>
    #[serde(rename = "IamActionDefinition")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub iam_action_definition: Option<IamActionDefinition>,
    /// <p> The service control policies (SCPs) action definition details. </p>
    #[serde(rename = "ScpActionDefinition")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub scp_action_definition: Option<ScpActionDefinition>,
    /// <p> The AWS Systems Manager (SSM) action definition details. </p>
    #[serde(rename = "SsmActionDefinition")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ssm_action_definition: Option<SsmActionDefinition>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteBudgetActionRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteBudgetActionResponse {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "Action")]
    pub action: Action,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

/// <p> Request of DeleteBudget </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteBudgetRequest {
    /// <p>The <code>accountId</code> that is associated with the budget that you want to delete.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget that you want to delete.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

/// <p> Response of DeleteBudget </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteBudgetResponse {}

/// <p> Request of DeleteNotification </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteNotificationRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to delete.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose notification you want to delete.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The notification that you want to delete.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
}

/// <p> Response of DeleteNotification </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteNotificationResponse {}

/// <p> Request of DeleteSubscriber </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteSubscriberRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose subscriber you want to delete.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose subscriber you want to delete.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The notification whose subscriber you want to delete.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
    /// <p>The subscriber that you want to delete.</p>
    #[serde(rename = "Subscriber")]
    pub subscriber: Subscriber,
}

/// <p> Response of DeleteSubscriber </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteSubscriberResponse {}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetActionHistoriesRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    #[serde(rename = "TimePeriod")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_period: Option<TimePeriod>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetActionHistoriesResponse {
    /// <p> The historical record of the budget action resource. </p>
    #[serde(rename = "ActionHistories")]
    pub action_histories: Vec<ActionHistory>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetActionRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetActionResponse {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A budget action resource. </p>
    #[serde(rename = "Action")]
    pub action: Action,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetActionsForAccountRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetActionsForAccountResponse {
    /// <p> A list of the budget action resources information. </p>
    #[serde(rename = "Actions")]
    pub actions: Vec<Action>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetActionsForBudgetRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetActionsForBudgetResponse {
    /// <p> A list of the budget action resources information. </p>
    #[serde(rename = "Actions")]
    pub actions: Vec<Action>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetPerformanceHistoryRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>Retrieves how often the budget went into an <code>ALARM</code> state for the specified time period.</p>
    #[serde(rename = "TimePeriod")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub time_period: Option<TimePeriod>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetPerformanceHistoryResponse {
    /// <p>The history of how often the budget has gone into an <code>ALARM</code> state.</p> <p>For <code>DAILY</code> budgets, the history saves the state of the budget for the last 60 days. For <code>MONTHLY</code> budgets, the history saves the state of the budget for the current month plus the last 12 months. For <code>QUARTERLY</code> budgets, the history saves the state of the budget for the last four quarters.</p>
    #[serde(rename = "BudgetPerformanceHistory")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget_performance_history: Option<BudgetPerformanceHistory>,
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

/// <p> Request of DescribeBudget </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetRequest {
    /// <p>The <code>accountId</code> that is associated with the budget that you want a description of.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget that you want a description of.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
}

/// <p> Response of DescribeBudget </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetResponse {
    /// <p>The description of the budget.</p>
    #[serde(rename = "Budget")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget: Option<Budget>,
}

/// <p> Request of DescribeBudgets </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeBudgetsRequest {
    /// <p>The <code>accountId</code> that is associated with the budgets that you want descriptions of.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

/// <p> Response of DescribeBudgets </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeBudgetsResponse {
    /// <p>A list of budgets.</p>
    #[serde(rename = "Budgets")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub budgets: Option<Vec<Budget>>,
    /// <p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

/// <p> Request of DescribeNotificationsForBudget </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeNotificationsForBudgetRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose notifications you want descriptions of.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose notifications you want descriptions of.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
}

/// <p> Response of GetNotificationsForBudget </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeNotificationsForBudgetResponse {
    /// <p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>A list of notifications that are associated with a budget.</p>
    #[serde(rename = "Notifications")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub notifications: Option<Vec<Notification>>,
}

/// <p> Request of DescribeSubscribersForNotification </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeSubscribersForNotificationRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose subscribers you want descriptions of.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose subscribers you want descriptions of.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>An optional integer that represents how many entries a paginated response contains. The maximum is 100.</p>
    #[serde(rename = "MaxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The pagination token that you include in your request to indicate the next set of results that you want to retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>The notification whose subscribers you want to list.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
}

/// <p> Response of DescribeSubscribersForNotification </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeSubscribersForNotificationResponse {
    /// <p>The pagination token in the service response that indicates the next set of results that you can retrieve.</p>
    #[serde(rename = "NextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>A list of subscribers that are associated with a notification.</p>
    #[serde(rename = "Subscribers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subscribers: Option<Vec<Subscriber>>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExecuteBudgetActionRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p> The type of execution. </p>
    #[serde(rename = "ExecutionType")]
    pub execution_type: String,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExecuteBudgetActionResponse {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p> The type of execution. </p>
    #[serde(rename = "ExecutionType")]
    pub execution_type: String,
}

/// <p> The AWS Identity and Access Management (IAM) action definition details. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct IamActionDefinition {
    /// <p> A list of groups to be attached. There must be at least one group. </p>
    #[serde(rename = "Groups")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub groups: Option<Vec<String>>,
    /// <p> The Amazon Resource Name (ARN) of the policy to be attached. </p>
    #[serde(rename = "PolicyArn")]
    pub policy_arn: String,
    /// <p> A list of roles to be attached. There must be at least one role. </p>
    #[serde(rename = "Roles")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub roles: Option<Vec<String>>,
    /// <p> A list of users to be attached. There must be at least one user. </p>
    #[serde(rename = "Users")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub users: Option<Vec<String>>,
}

/// <p><p>A notification that is associated with a budget. A budget can have up to ten notifications. </p> <p>Each notification must have at least one subscriber. A notification can have one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.</p> <p>For example, if you have a budget for 200 dollars and you want to be notified when you go over 160 dollars, create a notification with the following parameters:</p> <ul> <li> <p>A notificationType of <code>ACTUAL</code> </p> </li> <li> <p>A <code>thresholdType</code> of <code>PERCENTAGE</code> </p> </li> <li> <p>A <code>comparisonOperator</code> of <code>GREATER_THAN</code> </p> </li> <li> <p>A notification <code>threshold</code> of <code>80</code> </p> </li> </ul></p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Notification {
    /// <p>The comparison that is used for this notification.</p>
    #[serde(rename = "ComparisonOperator")]
    pub comparison_operator: String,
    /// <p>Whether this notification is in alarm. If a budget notification is in the <code>ALARM</code> state, you have passed the set threshold for the budget.</p>
    #[serde(rename = "NotificationState")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub notification_state: Option<String>,
    /// <p>Whether the notification is for how much you have spent (<code>ACTUAL</code>) or for how much you're forecasted to spend (<code>FORECASTED</code>).</p>
    #[serde(rename = "NotificationType")]
    pub notification_type: String,
    /// <p>The threshold that is associated with a notification. Thresholds are always a percentage, and many customers find value being alerted between 50% - 200% of the budgeted amount. The maximum limit for your threshold is 1,000,000% above the budgeted amount.</p>
    #[serde(rename = "Threshold")]
    pub threshold: f64,
    /// <p>The type of threshold for a notification. For <code>ABSOLUTE_VALUE</code> thresholds, AWS notifies you when you go over or are forecasted to go over your total cost threshold. For <code>PERCENTAGE</code> thresholds, AWS notifies you when you go over or are forecasted to go over a certain percentage of your forecasted spend. For example, if you have a budget for 200 dollars and you have a <code>PERCENTAGE</code> threshold of 80%, AWS notifies you when you go over 160 dollars.</p>
    #[serde(rename = "ThresholdType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub threshold_type: Option<String>,
}

/// <p>A notification with subscribers. A notification can have one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct NotificationWithSubscribers {
    /// <p>The notification that is associated with a budget.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
    /// <p>A list of subscribers who are subscribed to this notification.</p>
    #[serde(rename = "Subscribers")]
    pub subscribers: Vec<Subscriber>,
}

/// <p> The service control policies (SCP) action definition details. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ScpActionDefinition {
    /// <p> The policy ID attached. </p>
    #[serde(rename = "PolicyId")]
    pub policy_id: String,
    /// <p> A list of target IDs. </p>
    #[serde(rename = "TargetIds")]
    pub target_ids: Vec<String>,
}

/// <p><p>The amount of cost or usage that is measured for a budget.</p> <p>For example, a <code>Spend</code> for <code>3 GB</code> of S3 usage would have the following parameters:</p> <ul> <li> <p>An <code>Amount</code> of <code>3</code> </p> </li> <li> <p>A <code>unit</code> of <code>GB</code> </p> </li> </ul></p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Spend {
    /// <p>The cost or usage amount that is associated with a budget forecast, actual spend, or budget threshold.</p>
    #[serde(rename = "Amount")]
    pub amount: String,
    /// <p>The unit of measurement that is used for the budget forecast, actual spend, or budget threshold, such as dollars or GB.</p>
    #[serde(rename = "Unit")]
    pub unit: String,
}

/// <p> The AWS Systems Manager (SSM) action definition details. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct SsmActionDefinition {
    /// <p> The action subType. </p>
    #[serde(rename = "ActionSubType")]
    pub action_sub_type: String,
    /// <p> The EC2 and RDS instance IDs. </p>
    #[serde(rename = "InstanceIds")]
    pub instance_ids: Vec<String>,
    /// <p> The Region to run the SSM document. </p>
    #[serde(rename = "Region")]
    pub region: String,
}

/// <p><p>The subscriber to a budget notification. The subscriber consists of a subscription type and either an Amazon SNS topic or an email address.</p> <p>For example, an email subscriber would have the following parameters:</p> <ul> <li> <p>A <code>subscriptionType</code> of <code>EMAIL</code> </p> </li> <li> <p>An <code>address</code> of <code>example@example.com</code> </p> </li> </ul></p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Subscriber {
    /// <p>The address that AWS sends budget notifications to, either an SNS topic or an email.</p> <p>When you create a subscriber, the value of <code>Address</code> can't contain line breaks.</p>
    #[serde(rename = "Address")]
    pub address: String,
    /// <p>The type of notification that AWS sends to a subscriber.</p>
    #[serde(rename = "SubscriptionType")]
    pub subscription_type: String,
}

/// <p>The period of time that is covered by a budget. The period has a start date and an end date. The start date must come before the end date. There are no restrictions on the end date. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct TimePeriod {
    /// <p>The end date for a budget. If you didn't specify an end date, AWS set your end date to <code>06/15/87 00:00 UTC</code>. The defaults are the same for the AWS Billing and Cost Management console and the API.</p> <p>After the end date, AWS deletes the budget and all associated notifications and subscribers. You can change your end date with the <code>UpdateBudget</code> operation.</p>
    #[serde(rename = "End")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub end: Option<f64>,
    /// <p>The start date for a budget. If you created your budget and didn't specify a start date, AWS defaults to the start of your chosen time period (DAILY, MONTHLY, QUARTERLY, or ANNUALLY). For example, if you created your budget on January 24, 2018, chose <code>DAILY</code>, and didn't set a start date, AWS set your start date to <code>01/24/18 00:00 UTC</code>. If you chose <code>MONTHLY</code>, AWS set your start date to <code>01/01/18 00:00 UTC</code>. The defaults are the same for the AWS Billing and Cost Management console and the API.</p> <p>You can change your start date with the <code>UpdateBudget</code> operation.</p>
    #[serde(rename = "Start")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub start: Option<f64>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateBudgetActionRequest {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p> A system-generated universally unique identifier (UUID) for the action. </p>
    #[serde(rename = "ActionId")]
    pub action_id: String,
    #[serde(rename = "ActionThreshold")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub action_threshold: Option<ActionThreshold>,
    /// <p> This specifies if the action needs manual or automatic approval. </p>
    #[serde(rename = "ApprovalModel")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub approval_model: Option<String>,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    #[serde(rename = "Definition")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub definition: Option<Definition>,
    /// <p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>
    #[serde(rename = "ExecutionRoleArn")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub execution_role_arn: Option<String>,
    #[serde(rename = "NotificationType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub notification_type: Option<String>,
    #[serde(rename = "Subscribers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub subscribers: Option<Vec<Subscriber>>,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateBudgetActionResponse {
    #[serde(rename = "AccountId")]
    pub account_id: String,
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p> The updated action resource information. </p>
    #[serde(rename = "NewAction")]
    pub new_action: Action,
    /// <p> The previous action resource information. </p>
    #[serde(rename = "OldAction")]
    pub old_action: Action,
}

/// <p> Request of UpdateBudget </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateBudgetRequest {
    /// <p>The <code>accountId</code> that is associated with the budget that you want to update.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The budget that you want to update your budget to.</p>
    #[serde(rename = "NewBudget")]
    pub new_budget: Budget,
}

/// <p> Response of UpdateBudget </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateBudgetResponse {}

/// <p> Request of UpdateNotification </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateNotificationRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose notification you want to update.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose notification you want to update.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The updated notification to be associated with a budget.</p>
    #[serde(rename = "NewNotification")]
    pub new_notification: Notification,
    /// <p>The previous notification that is associated with a budget.</p>
    #[serde(rename = "OldNotification")]
    pub old_notification: Notification,
}

/// <p> Response of UpdateNotification </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateNotificationResponse {}

/// <p> Request of UpdateSubscriber </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateSubscriberRequest {
    /// <p>The <code>accountId</code> that is associated with the budget whose subscriber you want to update.</p>
    #[serde(rename = "AccountId")]
    pub account_id: String,
    /// <p>The name of the budget whose subscriber you want to update.</p>
    #[serde(rename = "BudgetName")]
    pub budget_name: String,
    /// <p>The updated subscriber that is associated with a budget notification.</p>
    #[serde(rename = "NewSubscriber")]
    pub new_subscriber: Subscriber,
    /// <p>The notification whose subscriber you want to update.</p>
    #[serde(rename = "Notification")]
    pub notification: Notification,
    /// <p>The previous subscriber that is associated with a budget notification.</p>
    #[serde(rename = "OldSubscriber")]
    pub old_subscriber: Subscriber,
}

/// <p> Response of UpdateSubscriber </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateSubscriberResponse {}

/// Errors returned by CreateBudget
#[derive(Debug, PartialEq)]
pub enum CreateBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>You've exceeded the notification or subscriber limit.</p>
    CreationLimitExceeded(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
}

impl CreateBudgetError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(CreateBudgetError::AccessDenied(err.msg))
                }
                "CreationLimitExceededException" => {
                    return RusotoError::Service(CreateBudgetError::CreationLimitExceeded(err.msg))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(CreateBudgetError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(CreateBudgetError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(CreateBudgetError::InvalidParameter(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for CreateBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            CreateBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            CreateBudgetError::CreationLimitExceeded(ref cause) => write!(f, "{}", cause),
            CreateBudgetError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            CreateBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            CreateBudgetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for CreateBudgetError {}
/// Errors returned by CreateBudgetAction
#[derive(Debug, PartialEq)]
pub enum CreateBudgetActionError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>You've exceeded the notification or subscriber limit.</p>
    CreationLimitExceeded(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl CreateBudgetActionError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateBudgetActionError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(CreateBudgetActionError::AccessDenied(err.msg))
                }
                "CreationLimitExceededException" => {
                    return RusotoError::Service(CreateBudgetActionError::CreationLimitExceeded(
                        err.msg,
                    ))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(CreateBudgetActionError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(CreateBudgetActionError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(CreateBudgetActionError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(CreateBudgetActionError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for CreateBudgetActionError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            CreateBudgetActionError::AccessDenied(ref cause) => write!(f, "{}", cause),
            CreateBudgetActionError::CreationLimitExceeded(ref cause) => write!(f, "{}", cause),
            CreateBudgetActionError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            CreateBudgetActionError::InternalError(ref cause) => write!(f, "{}", cause),
            CreateBudgetActionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            CreateBudgetActionError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for CreateBudgetActionError {}
/// Errors returned by CreateNotification
#[derive(Debug, PartialEq)]
pub enum CreateNotificationError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>You've exceeded the notification or subscriber limit.</p>
    CreationLimitExceeded(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl CreateNotificationError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateNotificationError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(CreateNotificationError::AccessDenied(err.msg))
                }
                "CreationLimitExceededException" => {
                    return RusotoError::Service(CreateNotificationError::CreationLimitExceeded(
                        err.msg,
                    ))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(CreateNotificationError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(CreateNotificationError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(CreateNotificationError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(CreateNotificationError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for CreateNotificationError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            CreateNotificationError::AccessDenied(ref cause) => write!(f, "{}", cause),
            CreateNotificationError::CreationLimitExceeded(ref cause) => write!(f, "{}", cause),
            CreateNotificationError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            CreateNotificationError::InternalError(ref cause) => write!(f, "{}", cause),
            CreateNotificationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            CreateNotificationError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for CreateNotificationError {}
/// Errors returned by CreateSubscriber
#[derive(Debug, PartialEq)]
pub enum CreateSubscriberError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>You've exceeded the notification or subscriber limit.</p>
    CreationLimitExceeded(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl CreateSubscriberError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSubscriberError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(CreateSubscriberError::AccessDenied(err.msg))
                }
                "CreationLimitExceededException" => {
                    return RusotoError::Service(CreateSubscriberError::CreationLimitExceeded(
                        err.msg,
                    ))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(CreateSubscriberError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(CreateSubscriberError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(CreateSubscriberError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(CreateSubscriberError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for CreateSubscriberError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            CreateSubscriberError::AccessDenied(ref cause) => write!(f, "{}", cause),
            CreateSubscriberError::CreationLimitExceeded(ref cause) => write!(f, "{}", cause),
            CreateSubscriberError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            CreateSubscriberError::InternalError(ref cause) => write!(f, "{}", cause),
            CreateSubscriberError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            CreateSubscriberError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for CreateSubscriberError {}
/// Errors returned by DeleteBudget
#[derive(Debug, PartialEq)]
pub enum DeleteBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DeleteBudgetError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DeleteBudgetError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DeleteBudgetError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DeleteBudgetError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DeleteBudgetError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DeleteBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DeleteBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DeleteBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            DeleteBudgetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DeleteBudgetError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DeleteBudgetError {}
/// Errors returned by DeleteBudgetAction
#[derive(Debug, PartialEq)]
pub enum DeleteBudgetActionError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
    /// <p> The request was received and recognized by the server, but the server rejected that particular method for the requested resource. </p>
    ResourceLocked(String),
}

impl DeleteBudgetActionError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteBudgetActionError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DeleteBudgetActionError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DeleteBudgetActionError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DeleteBudgetActionError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DeleteBudgetActionError::NotFound(err.msg))
                }
                "ResourceLockedException" => {
                    return RusotoError::Service(DeleteBudgetActionError::ResourceLocked(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DeleteBudgetActionError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DeleteBudgetActionError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DeleteBudgetActionError::InternalError(ref cause) => write!(f, "{}", cause),
            DeleteBudgetActionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DeleteBudgetActionError::NotFound(ref cause) => write!(f, "{}", cause),
            DeleteBudgetActionError::ResourceLocked(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DeleteBudgetActionError {}
/// Errors returned by DeleteNotification
#[derive(Debug, PartialEq)]
pub enum DeleteNotificationError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DeleteNotificationError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteNotificationError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DeleteNotificationError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DeleteNotificationError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DeleteNotificationError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DeleteNotificationError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DeleteNotificationError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DeleteNotificationError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DeleteNotificationError::InternalError(ref cause) => write!(f, "{}", cause),
            DeleteNotificationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DeleteNotificationError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DeleteNotificationError {}
/// Errors returned by DeleteSubscriber
#[derive(Debug, PartialEq)]
pub enum DeleteSubscriberError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DeleteSubscriberError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSubscriberError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DeleteSubscriberError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DeleteSubscriberError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DeleteSubscriberError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DeleteSubscriberError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DeleteSubscriberError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DeleteSubscriberError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DeleteSubscriberError::InternalError(ref cause) => write!(f, "{}", cause),
            DeleteSubscriberError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DeleteSubscriberError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DeleteSubscriberError {}
/// Errors returned by DescribeBudget
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeBudgetError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DescribeBudgetError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DescribeBudgetError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeBudgetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DescribeBudgetError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetError {}
/// Errors returned by DescribeBudgetAction
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetActionError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetActionError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeBudgetActionError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeBudgetActionError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DescribeBudgetActionError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DescribeBudgetActionError::InvalidParameter(
                        err.msg,
                    ))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetActionError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetActionError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetActionError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetActionError {}
/// Errors returned by DescribeBudgetActionHistories
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetActionHistoriesError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetActionHistoriesError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeBudgetActionHistoriesError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeBudgetActionHistoriesError::AccessDenied(
                        err.msg,
                    ))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DescribeBudgetActionHistoriesError::InternalError(
                        err.msg,
                    ))
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionHistoriesError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionHistoriesError::InvalidParameter(err.msg),
                    )
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetActionHistoriesError::NotFound(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetActionHistoriesError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetActionHistoriesError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionHistoriesError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionHistoriesError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionHistoriesError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionHistoriesError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetActionHistoriesError {}
/// Errors returned by DescribeBudgetActionsForAccount
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetActionsForAccountError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
}

impl DescribeBudgetActionsForAccountError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeBudgetActionsForAccountError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForAccountError::AccessDenied(err.msg),
                    )
                }
                "InternalErrorException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForAccountError::InternalError(err.msg),
                    )
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForAccountError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForAccountError::InvalidParameter(err.msg),
                    )
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetActionsForAccountError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetActionsForAccountError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionsForAccountError::InternalError(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionsForAccountError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionsForAccountError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
        }
    }
}
impl Error for DescribeBudgetActionsForAccountError {}
/// Errors returned by DescribeBudgetActionsForBudget
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetActionsForBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetActionsForBudgetError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeBudgetActionsForBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeBudgetActionsForBudgetError::AccessDenied(
                        err.msg,
                    ))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForBudgetError::InternalError(err.msg),
                    )
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForBudgetError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeBudgetActionsForBudgetError::InvalidParameter(err.msg),
                    )
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetActionsForBudgetError::NotFound(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetActionsForBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetActionsForBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionsForBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeBudgetActionsForBudgetError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionsForBudgetError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetActionsForBudgetError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetActionsForBudgetError {}
/// Errors returned by DescribeBudgetPerformanceHistory
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetPerformanceHistoryError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The pagination token expired.</p>
    ExpiredNextToken(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetPerformanceHistoryError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeBudgetPerformanceHistoryError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        DescribeBudgetPerformanceHistoryError::AccessDenied(err.msg),
                    )
                }
                "ExpiredNextTokenException" => {
                    return RusotoError::Service(
                        DescribeBudgetPerformanceHistoryError::ExpiredNextToken(err.msg),
                    )
                }
                "InternalErrorException" => {
                    return RusotoError::Service(
                        DescribeBudgetPerformanceHistoryError::InternalError(err.msg),
                    )
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeBudgetPerformanceHistoryError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeBudgetPerformanceHistoryError::InvalidParameter(err.msg),
                    )
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetPerformanceHistoryError::NotFound(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetPerformanceHistoryError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetPerformanceHistoryError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetPerformanceHistoryError::ExpiredNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetPerformanceHistoryError::InternalError(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetPerformanceHistoryError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetPerformanceHistoryError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeBudgetPerformanceHistoryError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetPerformanceHistoryError {}
/// Errors returned by DescribeBudgets
#[derive(Debug, PartialEq)]
pub enum DescribeBudgetsError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The pagination token expired.</p>
    ExpiredNextToken(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeBudgetsError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeBudgetsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeBudgetsError::AccessDenied(err.msg))
                }
                "ExpiredNextTokenException" => {
                    return RusotoError::Service(DescribeBudgetsError::ExpiredNextToken(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(DescribeBudgetsError::InternalError(err.msg))
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(DescribeBudgetsError::InvalidNextToken(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(DescribeBudgetsError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeBudgetsError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeBudgetsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeBudgetsError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeBudgetsError::ExpiredNextToken(ref cause) => write!(f, "{}", cause),
            DescribeBudgetsError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeBudgetsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
            DescribeBudgetsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            DescribeBudgetsError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeBudgetsError {}
/// Errors returned by DescribeNotificationsForBudget
#[derive(Debug, PartialEq)]
pub enum DescribeNotificationsForBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The pagination token expired.</p>
    ExpiredNextToken(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeNotificationsForBudgetError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeNotificationsForBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(DescribeNotificationsForBudgetError::AccessDenied(
                        err.msg,
                    ))
                }
                "ExpiredNextTokenException" => {
                    return RusotoError::Service(
                        DescribeNotificationsForBudgetError::ExpiredNextToken(err.msg),
                    )
                }
                "InternalErrorException" => {
                    return RusotoError::Service(
                        DescribeNotificationsForBudgetError::InternalError(err.msg),
                    )
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeNotificationsForBudgetError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeNotificationsForBudgetError::InvalidParameter(err.msg),
                    )
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeNotificationsForBudgetError::NotFound(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeNotificationsForBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeNotificationsForBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            DescribeNotificationsForBudgetError::ExpiredNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeNotificationsForBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            DescribeNotificationsForBudgetError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeNotificationsForBudgetError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeNotificationsForBudgetError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeNotificationsForBudgetError {}
/// Errors returned by DescribeSubscribersForNotification
#[derive(Debug, PartialEq)]
pub enum DescribeSubscribersForNotificationError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The pagination token expired.</p>
    ExpiredNextToken(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>The pagination token is invalid.</p>
    InvalidNextToken(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl DescribeSubscribersForNotificationError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeSubscribersForNotificationError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        DescribeSubscribersForNotificationError::AccessDenied(err.msg),
                    )
                }
                "ExpiredNextTokenException" => {
                    return RusotoError::Service(
                        DescribeSubscribersForNotificationError::ExpiredNextToken(err.msg),
                    )
                }
                "InternalErrorException" => {
                    return RusotoError::Service(
                        DescribeSubscribersForNotificationError::InternalError(err.msg),
                    )
                }
                "InvalidNextTokenException" => {
                    return RusotoError::Service(
                        DescribeSubscribersForNotificationError::InvalidNextToken(err.msg),
                    )
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(
                        DescribeSubscribersForNotificationError::InvalidParameter(err.msg),
                    )
                }
                "NotFoundException" => {
                    return RusotoError::Service(DescribeSubscribersForNotificationError::NotFound(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeSubscribersForNotificationError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeSubscribersForNotificationError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeSubscribersForNotificationError::ExpiredNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeSubscribersForNotificationError::InternalError(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeSubscribersForNotificationError::InvalidNextToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeSubscribersForNotificationError::InvalidParameter(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeSubscribersForNotificationError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeSubscribersForNotificationError {}
/// Errors returned by ExecuteBudgetAction
#[derive(Debug, PartialEq)]
pub enum ExecuteBudgetActionError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
    /// <p> The request was received and recognized by the server, but the server rejected that particular method for the requested resource. </p>
    ResourceLocked(String),
}

impl ExecuteBudgetActionError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ExecuteBudgetActionError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(ExecuteBudgetActionError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(ExecuteBudgetActionError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(ExecuteBudgetActionError::InvalidParameter(
                        err.msg,
                    ))
                }
                "NotFoundException" => {
                    return RusotoError::Service(ExecuteBudgetActionError::NotFound(err.msg))
                }
                "ResourceLockedException" => {
                    return RusotoError::Service(ExecuteBudgetActionError::ResourceLocked(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for ExecuteBudgetActionError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            ExecuteBudgetActionError::AccessDenied(ref cause) => write!(f, "{}", cause),
            ExecuteBudgetActionError::InternalError(ref cause) => write!(f, "{}", cause),
            ExecuteBudgetActionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            ExecuteBudgetActionError::NotFound(ref cause) => write!(f, "{}", cause),
            ExecuteBudgetActionError::ResourceLocked(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for ExecuteBudgetActionError {}
/// Errors returned by UpdateBudget
#[derive(Debug, PartialEq)]
pub enum UpdateBudgetError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl UpdateBudgetError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateBudgetError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(UpdateBudgetError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(UpdateBudgetError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(UpdateBudgetError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(UpdateBudgetError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for UpdateBudgetError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            UpdateBudgetError::AccessDenied(ref cause) => write!(f, "{}", cause),
            UpdateBudgetError::InternalError(ref cause) => write!(f, "{}", cause),
            UpdateBudgetError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            UpdateBudgetError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for UpdateBudgetError {}
/// Errors returned by UpdateBudgetAction
#[derive(Debug, PartialEq)]
pub enum UpdateBudgetActionError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
    /// <p> The request was received and recognized by the server, but the server rejected that particular method for the requested resource. </p>
    ResourceLocked(String),
}

impl UpdateBudgetActionError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateBudgetActionError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(UpdateBudgetActionError::AccessDenied(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(UpdateBudgetActionError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(UpdateBudgetActionError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(UpdateBudgetActionError::NotFound(err.msg))
                }
                "ResourceLockedException" => {
                    return RusotoError::Service(UpdateBudgetActionError::ResourceLocked(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for UpdateBudgetActionError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            UpdateBudgetActionError::AccessDenied(ref cause) => write!(f, "{}", cause),
            UpdateBudgetActionError::InternalError(ref cause) => write!(f, "{}", cause),
            UpdateBudgetActionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            UpdateBudgetActionError::NotFound(ref cause) => write!(f, "{}", cause),
            UpdateBudgetActionError::ResourceLocked(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for UpdateBudgetActionError {}
/// Errors returned by UpdateNotification
#[derive(Debug, PartialEq)]
pub enum UpdateNotificationError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl UpdateNotificationError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateNotificationError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(UpdateNotificationError::AccessDenied(err.msg))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(UpdateNotificationError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(UpdateNotificationError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(UpdateNotificationError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(UpdateNotificationError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for UpdateNotificationError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            UpdateNotificationError::AccessDenied(ref cause) => write!(f, "{}", cause),
            UpdateNotificationError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            UpdateNotificationError::InternalError(ref cause) => write!(f, "{}", cause),
            UpdateNotificationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            UpdateNotificationError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for UpdateNotificationError {}
/// Errors returned by UpdateSubscriber
#[derive(Debug, PartialEq)]
pub enum UpdateSubscriberError {
    /// <p>You are not authorized to use this operation with the given parameters.</p>
    AccessDenied(String),
    /// <p>The budget name already exists. Budget names must be unique within an account.</p>
    DuplicateRecord(String),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalError(String),
    /// <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
    InvalidParameter(String),
    /// <p>We can’t locate the resource that you specified.</p>
    NotFound(String),
}

impl UpdateSubscriberError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateSubscriberError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(UpdateSubscriberError::AccessDenied(err.msg))
                }
                "DuplicateRecordException" => {
                    return RusotoError::Service(UpdateSubscriberError::DuplicateRecord(err.msg))
                }
                "InternalErrorException" => {
                    return RusotoError::Service(UpdateSubscriberError::InternalError(err.msg))
                }
                "InvalidParameterException" => {
                    return RusotoError::Service(UpdateSubscriberError::InvalidParameter(err.msg))
                }
                "NotFoundException" => {
                    return RusotoError::Service(UpdateSubscriberError::NotFound(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for UpdateSubscriberError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            UpdateSubscriberError::AccessDenied(ref cause) => write!(f, "{}", cause),
            UpdateSubscriberError::DuplicateRecord(ref cause) => write!(f, "{}", cause),
            UpdateSubscriberError::InternalError(ref cause) => write!(f, "{}", cause),
            UpdateSubscriberError::InvalidParameter(ref cause) => write!(f, "{}", cause),
            UpdateSubscriberError::NotFound(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for UpdateSubscriberError {}
/// Trait representing the capabilities of the AWSBudgets API. AWSBudgets clients implement this trait.
#[async_trait]
pub trait Budgets {
    /// <p><p>Creates a budget and, if included, notifications and subscribers. </p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_CreateBudget.html#API_CreateBudget_Examples">Examples</a> section. </p> </important></p>
    async fn create_budget(
        &self,
        input: CreateBudgetRequest,
    ) -> Result<CreateBudgetResponse, RusotoError<CreateBudgetError>>;

    /// <p> Creates a budget action. </p>
    async fn create_budget_action(
        &self,
        input: CreateBudgetActionRequest,
    ) -> Result<CreateBudgetActionResponse, RusotoError<CreateBudgetActionError>>;

    /// <p>Creates a notification. You must create the budget before you create the associated notification.</p>
    async fn create_notification(
        &self,
        input: CreateNotificationRequest,
    ) -> Result<CreateNotificationResponse, RusotoError<CreateNotificationError>>;

    /// <p>Creates a subscriber. You must create the associated budget and notification before you create the subscriber.</p>
    async fn create_subscriber(
        &self,
        input: CreateSubscriberRequest,
    ) -> Result<CreateSubscriberResponse, RusotoError<CreateSubscriberError>>;

    /// <p><p>Deletes a budget. You can delete your budget at any time.</p> <important> <p>Deleting a budget also deletes the notifications and subscribers that are associated with that budget.</p> </important></p>
    async fn delete_budget(
        &self,
        input: DeleteBudgetRequest,
    ) -> Result<DeleteBudgetResponse, RusotoError<DeleteBudgetError>>;

    /// <p> Deletes a budget action. </p>
    async fn delete_budget_action(
        &self,
        input: DeleteBudgetActionRequest,
    ) -> Result<DeleteBudgetActionResponse, RusotoError<DeleteBudgetActionError>>;

    /// <p><p>Deletes a notification.</p> <important> <p>Deleting a notification also deletes the subscribers that are associated with the notification.</p> </important></p>
    async fn delete_notification(
        &self,
        input: DeleteNotificationRequest,
    ) -> Result<DeleteNotificationResponse, RusotoError<DeleteNotificationError>>;

    /// <p><p>Deletes a subscriber.</p> <important> <p>Deleting the last subscriber to a notification also deletes the notification.</p> </important></p>
    async fn delete_subscriber(
        &self,
        input: DeleteSubscriberRequest,
    ) -> Result<DeleteSubscriberResponse, RusotoError<DeleteSubscriberError>>;

    /// <p><p>Describes a budget.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudget.html#API_DescribeBudget_Examples">Examples</a> section. </p> </important></p>
    async fn describe_budget(
        &self,
        input: DescribeBudgetRequest,
    ) -> Result<DescribeBudgetResponse, RusotoError<DescribeBudgetError>>;

    /// <p> Describes a budget action detail. </p>
    async fn describe_budget_action(
        &self,
        input: DescribeBudgetActionRequest,
    ) -> Result<DescribeBudgetActionResponse, RusotoError<DescribeBudgetActionError>>;

    /// <p> Describes a budget action history detail. </p>
    async fn describe_budget_action_histories(
        &self,
        input: DescribeBudgetActionHistoriesRequest,
    ) -> Result<
        DescribeBudgetActionHistoriesResponse,
        RusotoError<DescribeBudgetActionHistoriesError>,
    >;

    /// <p> Describes all of the budget actions for an account. </p>
    async fn describe_budget_actions_for_account(
        &self,
        input: DescribeBudgetActionsForAccountRequest,
    ) -> Result<
        DescribeBudgetActionsForAccountResponse,
        RusotoError<DescribeBudgetActionsForAccountError>,
    >;

    /// <p> Describes all of the budget actions for a budget. </p>
    async fn describe_budget_actions_for_budget(
        &self,
        input: DescribeBudgetActionsForBudgetRequest,
    ) -> Result<
        DescribeBudgetActionsForBudgetResponse,
        RusotoError<DescribeBudgetActionsForBudgetError>,
    >;

    /// <p>Describes the history for <code>DAILY</code>, <code>MONTHLY</code>, and <code>QUARTERLY</code> budgets. Budget history isn't available for <code>ANNUAL</code> budgets.</p>
    async fn describe_budget_performance_history(
        &self,
        input: DescribeBudgetPerformanceHistoryRequest,
    ) -> Result<
        DescribeBudgetPerformanceHistoryResponse,
        RusotoError<DescribeBudgetPerformanceHistoryError>,
    >;

    /// <p><p>Lists the budgets that are associated with an account.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudgets.html#API_DescribeBudgets_Examples">Examples</a> section. </p> </important></p>
    async fn describe_budgets(
        &self,
        input: DescribeBudgetsRequest,
    ) -> Result<DescribeBudgetsResponse, RusotoError<DescribeBudgetsError>>;

    /// <p>Lists the notifications that are associated with a budget.</p>
    async fn describe_notifications_for_budget(
        &self,
        input: DescribeNotificationsForBudgetRequest,
    ) -> Result<
        DescribeNotificationsForBudgetResponse,
        RusotoError<DescribeNotificationsForBudgetError>,
    >;

    /// <p>Lists the subscribers that are associated with a notification.</p>
    async fn describe_subscribers_for_notification(
        &self,
        input: DescribeSubscribersForNotificationRequest,
    ) -> Result<
        DescribeSubscribersForNotificationResponse,
        RusotoError<DescribeSubscribersForNotificationError>,
    >;

    /// <p> Executes a budget action. </p>
    async fn execute_budget_action(
        &self,
        input: ExecuteBudgetActionRequest,
    ) -> Result<ExecuteBudgetActionResponse, RusotoError<ExecuteBudgetActionError>>;

    /// <p><p>Updates a budget. You can change every part of a budget except for the <code>budgetName</code> and the <code>calculatedSpend</code>. When you modify a budget, the <code>calculatedSpend</code> drops to zero until AWS has new usage data to use for forecasting.</p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_UpdateBudget.html#API_UpdateBudget_Examples">Examples</a> section. </p> </important></p>
    async fn update_budget(
        &self,
        input: UpdateBudgetRequest,
    ) -> Result<UpdateBudgetResponse, RusotoError<UpdateBudgetError>>;

    /// <p> Updates a budget action. </p>
    async fn update_budget_action(
        &self,
        input: UpdateBudgetActionRequest,
    ) -> Result<UpdateBudgetActionResponse, RusotoError<UpdateBudgetActionError>>;

    /// <p>Updates a notification.</p>
    async fn update_notification(
        &self,
        input: UpdateNotificationRequest,
    ) -> Result<UpdateNotificationResponse, RusotoError<UpdateNotificationError>>;

    /// <p>Updates a subscriber.</p>
    async fn update_subscriber(
        &self,
        input: UpdateSubscriberRequest,
    ) -> Result<UpdateSubscriberResponse, RusotoError<UpdateSubscriberError>>;
}
/// A client for the AWSBudgets API.
#[derive(Clone)]
pub struct BudgetsClient {
    client: Client,
    region: region::Region,
}

impl BudgetsClient {
    /// Creates a client backed by the default tokio event loop.
    ///
    /// The client will use the default credentials provider and tls client.
    pub fn new(region: region::Region) -> BudgetsClient {
        BudgetsClient {
            client: Client::shared(),
            region,
        }
    }

    pub fn new_with<P, D>(
        request_dispatcher: D,
        credentials_provider: P,
        region: region::Region,
    ) -> BudgetsClient
    where
        P: ProvideAwsCredentials + Send + Sync + 'static,
        D: DispatchSignedRequest + Send + Sync + 'static,
    {
        BudgetsClient {
            client: Client::new_with(credentials_provider, request_dispatcher),
            region,
        }
    }

    pub fn new_with_client(client: Client, region: region::Region) -> BudgetsClient {
        BudgetsClient { client, region }
    }
}

#[async_trait]
impl Budgets for BudgetsClient {
    /// <p><p>Creates a budget and, if included, notifications and subscribers. </p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_CreateBudget.html#API_CreateBudget_Examples">Examples</a> section. </p> </important></p>
    async fn create_budget(
        &self,
        input: CreateBudgetRequest,
    ) -> Result<CreateBudgetResponse, RusotoError<CreateBudgetError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.CreateBudget");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, CreateBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<CreateBudgetResponse, _>()
    }

    /// <p> Creates a budget action. </p>
    async fn create_budget_action(
        &self,
        input: CreateBudgetActionRequest,
    ) -> Result<CreateBudgetActionResponse, RusotoError<CreateBudgetActionError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.CreateBudgetAction");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, CreateBudgetActionError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<CreateBudgetActionResponse, _>()
    }

    /// <p>Creates a notification. You must create the budget before you create the associated notification.</p>
    async fn create_notification(
        &self,
        input: CreateNotificationRequest,
    ) -> Result<CreateNotificationResponse, RusotoError<CreateNotificationError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.CreateNotification");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, CreateNotificationError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<CreateNotificationResponse, _>()
    }

    /// <p>Creates a subscriber. You must create the associated budget and notification before you create the subscriber.</p>
    async fn create_subscriber(
        &self,
        input: CreateSubscriberRequest,
    ) -> Result<CreateSubscriberResponse, RusotoError<CreateSubscriberError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.CreateSubscriber");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, CreateSubscriberError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<CreateSubscriberResponse, _>()
    }

    /// <p><p>Deletes a budget. You can delete your budget at any time.</p> <important> <p>Deleting a budget also deletes the notifications and subscribers that are associated with that budget.</p> </important></p>
    async fn delete_budget(
        &self,
        input: DeleteBudgetRequest,
    ) -> Result<DeleteBudgetResponse, RusotoError<DeleteBudgetError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DeleteBudget");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DeleteBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DeleteBudgetResponse, _>()
    }

    /// <p> Deletes a budget action. </p>
    async fn delete_budget_action(
        &self,
        input: DeleteBudgetActionRequest,
    ) -> Result<DeleteBudgetActionResponse, RusotoError<DeleteBudgetActionError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DeleteBudgetAction");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DeleteBudgetActionError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DeleteBudgetActionResponse, _>()
    }

    /// <p><p>Deletes a notification.</p> <important> <p>Deleting a notification also deletes the subscribers that are associated with the notification.</p> </important></p>
    async fn delete_notification(
        &self,
        input: DeleteNotificationRequest,
    ) -> Result<DeleteNotificationResponse, RusotoError<DeleteNotificationError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DeleteNotification");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DeleteNotificationError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DeleteNotificationResponse, _>()
    }

    /// <p><p>Deletes a subscriber.</p> <important> <p>Deleting the last subscriber to a notification also deletes the notification.</p> </important></p>
    async fn delete_subscriber(
        &self,
        input: DeleteSubscriberRequest,
    ) -> Result<DeleteSubscriberResponse, RusotoError<DeleteSubscriberError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DeleteSubscriber");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DeleteSubscriberError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DeleteSubscriberResponse, _>()
    }

    /// <p><p>Describes a budget.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudget.html#API_DescribeBudget_Examples">Examples</a> section. </p> </important></p>
    async fn describe_budget(
        &self,
        input: DescribeBudgetRequest,
    ) -> Result<DescribeBudgetResponse, RusotoError<DescribeBudgetError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DescribeBudget");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DescribeBudgetResponse, _>()
    }

    /// <p> Describes a budget action detail. </p>
    async fn describe_budget_action(
        &self,
        input: DescribeBudgetActionRequest,
    ) -> Result<DescribeBudgetActionResponse, RusotoError<DescribeBudgetActionError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeBudgetAction",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetActionError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeBudgetActionResponse, _>()
    }

    /// <p> Describes a budget action history detail. </p>
    async fn describe_budget_action_histories(
        &self,
        input: DescribeBudgetActionHistoriesRequest,
    ) -> Result<
        DescribeBudgetActionHistoriesResponse,
        RusotoError<DescribeBudgetActionHistoriesError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeBudgetActionHistories",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetActionHistoriesError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeBudgetActionHistoriesResponse, _>()
    }

    /// <p> Describes all of the budget actions for an account. </p>
    async fn describe_budget_actions_for_account(
        &self,
        input: DescribeBudgetActionsForAccountRequest,
    ) -> Result<
        DescribeBudgetActionsForAccountResponse,
        RusotoError<DescribeBudgetActionsForAccountError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeBudgetActionsForAccount",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetActionsForAccountError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeBudgetActionsForAccountResponse, _>()
    }

    /// <p> Describes all of the budget actions for a budget. </p>
    async fn describe_budget_actions_for_budget(
        &self,
        input: DescribeBudgetActionsForBudgetRequest,
    ) -> Result<
        DescribeBudgetActionsForBudgetResponse,
        RusotoError<DescribeBudgetActionsForBudgetError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeBudgetActionsForBudget",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetActionsForBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeBudgetActionsForBudgetResponse, _>()
    }

    /// <p>Describes the history for <code>DAILY</code>, <code>MONTHLY</code>, and <code>QUARTERLY</code> budgets. Budget history isn't available for <code>ANNUAL</code> budgets.</p>
    async fn describe_budget_performance_history(
        &self,
        input: DescribeBudgetPerformanceHistoryRequest,
    ) -> Result<
        DescribeBudgetPerformanceHistoryResponse,
        RusotoError<DescribeBudgetPerformanceHistoryError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeBudgetPerformanceHistory",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(
                request,
                DescribeBudgetPerformanceHistoryError::from_response,
            )
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeBudgetPerformanceHistoryResponse, _>()
    }

    /// <p><p>Lists the budgets that are associated with an account.</p> <important> <p>The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudgets.html#API_DescribeBudgets_Examples">Examples</a> section. </p> </important></p>
    async fn describe_budgets(
        &self,
        input: DescribeBudgetsRequest,
    ) -> Result<DescribeBudgetsResponse, RusotoError<DescribeBudgetsError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.DescribeBudgets");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeBudgetsError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<DescribeBudgetsResponse, _>()
    }

    /// <p>Lists the notifications that are associated with a budget.</p>
    async fn describe_notifications_for_budget(
        &self,
        input: DescribeNotificationsForBudgetRequest,
    ) -> Result<
        DescribeNotificationsForBudgetResponse,
        RusotoError<DescribeNotificationsForBudgetError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeNotificationsForBudget",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, DescribeNotificationsForBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeNotificationsForBudgetResponse, _>()
    }

    /// <p>Lists the subscribers that are associated with a notification.</p>
    async fn describe_subscribers_for_notification(
        &self,
        input: DescribeSubscribersForNotificationRequest,
    ) -> Result<
        DescribeSubscribersForNotificationResponse,
        RusotoError<DescribeSubscribersForNotificationError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.DescribeSubscribersForNotification",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(
                request,
                DescribeSubscribersForNotificationError::from_response,
            )
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response)
            .deserialize::<DescribeSubscribersForNotificationResponse, _>()
    }

    /// <p> Executes a budget action. </p>
    async fn execute_budget_action(
        &self,
        input: ExecuteBudgetActionRequest,
    ) -> Result<ExecuteBudgetActionResponse, RusotoError<ExecuteBudgetActionError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "AWSBudgetServiceGateway.ExecuteBudgetAction",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, ExecuteBudgetActionError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<ExecuteBudgetActionResponse, _>()
    }

    /// <p><p>Updates a budget. You can change every part of a budget except for the <code>budgetName</code> and the <code>calculatedSpend</code>. When you modify a budget, the <code>calculatedSpend</code> drops to zero until AWS has new usage data to use for forecasting.</p> <important> <p>Only one of <code>BudgetLimit</code> or <code>PlannedBudgetLimits</code> can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the <code>BudgetLimit</code> syntax. For <code>PlannedBudgetLimits</code>, see the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_UpdateBudget.html#API_UpdateBudget_Examples">Examples</a> section. </p> </important></p>
    async fn update_budget(
        &self,
        input: UpdateBudgetRequest,
    ) -> Result<UpdateBudgetResponse, RusotoError<UpdateBudgetError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.UpdateBudget");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, UpdateBudgetError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<UpdateBudgetResponse, _>()
    }

    /// <p> Updates a budget action. </p>
    async fn update_budget_action(
        &self,
        input: UpdateBudgetActionRequest,
    ) -> Result<UpdateBudgetActionResponse, RusotoError<UpdateBudgetActionError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.UpdateBudgetAction");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, UpdateBudgetActionError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<UpdateBudgetActionResponse, _>()
    }

    /// <p>Updates a notification.</p>
    async fn update_notification(
        &self,
        input: UpdateNotificationRequest,
    ) -> Result<UpdateNotificationResponse, RusotoError<UpdateNotificationError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.UpdateNotification");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, UpdateNotificationError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<UpdateNotificationResponse, _>()
    }

    /// <p>Updates a subscriber.</p>
    async fn update_subscriber(
        &self,
        input: UpdateSubscriberRequest,
    ) -> Result<UpdateSubscriberResponse, RusotoError<UpdateSubscriberError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header("x-amz-target", "AWSBudgetServiceGateway.UpdateSubscriber");
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

        let response = self
            .sign_and_dispatch(request, UpdateSubscriberError::from_response)
            .await?;
        let mut response = response;
        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
        proto::json::ResponsePayload::new(&response).deserialize::<UpdateSubscriberResponse, _>()
    }
}