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
// =================================================================
//
//                           * 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 ComputeOptimizerClient {
    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
        let mut request =
            SignedRequest::new(http_method, "compute-optimizer", &self.region, request_uri);

        request.set_content_type("application/x-amz-json-1.0".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>Describes the configuration of an Auto Scaling group.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AutoScalingGroupConfiguration {
    /// <p>The desired capacity, or number of instances, for the Auto Scaling group.</p>
    #[serde(rename = "desiredCapacity")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub desired_capacity: Option<i64>,
    /// <p>The instance type for the Auto Scaling group.</p>
    #[serde(rename = "instanceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_type: Option<String>,
    /// <p>The maximum size, or maximum number of instances, for the Auto Scaling group.</p>
    #[serde(rename = "maxSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_size: Option<i64>,
    /// <p>The minimum size, or minimum number of instances, for the Auto Scaling group.</p>
    #[serde(rename = "minSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub min_size: Option<i64>,
}

/// <p>Describes an Auto Scaling group recommendation.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AutoScalingGroupRecommendation {
    /// <p>The AWS account ID of the Auto Scaling group.</p>
    #[serde(rename = "accountId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// <p>The Amazon Resource Name (ARN) of the Auto Scaling group.</p>
    #[serde(rename = "autoScalingGroupArn")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_scaling_group_arn: Option<String>,
    /// <p>The name of the Auto Scaling group.</p>
    #[serde(rename = "autoScalingGroupName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_scaling_group_name: Option<String>,
    /// <p>An array of objects that describe the current configuration of the Auto Scaling group.</p>
    #[serde(rename = "currentConfiguration")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current_configuration: Option<AutoScalingGroupConfiguration>,
    /// <p><p>The finding classification for the Auto Scaling group.</p> <p>Findings for Auto Scaling groups include:</p> <ul> <li> <p> <b> <code>NotOptimized</code> </b>—An Auto Scaling group is considered not optimized when AWS Compute Optimizer identifies a recommendation that can provide better performance for your workload.</p> </li> <li> <p> <b> <code>Optimized</code> </b>—An Auto Scaling group is considered optimized when Compute Optimizer determines that the group is correctly provisioned to run your workload based on the chosen instance type. For optimized resources, Compute Optimizer might recommend a new generation instance type.</p> </li> </ul> <note> <p>The values that are returned might be <code>NOT_OPTIMIZED</code> or <code>OPTIMIZED</code>.</p> </note></p>
    #[serde(rename = "finding")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub finding: Option<String>,
    /// <p>The time stamp of when the Auto Scaling group recommendation was last refreshed.</p>
    #[serde(rename = "lastRefreshTimestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_refresh_timestamp: Option<f64>,
    /// <p>The number of days for which utilization metrics were analyzed for the Auto Scaling group.</p>
    #[serde(rename = "lookBackPeriodInDays")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_back_period_in_days: Option<f64>,
    /// <p>An array of objects that describe the recommendation options for the Auto Scaling group.</p>
    #[serde(rename = "recommendationOptions")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_options: Option<Vec<AutoScalingGroupRecommendationOption>>,
    /// <p>An array of objects that describe the utilization metrics of the Auto Scaling group.</p>
    #[serde(rename = "utilizationMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub utilization_metrics: Option<Vec<UtilizationMetric>>,
}

/// <p>Describes a recommendation option for an Auto Scaling group.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AutoScalingGroupRecommendationOption {
    /// <p>An array of objects that describe an Auto Scaling group configuration.</p>
    #[serde(rename = "configuration")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub configuration: Option<AutoScalingGroupConfiguration>,
    /// <p>The performance risk of the Auto Scaling group configuration recommendation.</p> <p>Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.</p> <p>The lowest performance risk is categorized as <code>0</code>, and the highest as <code>5</code>.</p>
    #[serde(rename = "performanceRisk")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub performance_risk: Option<f64>,
    /// <p>An array of objects that describe the projected utilization metrics of the Auto Scaling group recommendation option.</p>
    #[serde(rename = "projectedUtilizationMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub projected_utilization_metrics: Option<Vec<UtilizationMetric>>,
    /// <p>The rank of the Auto Scaling group recommendation option.</p> <p>The top recommendation option is ranked as <code>1</code>.</p>
    #[serde(rename = "rank")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rank: Option<i64>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeRecommendationExportJobsRequest {
    /// <p>An array of objects that describe a filter to return a more specific list of export jobs.</p>
    #[serde(rename = "filters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<JobFilter>>,
    /// <p>The identification numbers of the export jobs to return.</p> <p>An export job ID is returned when you create an export using the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions.</p> <p>All export jobs created in the last seven days are returned if this parameter is omitted.</p>
    #[serde(rename = "jobIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub job_ids: Option<Vec<String>>,
    /// <p>The maximum number of export jobs to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
    #[serde(rename = "maxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The token to advance to the next page of export jobs.</p>
    #[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 DescribeRecommendationExportJobsResponse {
    /// <p>The token to use to advance to the next page of export jobs.</p> <p>This value is null when there are no more pages of export jobs to return.</p>
    #[serde(rename = "nextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>An array of objects that describe recommendation export jobs.</p>
    #[serde(rename = "recommendationExportJobs")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_export_jobs: Option<Vec<RecommendationExportJob>>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExportAutoScalingGroupRecommendationsRequest {
    /// <p>The IDs of the AWS accounts for which to export Auto Scaling group recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to export recommendations.</p> <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p> <p>You can specify multiple account IDs per request.</p>
    #[serde(rename = "accountIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_ids: Option<Vec<String>>,
    /// <p>The recommendations data to include in the export file.</p>
    #[serde(rename = "fieldsToExport")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub fields_to_export: Option<Vec<String>>,
    /// <p>The format of the export file.</p> <p>The only export file format currently supported is <code>Csv</code>.</p>
    #[serde(rename = "fileFormat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub file_format: Option<String>,
    /// <p>An array of objects that describe a filter to export a more specific set of Auto Scaling group recommendations.</p>
    #[serde(rename = "filters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<Filter>>,
    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the master account of an organization.</p> <p>The member accounts must also be opted in to Compute Optimizer.</p> <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p> <p>This parameter cannot be specified together with the account IDs parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
    #[serde(rename = "includeMemberAccounts")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_member_accounts: Option<bool>,
    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
    #[serde(rename = "s3DestinationConfig")]
    pub s_3_destination_config: S3DestinationConfig,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExportAutoScalingGroupRecommendationsResponse {
    /// <p>The identification number of the export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action, and specify the job ID to view the status of an export job.</p>
    #[serde(rename = "jobId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub job_id: Option<String>,
    /// <p>An object that describes the destination Amazon S3 bucket of a recommendations export file.</p>
    #[serde(rename = "s3Destination")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub s_3_destination: Option<S3Destination>,
}

/// <p>Describes the destination of the recommendations export and metadata files.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExportDestination {
    /// <p>An object that describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.</p>
    #[serde(rename = "s3")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub s_3: Option<S3Destination>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExportEC2InstanceRecommendationsRequest {
    /// <p>The IDs of the AWS accounts for which to export instance recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to export recommendations.</p> <p>This parameter cannot be specified together with the include member accounts parameter. The parameters are mutually exclusive.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the include member accounts parameter, is omitted.</p> <p>You can specify multiple account IDs per request.</p>
    #[serde(rename = "accountIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_ids: Option<Vec<String>>,
    /// <p>The recommendations data to include in the export file.</p>
    #[serde(rename = "fieldsToExport")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub fields_to_export: Option<Vec<String>>,
    /// <p>The format of the export file.</p> <p>The only export file format currently supported is <code>Csv</code>.</p>
    #[serde(rename = "fileFormat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub file_format: Option<String>,
    /// <p>An array of objects that describe a filter to export a more specific set of instance recommendations.</p>
    #[serde(rename = "filters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<Filter>>,
    /// <p>Indicates whether to include recommendations for resources in all member accounts of the organization if your account is the master account of an organization.</p> <p>The member accounts must also be opted in to Compute Optimizer.</p> <p>Recommendations for member accounts of the organization are not included in the export file if this parameter is omitted.</p> <p>Recommendations for member accounts are not included in the export if this parameter, or the account IDs parameter, is omitted.</p>
    #[serde(rename = "includeMemberAccounts")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_member_accounts: Option<bool>,
    /// <p>An object to specify the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for the export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
    #[serde(rename = "s3DestinationConfig")]
    pub s_3_destination_config: S3DestinationConfig,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ExportEC2InstanceRecommendationsResponse {
    /// <p>The identification number of the export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action, and specify the job ID to view the status of an export job.</p>
    #[serde(rename = "jobId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub job_id: Option<String>,
    /// <p>An object that describes the destination Amazon S3 bucket of a recommendations export file.</p>
    #[serde(rename = "s3Destination")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub s_3_destination: Option<S3Destination>,
}

/// <p>Describes a filter that returns a more specific list of recommendations.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Filter {
    /// <p>The name of the filter.</p> <p>Specify <code>Finding</code> to return recommendations with a specific findings classification (e.g., <code>Overprovisioned</code>).</p> <p>Specify <code>RecommendationSourceType</code> to return recommendations of a specific resource type (e.g., <code>AutoScalingGroup</code>).</p>
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// <p>The value of the filter.</p> <p>If you specify the <code>name</code> parameter as <code>Finding</code>, and you request recommendations for an <i>instance</i>, then the valid values are <code>Underprovisioned</code>, <code>Overprovisioned</code>, <code>NotOptimized</code>, or <code>Optimized</code>.</p> <p>If you specify the <code>name</code> parameter as <code>Finding</code>, and you request recommendations for an <i>Auto Scaling group</i>, then the valid values are <code>Optimized</code>, or <code>NotOptimized</code>.</p> <p>If you specify the <code>name</code> parameter as <code>RecommendationSourceType</code>, then the valid values are <code>Ec2Instance</code>, or <code>AutoScalingGroup</code>.</p>
    #[serde(rename = "values")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetAutoScalingGroupRecommendationsRequest {
    /// <p>The IDs of the AWS accounts for which to return Auto Scaling group recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return Auto Scaling group recommendations.</p> <p>Only one account ID can be specified per request.</p>
    #[serde(rename = "accountIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_ids: Option<Vec<String>>,
    /// <p>The Amazon Resource Name (ARN) of the Auto Scaling groups for which to return recommendations.</p>
    #[serde(rename = "autoScalingGroupArns")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_scaling_group_arns: Option<Vec<String>>,
    /// <p>An array of objects that describe a filter that returns a more specific list of Auto Scaling group recommendations.</p>
    #[serde(rename = "filters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<Filter>>,
    /// <p>The maximum number of Auto Scaling group recommendations to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
    #[serde(rename = "maxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The token to advance to the next page of Auto Scaling group recommendations.</p>
    #[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 GetAutoScalingGroupRecommendationsResponse {
    /// <p>An array of objects that describe Auto Scaling group recommendations.</p>
    #[serde(rename = "autoScalingGroupRecommendations")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub auto_scaling_group_recommendations: Option<Vec<AutoScalingGroupRecommendation>>,
    /// <p>An array of objects that describe errors of the request.</p> <p>For example, an error is returned if you request recommendations for an unsupported Auto Scaling group.</p>
    #[serde(rename = "errors")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub errors: Option<Vec<GetRecommendationError>>,
    /// <p>The token to use to advance to the next page of Auto Scaling group recommendations.</p> <p>This value is null when there are no more pages of Auto Scaling group recommendations to return.</p>
    #[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 GetEC2InstanceRecommendationsRequest {
    /// <p>The IDs of the AWS accounts for which to return instance recommendations.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return instance recommendations.</p> <p>Only one account ID can be specified per request.</p>
    #[serde(rename = "accountIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_ids: Option<Vec<String>>,
    /// <p>An array of objects that describe a filter that returns a more specific list of instance recommendations.</p>
    #[serde(rename = "filters")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub filters: Option<Vec<Filter>>,
    /// <p>The Amazon Resource Name (ARN) of the instances for which to return recommendations.</p>
    #[serde(rename = "instanceArns")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_arns: Option<Vec<String>>,
    /// <p>The maximum number of instance recommendations to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
    #[serde(rename = "maxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The token to advance to the next page of instance recommendations.</p>
    #[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 GetEC2InstanceRecommendationsResponse {
    /// <p>An array of objects that describe errors of the request.</p> <p>For example, an error is returned if you request recommendations for an instance of an unsupported instance family.</p>
    #[serde(rename = "errors")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub errors: Option<Vec<GetRecommendationError>>,
    /// <p>An array of objects that describe instance recommendations.</p>
    #[serde(rename = "instanceRecommendations")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_recommendations: Option<Vec<InstanceRecommendation>>,
    /// <p>The token to use to advance to the next page of instance recommendations.</p> <p>This value is null when there are no more pages of instance recommendations to return.</p>
    #[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 GetEC2RecommendationProjectedMetricsRequest {
    /// <p>The time stamp of the last projected metrics data point to return.</p>
    #[serde(rename = "endTime")]
    pub end_time: f64,
    /// <p>The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.</p>
    #[serde(rename = "instanceArn")]
    pub instance_arn: String,
    /// <p>The granularity, in seconds, of the projected metrics data points.</p>
    #[serde(rename = "period")]
    pub period: i64,
    /// <p>The time stamp of the first projected metrics data point to return.</p>
    #[serde(rename = "startTime")]
    pub start_time: f64,
    /// <p>The statistic of the projected metrics.</p>
    #[serde(rename = "stat")]
    pub stat: String,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetEC2RecommendationProjectedMetricsResponse {
    /// <p>An array of objects that describe a projected metrics.</p>
    #[serde(rename = "recommendedOptionProjectedMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommended_option_projected_metrics: Option<Vec<RecommendedOptionProjectedMetric>>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetEnrollmentStatusRequest {}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetEnrollmentStatusResponse {
    /// <p>Confirms the enrollment status of member accounts within the organization, if the account is a master account of an organization.</p>
    #[serde(rename = "memberAccountsEnrolled")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub member_accounts_enrolled: Option<bool>,
    /// <p>The enrollment status of the account.</p>
    #[serde(rename = "status")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// <p>The reason for the enrollment status of the account.</p> <p>For example, an account might show a status of <code>Pending</code> because member accounts of an organization require more time to be enrolled in the service.</p>
    #[serde(rename = "statusReason")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status_reason: Option<String>,
}

/// <p>Describes an error experienced when getting recommendations.</p> <p>For example, an error is returned if you request recommendations for an unsupported Auto Scaling group, or if you request recommendations for an instance of an unsupported instance family.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetRecommendationError {
    /// <p>The error code.</p>
    #[serde(rename = "code")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// <p>The ID of the error.</p>
    #[serde(rename = "identifier")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub identifier: Option<String>,
    /// <p>The message, or reason, for the error.</p>
    #[serde(rename = "message")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetRecommendationSummariesRequest {
    /// <p>The IDs of the AWS accounts for which to return recommendation summaries.</p> <p>If your account is the master account of an organization, use this parameter to specify the member accounts for which you want to return recommendation summaries.</p> <p>Only one account ID can be specified per request.</p>
    #[serde(rename = "accountIds")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_ids: Option<Vec<String>>,
    /// <p>The maximum number of recommendation summaries to return with a single request.</p> <p>To retrieve the remaining results, make another request with the returned <code>NextToken</code> value.</p>
    #[serde(rename = "maxResults")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_results: Option<i64>,
    /// <p>The token to advance to the next page of recommendation summaries.</p>
    #[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 GetRecommendationSummariesResponse {
    /// <p>The token to use to advance to the next page of recommendation summaries.</p> <p>This value is null when there are no more pages of recommendation summaries to return.</p>
    #[serde(rename = "nextToken")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub next_token: Option<String>,
    /// <p>An array of objects that summarize a recommendation.</p>
    #[serde(rename = "recommendationSummaries")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_summaries: Option<Vec<RecommendationSummary>>,
}

/// <p>Describes an Amazon EC2 instance recommendation.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct InstanceRecommendation {
    /// <p>The AWS account ID of the instance.</p>
    #[serde(rename = "accountId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// <p>The instance type of the current instance.</p>
    #[serde(rename = "currentInstanceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current_instance_type: Option<String>,
    /// <p><p>The finding classification for the instance.</p> <p>Findings for instances include:</p> <ul> <li> <p> <b> <code>Underprovisioned</code> </b>—An instance is considered under-provisioned when at least one specification of your instance, such as CPU, memory, or network, does not meet the performance requirements of your workload. Under-provisioned instances may lead to poor application performance.</p> </li> <li> <p> <b> <code>Overprovisioned</code> </b>—An instance is considered over-provisioned when at least one specification of your instance, such as CPU, memory, or network, can be sized down while still meeting the performance requirements of your workload, and no specification is under-provisioned. Over-provisioned instances may lead to unnecessary infrastructure cost.</p> </li> <li> <p> <b> <code>Optimized</code> </b>—An instance is considered optimized when all specifications of your instance, such as CPU, memory, and network, meet the performance requirements of your workload and is not over provisioned. An optimized instance runs your workloads with optimal performance and infrastructure cost. For optimized resources, AWS Compute Optimizer might recommend a new generation instance type.</p> </li> </ul> <note> <p>The values that are returned might be <code>UNDER<em>PROVISIONED</code>, <code>OVER</em>PROVISIONED</code>, or <code>OPTIMIZED</code>.</p> </note></p>
    #[serde(rename = "finding")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub finding: Option<String>,
    /// <p>The Amazon Resource Name (ARN) of the current instance.</p>
    #[serde(rename = "instanceArn")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_arn: Option<String>,
    /// <p>The name of the current instance.</p>
    #[serde(rename = "instanceName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_name: Option<String>,
    /// <p>The time stamp of when the instance recommendation was last refreshed.</p>
    #[serde(rename = "lastRefreshTimestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_refresh_timestamp: Option<f64>,
    /// <p>The number of days for which utilization metrics were analyzed for the instance.</p>
    #[serde(rename = "lookBackPeriodInDays")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub look_back_period_in_days: Option<f64>,
    /// <p>An array of objects that describe the recommendation options for the instance.</p>
    #[serde(rename = "recommendationOptions")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_options: Option<Vec<InstanceRecommendationOption>>,
    /// <p>An array of objects that describe the source resource of the recommendation.</p>
    #[serde(rename = "recommendationSources")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_sources: Option<Vec<RecommendationSource>>,
    /// <p>An array of objects that describe the utilization metrics of the instance.</p>
    #[serde(rename = "utilizationMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub utilization_metrics: Option<Vec<UtilizationMetric>>,
}

/// <p>Describes a recommendation option for an Amazon EC2 instance.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct InstanceRecommendationOption {
    /// <p>The instance type of the instance recommendation.</p>
    #[serde(rename = "instanceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub instance_type: Option<String>,
    /// <p>The performance risk of the instance recommendation option.</p> <p>Performance risk is the likelihood of the recommended instance type not meeting the performance requirement of your workload.</p> <p>The lowest performance risk is categorized as <code>0</code>, and the highest as <code>5</code>.</p>
    #[serde(rename = "performanceRisk")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub performance_risk: Option<f64>,
    /// <p>An array of objects that describe the projected utilization metrics of the instance recommendation option.</p>
    #[serde(rename = "projectedUtilizationMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub projected_utilization_metrics: Option<Vec<UtilizationMetric>>,
    /// <p>The rank of the instance recommendation option.</p> <p>The top recommendation option is ranked as <code>1</code>.</p>
    #[serde(rename = "rank")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rank: Option<i64>,
}

/// <p>Describes a filter that returns a more specific list of recommendation export jobs.</p> <p>This filter is used with the <code>DescribeRecommendationExportJobs</code> action.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct JobFilter {
    /// <p>The name of the filter.</p> <p>Specify <code>ResourceType</code> to return export jobs of a specific resource type (e.g., <code>Ec2Instance</code>).</p> <p>Specify <code>JobStatus</code> to return export jobs with a specific status (e.g, <code>Complete</code>).</p>
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// <p>The value of the filter.</p> <p>If you specify the <code>name</code> parameter as <code>ResourceType</code>, the valid values are <code>Ec2Instance</code> or <code>AutoScalingGroup</code>.</p> <p>If you specify the <code>name</code> parameter as <code>JobStatus</code>, the valid values are <code>Queued</code>, <code>InProgress</code>, <code>Complete</code>, or <code>Failed</code>.</p>
    #[serde(rename = "values")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
}

/// <p>Describes a projected utilization metric of a recommendation option, such as an Amazon EC2 instance.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ProjectedMetric {
    /// <p><p>The name of the projected utilization metric.</p> <note> <p>Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html">Enabling Memory Utilization with the CloudWatch Agent</a>.</p> </note></p>
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// <p>The time stamps of the projected utilization metric.</p>
    #[serde(rename = "timestamps")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timestamps: Option<Vec<f64>>,
    /// <p>The values of the projected utilization metrics.</p>
    #[serde(rename = "values")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<f64>>,
}

/// <p>Describes a recommendation export job.</p> <p>Use the <code>DescribeRecommendationExportJobs</code> action to view your recommendation export jobs.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RecommendationExportJob {
    /// <p>The timestamp of when the export job was created.</p>
    #[serde(rename = "creationTimestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<f64>,
    /// <p>An object that describes the destination of the export file.</p>
    #[serde(rename = "destination")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub destination: Option<ExportDestination>,
    /// <p>The reason for an export job failure.</p>
    #[serde(rename = "failureReason")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failure_reason: Option<String>,
    /// <p>The identification number of the export job.</p>
    #[serde(rename = "jobId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub job_id: Option<String>,
    /// <p>The timestamp of when the export job was last updated.</p>
    #[serde(rename = "lastUpdatedTimestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_updated_timestamp: Option<f64>,
    /// <p>The resource type of the exported recommendations.</p>
    #[serde(rename = "resourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub resource_type: Option<String>,
    /// <p>The status of the export job.</p>
    #[serde(rename = "status")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}

/// <p>Describes the source of a recommendation, such as an Amazon EC2 instance or Auto Scaling group.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RecommendationSource {
    /// <p>The Amazon Resource Name (ARN) of the recommendation source.</p>
    #[serde(rename = "recommendationSourceArn")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_source_arn: Option<String>,
    /// <p>The resource type of the recommendation source.</p>
    #[serde(rename = "recommendationSourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_source_type: Option<String>,
}

/// <p>A summary of a recommendation.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RecommendationSummary {
    /// <p>The AWS account ID of the recommendation summary.</p>
    #[serde(rename = "accountId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    /// <p>The resource type of the recommendation.</p>
    #[serde(rename = "recommendationResourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommendation_resource_type: Option<String>,
    /// <p>An array of objects that describe a recommendation summary.</p>
    #[serde(rename = "summaries")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub summaries: Option<Vec<Summary>>,
}

/// <p>Describes a projected utilization metric of a recommendation option.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct RecommendedOptionProjectedMetric {
    /// <p>An array of objects that describe a projected utilization metric.</p>
    #[serde(rename = "projectedMetrics")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub projected_metrics: Option<Vec<ProjectedMetric>>,
    /// <p>The rank of the recommendation option projected metric.</p> <p>The top recommendation option is ranked as <code>1</code>.</p> <p>The projected metric rank correlates to the recommendation option rank. For example, the projected metric ranked as <code>1</code> is related to the recommendation option that is also ranked as <code>1</code> in the same response.</p>
    #[serde(rename = "rank")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rank: Option<i64>,
    /// <p>The recommended instance type.</p>
    #[serde(rename = "recommendedInstanceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recommended_instance_type: Option<String>,
}

/// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and object keys of a recommendations export file, and its associated metadata file.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct S3Destination {
    /// <p>The name of the Amazon S3 bucket used as the destination of an export file.</p>
    #[serde(rename = "bucket")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bucket: Option<String>,
    /// <p>The Amazon S3 bucket key of an export file.</p> <p>The key uniquely identifies the object, or export file, in the S3 bucket.</p>
    #[serde(rename = "key")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// <p>The Amazon S3 bucket key of a metadata file.</p> <p>The key uniquely identifies the object, or metadata file, in the S3 bucket.</p>
    #[serde(rename = "metadataKey")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata_key: Option<String>,
}

/// <p>Describes the destination Amazon Simple Storage Service (Amazon S3) bucket name and key prefix for a recommendations export job.</p> <p>You must create the destination Amazon S3 bucket for your recommendations export before you create the export job. Compute Optimizer does not create the S3 bucket for you. After you create the S3 bucket, ensure that it has the required permission policy to allow Compute Optimizer to write the export file to it. If you plan to specify an object prefix when you create the export job, you must include the object prefix in the policy that you add to the S3 bucket. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/create-s3-bucket-policy-for-compute-optimizer.html">Amazon S3 Bucket Policy for Compute Optimizer</a> in the <i>Compute Optimizer user guide</i>.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct S3DestinationConfig {
    /// <p>The name of the Amazon S3 bucket to use as the destination for an export job.</p>
    #[serde(rename = "bucket")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bucket: Option<String>,
    /// <p>The Amazon S3 bucket prefix for an export job.</p>
    #[serde(rename = "keyPrefix")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub key_prefix: Option<String>,
}

/// <p>The summary of a recommendation.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Summary {
    /// <p>The finding classification of the recommendation.</p>
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// <p>The value of the recommendation summary.</p>
    #[serde(rename = "value")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub value: Option<f64>,
}

#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateEnrollmentStatusRequest {
    /// <p>Indicates whether to enroll member accounts of the organization if the your account is the master account of an organization.</p>
    #[serde(rename = "includeMemberAccounts")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_member_accounts: Option<bool>,
    /// <p>The new enrollment status of the account.</p> <p>Accepted options are <code>Active</code> or <code>Inactive</code>. You will get an error if <code>Pending</code> or <code>Failed</code> are specified.</p>
    #[serde(rename = "status")]
    pub status: String,
}

#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateEnrollmentStatusResponse {
    /// <p>The enrollment status of the account.</p>
    #[serde(rename = "status")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// <p>The reason for the enrollment status of the account. For example, an account might show a status of <code>Pending</code> because member accounts of an organization require more time to be enrolled in the service.</p>
    #[serde(rename = "statusReason")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status_reason: Option<String>,
}

/// <p>Describes a utilization metric of a resource, such as an Amazon EC2 instance.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UtilizationMetric {
    /// <p><p>The name of the utilization metric.</p> <note> <p>Memory metrics are only returned for resources that have the unified CloudWatch agent installed on them. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html">Enabling Memory Utilization with the CloudWatch Agent</a>.</p> </note></p>
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// <p>The statistic of the utilization metric.</p>
    #[serde(rename = "statistic")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub statistic: Option<String>,
    /// <p>The value of the utilization metric.</p>
    #[serde(rename = "value")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub value: Option<f64>,
}

/// Errors returned by DescribeRecommendationExportJobs
#[derive(Debug, PartialEq)]
pub enum DescribeRecommendationExportJobsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>A resource that is required for the action doesn't exist.</p>
    ResourceNotFound(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl DescribeRecommendationExportJobsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<DescribeRecommendationExportJobsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::AccessDenied(err.msg),
                    )
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::MissingAuthenticationToken(err.msg),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::OptInRequired(err.msg),
                    )
                }
                "ResourceNotFoundException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::ResourceNotFound(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        DescribeRecommendationExportJobsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(DescribeRecommendationExportJobsError::Throttling(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for DescribeRecommendationExportJobsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            DescribeRecommendationExportJobsError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::InternalServer(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::OptInRequired(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::ResourceNotFound(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            DescribeRecommendationExportJobsError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for DescribeRecommendationExportJobsError {}
/// Errors returned by ExportAutoScalingGroupRecommendations
#[derive(Debug, PartialEq)]
pub enum ExportAutoScalingGroupRecommendationsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request exceeds a limit of the service.</p>
    LimitExceeded(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl ExportAutoScalingGroupRecommendationsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<ExportAutoScalingGroupRecommendationsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::AccessDenied(err.msg),
                    )
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::InvalidParameterValue(err.msg),
                    )
                }
                "LimitExceededException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::LimitExceeded(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::MissingAuthenticationToken(
                            err.msg,
                        ),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::OptInRequired(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(
                        ExportAutoScalingGroupRecommendationsError::Throttling(err.msg),
                    )
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for ExportAutoScalingGroupRecommendationsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            ExportAutoScalingGroupRecommendationsError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::InternalServer(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::LimitExceeded(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::OptInRequired(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportAutoScalingGroupRecommendationsError::Throttling(ref cause) => {
                write!(f, "{}", cause)
            }
        }
    }
}
impl Error for ExportAutoScalingGroupRecommendationsError {}
/// Errors returned by ExportEC2InstanceRecommendations
#[derive(Debug, PartialEq)]
pub enum ExportEC2InstanceRecommendationsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request exceeds a limit of the service.</p>
    LimitExceeded(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl ExportEC2InstanceRecommendationsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<ExportEC2InstanceRecommendationsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::AccessDenied(err.msg),
                    )
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::InvalidParameterValue(err.msg),
                    )
                }
                "LimitExceededException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::LimitExceeded(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::MissingAuthenticationToken(err.msg),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::OptInRequired(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        ExportEC2InstanceRecommendationsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(ExportEC2InstanceRecommendationsError::Throttling(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for ExportEC2InstanceRecommendationsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            ExportEC2InstanceRecommendationsError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::InternalServer(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::LimitExceeded(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::OptInRequired(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            ExportEC2InstanceRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for ExportEC2InstanceRecommendationsError {}
/// Errors returned by GetAutoScalingGroupRecommendations
#[derive(Debug, PartialEq)]
pub enum GetAutoScalingGroupRecommendationsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>A resource that is required for the action doesn't exist.</p>
    ResourceNotFound(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl GetAutoScalingGroupRecommendationsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<GetAutoScalingGroupRecommendationsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::AccessDenied(err.msg),
                    )
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::MissingAuthenticationToken(
                            err.msg,
                        ),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::OptInRequired(err.msg),
                    )
                }
                "ResourceNotFoundException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::ResourceNotFound(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(
                        GetAutoScalingGroupRecommendationsError::Throttling(err.msg),
                    )
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for GetAutoScalingGroupRecommendationsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GetAutoScalingGroupRecommendationsError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::InternalServer(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::OptInRequired(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::ResourceNotFound(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            GetAutoScalingGroupRecommendationsError::Throttling(ref cause) => {
                write!(f, "{}", cause)
            }
        }
    }
}
impl Error for GetAutoScalingGroupRecommendationsError {}
/// Errors returned by GetEC2InstanceRecommendations
#[derive(Debug, PartialEq)]
pub enum GetEC2InstanceRecommendationsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>A resource that is required for the action doesn't exist.</p>
    ResourceNotFound(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl GetEC2InstanceRecommendationsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<GetEC2InstanceRecommendationsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(GetEC2InstanceRecommendationsError::AccessDenied(
                        err.msg,
                    ))
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        GetEC2InstanceRecommendationsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        GetEC2InstanceRecommendationsError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        GetEC2InstanceRecommendationsError::MissingAuthenticationToken(err.msg),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(GetEC2InstanceRecommendationsError::OptInRequired(
                        err.msg,
                    ))
                }
                "ResourceNotFoundException" => {
                    return RusotoError::Service(
                        GetEC2InstanceRecommendationsError::ResourceNotFound(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        GetEC2InstanceRecommendationsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(GetEC2InstanceRecommendationsError::Throttling(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for GetEC2InstanceRecommendationsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GetEC2InstanceRecommendationsError::AccessDenied(ref cause) => write!(f, "{}", cause),
            GetEC2InstanceRecommendationsError::InternalServer(ref cause) => write!(f, "{}", cause),
            GetEC2InstanceRecommendationsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2InstanceRecommendationsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2InstanceRecommendationsError::OptInRequired(ref cause) => write!(f, "{}", cause),
            GetEC2InstanceRecommendationsError::ResourceNotFound(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2InstanceRecommendationsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2InstanceRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for GetEC2InstanceRecommendationsError {}
/// Errors returned by GetEC2RecommendationProjectedMetrics
#[derive(Debug, PartialEq)]
pub enum GetEC2RecommendationProjectedMetricsError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>A resource that is required for the action doesn't exist.</p>
    ResourceNotFound(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl GetEC2RecommendationProjectedMetricsError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<GetEC2RecommendationProjectedMetricsError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::AccessDenied(err.msg),
                    )
                }
                "InternalServerException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::InternalServer(err.msg),
                    )
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::MissingAuthenticationToken(
                            err.msg,
                        ),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::OptInRequired(err.msg),
                    )
                }
                "ResourceNotFoundException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::ResourceNotFound(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(
                        GetEC2RecommendationProjectedMetricsError::Throttling(err.msg),
                    )
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for GetEC2RecommendationProjectedMetricsError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GetEC2RecommendationProjectedMetricsError::AccessDenied(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::InternalServer(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::OptInRequired(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::ResourceNotFound(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEC2RecommendationProjectedMetricsError::Throttling(ref cause) => {
                write!(f, "{}", cause)
            }
        }
    }
}
impl Error for GetEC2RecommendationProjectedMetricsError {}
/// Errors returned by GetEnrollmentStatus
#[derive(Debug, PartialEq)]
pub enum GetEnrollmentStatusError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl GetEnrollmentStatusError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetEnrollmentStatusError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(GetEnrollmentStatusError::AccessDenied(err.msg))
                }
                "InternalServerException" => {
                    return RusotoError::Service(GetEnrollmentStatusError::InternalServer(err.msg))
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(GetEnrollmentStatusError::InvalidParameterValue(
                        err.msg,
                    ))
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        GetEnrollmentStatusError::MissingAuthenticationToken(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(GetEnrollmentStatusError::ServiceUnavailable(
                        err.msg,
                    ))
                }
                "ThrottlingException" => {
                    return RusotoError::Service(GetEnrollmentStatusError::Throttling(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for GetEnrollmentStatusError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GetEnrollmentStatusError::AccessDenied(ref cause) => write!(f, "{}", cause),
            GetEnrollmentStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
            GetEnrollmentStatusError::InvalidParameterValue(ref cause) => write!(f, "{}", cause),
            GetEnrollmentStatusError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            GetEnrollmentStatusError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
            GetEnrollmentStatusError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for GetEnrollmentStatusError {}
/// Errors returned by GetRecommendationSummaries
#[derive(Debug, PartialEq)]
pub enum GetRecommendationSummariesError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The account is not opted in to AWS Compute Optimizer.</p>
    OptInRequired(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl GetRecommendationSummariesError {
    pub fn from_response(
        res: BufferedHttpResponse,
    ) -> RusotoError<GetRecommendationSummariesError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(GetRecommendationSummariesError::AccessDenied(
                        err.msg,
                    ))
                }
                "InternalServerException" => {
                    return RusotoError::Service(GetRecommendationSummariesError::InternalServer(
                        err.msg,
                    ))
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        GetRecommendationSummariesError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        GetRecommendationSummariesError::MissingAuthenticationToken(err.msg),
                    )
                }
                "OptInRequiredException" => {
                    return RusotoError::Service(GetRecommendationSummariesError::OptInRequired(
                        err.msg,
                    ))
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(
                        GetRecommendationSummariesError::ServiceUnavailable(err.msg),
                    )
                }
                "ThrottlingException" => {
                    return RusotoError::Service(GetRecommendationSummariesError::Throttling(
                        err.msg,
                    ))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for GetRecommendationSummariesError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            GetRecommendationSummariesError::AccessDenied(ref cause) => write!(f, "{}", cause),
            GetRecommendationSummariesError::InternalServer(ref cause) => write!(f, "{}", cause),
            GetRecommendationSummariesError::InvalidParameterValue(ref cause) => {
                write!(f, "{}", cause)
            }
            GetRecommendationSummariesError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            GetRecommendationSummariesError::OptInRequired(ref cause) => write!(f, "{}", cause),
            GetRecommendationSummariesError::ServiceUnavailable(ref cause) => {
                write!(f, "{}", cause)
            }
            GetRecommendationSummariesError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for GetRecommendationSummariesError {}
/// Errors returned by UpdateEnrollmentStatus
#[derive(Debug, PartialEq)]
pub enum UpdateEnrollmentStatusError {
    /// <p>You do not have sufficient access to perform this action.</p>
    AccessDenied(String),
    /// <p>An internal error has occurred. Try your call again.</p>
    InternalServer(String),
    /// <p>An invalid or out-of-range value was supplied for the input parameter.</p>
    InvalidParameterValue(String),
    /// <p>The request must contain either a valid (registered) AWS access key ID or X.509 certificate.</p>
    MissingAuthenticationToken(String),
    /// <p>The request has failed due to a temporary failure of the server.</p>
    ServiceUnavailable(String),
    /// <p>The request was denied due to request throttling.</p>
    Throttling(String),
}

impl UpdateEnrollmentStatusError {
    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEnrollmentStatusError> {
        if let Some(err) = proto::json::Error::parse(&res) {
            match err.typ.as_str() {
                "AccessDeniedException" => {
                    return RusotoError::Service(UpdateEnrollmentStatusError::AccessDenied(err.msg))
                }
                "InternalServerException" => {
                    return RusotoError::Service(UpdateEnrollmentStatusError::InternalServer(
                        err.msg,
                    ))
                }
                "InvalidParameterValueException" => {
                    return RusotoError::Service(
                        UpdateEnrollmentStatusError::InvalidParameterValue(err.msg),
                    )
                }
                "MissingAuthenticationToken" => {
                    return RusotoError::Service(
                        UpdateEnrollmentStatusError::MissingAuthenticationToken(err.msg),
                    )
                }
                "ServiceUnavailableException" => {
                    return RusotoError::Service(UpdateEnrollmentStatusError::ServiceUnavailable(
                        err.msg,
                    ))
                }
                "ThrottlingException" => {
                    return RusotoError::Service(UpdateEnrollmentStatusError::Throttling(err.msg))
                }
                "ValidationException" => return RusotoError::Validation(err.msg),
                _ => {}
            }
        }
        RusotoError::Unknown(res)
    }
}
impl fmt::Display for UpdateEnrollmentStatusError {
    #[allow(unused_variables)]
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match *self {
            UpdateEnrollmentStatusError::AccessDenied(ref cause) => write!(f, "{}", cause),
            UpdateEnrollmentStatusError::InternalServer(ref cause) => write!(f, "{}", cause),
            UpdateEnrollmentStatusError::InvalidParameterValue(ref cause) => write!(f, "{}", cause),
            UpdateEnrollmentStatusError::MissingAuthenticationToken(ref cause) => {
                write!(f, "{}", cause)
            }
            UpdateEnrollmentStatusError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
            UpdateEnrollmentStatusError::Throttling(ref cause) => write!(f, "{}", cause),
        }
    }
}
impl Error for UpdateEnrollmentStatusError {}
/// Trait representing the capabilities of the AWS Compute Optimizer API. AWS Compute Optimizer clients implement this trait.
#[async_trait]
pub trait ComputeOptimizer {
    /// <p>Describes recommendation export jobs created in the last seven days.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations. Then use the <code>DescribeRecommendationExportJobs</code> action to view your export jobs.</p>
    async fn describe_recommendation_export_jobs(
        &self,
        input: DescribeRecommendationExportJobsRequest,
    ) -> Result<
        DescribeRecommendationExportJobsResponse,
        RusotoError<DescribeRecommendationExportJobsError>,
    >;

    /// <p>Exports optimization recommendations for Auto Scaling groups.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Auto Scaling group export job in progress per AWS Region.</p>
    async fn export_auto_scaling_group_recommendations(
        &self,
        input: ExportAutoScalingGroupRecommendationsRequest,
    ) -> Result<
        ExportAutoScalingGroupRecommendationsResponse,
        RusotoError<ExportAutoScalingGroupRecommendationsError>,
    >;

    /// <p>Exports optimization recommendations for Amazon EC2 instances.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Amazon EC2 instance export job in progress per AWS Region.</p>
    async fn export_ec2_instance_recommendations(
        &self,
        input: ExportEC2InstanceRecommendationsRequest,
    ) -> Result<
        ExportEC2InstanceRecommendationsResponse,
        RusotoError<ExportEC2InstanceRecommendationsError>,
    >;

    /// <p>Returns Auto Scaling group recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
    async fn get_auto_scaling_group_recommendations(
        &self,
        input: GetAutoScalingGroupRecommendationsRequest,
    ) -> Result<
        GetAutoScalingGroupRecommendationsResponse,
        RusotoError<GetAutoScalingGroupRecommendationsError>,
    >;

    /// <p>Returns Amazon EC2 instance recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
    async fn get_ec2_instance_recommendations(
        &self,
        input: GetEC2InstanceRecommendationsRequest,
    ) -> Result<
        GetEC2InstanceRecommendationsResponse,
        RusotoError<GetEC2InstanceRecommendationsError>,
    >;

    /// <p>Returns the projected utilization metrics of Amazon EC2 instance recommendations.</p>
    async fn get_ec2_recommendation_projected_metrics(
        &self,
        input: GetEC2RecommendationProjectedMetricsRequest,
    ) -> Result<
        GetEC2RecommendationProjectedMetricsResponse,
        RusotoError<GetEC2RecommendationProjectedMetricsError>,
    >;

    /// <p>Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is the master account of an organization, this action also confirms the enrollment status of member accounts within the organization.</p>
    async fn get_enrollment_status(
        &self,
    ) -> Result<GetEnrollmentStatusResponse, RusotoError<GetEnrollmentStatusError>>;

    /// <p>Returns the optimization findings for an account.</p> <p>For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.</p>
    async fn get_recommendation_summaries(
        &self,
        input: GetRecommendationSummariesRequest,
    ) -> Result<GetRecommendationSummariesResponse, RusotoError<GetRecommendationSummariesError>>;

    /// <p>Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is a master account of an organization, this action can also be used to enroll member accounts within the organization.</p>
    async fn update_enrollment_status(
        &self,
        input: UpdateEnrollmentStatusRequest,
    ) -> Result<UpdateEnrollmentStatusResponse, RusotoError<UpdateEnrollmentStatusError>>;
}
/// A client for the AWS Compute Optimizer API.
#[derive(Clone)]
pub struct ComputeOptimizerClient {
    client: Client,
    region: region::Region,
}

impl ComputeOptimizerClient {
    /// 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) -> ComputeOptimizerClient {
        ComputeOptimizerClient {
            client: Client::shared(),
            region,
        }
    }

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

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

#[async_trait]
impl ComputeOptimizer for ComputeOptimizerClient {
    /// <p>Describes recommendation export jobs created in the last seven days.</p> <p>Use the <code>ExportAutoScalingGroupRecommendations</code> or <code>ExportEC2InstanceRecommendations</code> actions to request an export of your recommendations. Then use the <code>DescribeRecommendationExportJobs</code> action to view your export jobs.</p>
    async fn describe_recommendation_export_jobs(
        &self,
        input: DescribeRecommendationExportJobsRequest,
    ) -> Result<
        DescribeRecommendationExportJobsResponse,
        RusotoError<DescribeRecommendationExportJobsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.DescribeRecommendationExportJobs",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Exports optimization recommendations for Auto Scaling groups.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Auto Scaling group export job in progress per AWS Region.</p>
    async fn export_auto_scaling_group_recommendations(
        &self,
        input: ExportAutoScalingGroupRecommendationsRequest,
    ) -> Result<
        ExportAutoScalingGroupRecommendationsResponse,
        RusotoError<ExportAutoScalingGroupRecommendationsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.ExportAutoScalingGroupRecommendations",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Exports optimization recommendations for Amazon EC2 instances.</p> <p>Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/exporting-recommendations.html">Exporting Recommendations</a> in the <i>Compute Optimizer User Guide</i>.</p> <p>You can have only one Amazon EC2 instance export job in progress per AWS Region.</p>
    async fn export_ec2_instance_recommendations(
        &self,
        input: ExportEC2InstanceRecommendationsRequest,
    ) -> Result<
        ExportEC2InstanceRecommendationsResponse,
        RusotoError<ExportEC2InstanceRecommendationsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.ExportEC2InstanceRecommendations",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Returns Auto Scaling group recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Auto Scaling groups that are configured to run instances of the M, C, R, T, and X instance families. The service does not generate recommendations for Auto Scaling groups that have a scaling policy attached to them, or that do not have the same values for desired, minimum, and maximum capacity. In order for Compute Optimizer to analyze your Auto Scaling groups, they must be of a fixed size. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
    async fn get_auto_scaling_group_recommendations(
        &self,
        input: GetAutoScalingGroupRecommendationsRequest,
    ) -> Result<
        GetAutoScalingGroupRecommendationsResponse,
        RusotoError<GetAutoScalingGroupRecommendationsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.GetAutoScalingGroupRecommendations",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Returns Amazon EC2 instance recommendations.</p> <p>AWS Compute Optimizer currently generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) and Amazon EC2 Auto Scaling. It generates recommendations for M, C, R, T, and X instance families. For more information, see the <a href="https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html">AWS Compute Optimizer User Guide</a>.</p>
    async fn get_ec2_instance_recommendations(
        &self,
        input: GetEC2InstanceRecommendationsRequest,
    ) -> Result<
        GetEC2InstanceRecommendationsResponse,
        RusotoError<GetEC2InstanceRecommendationsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.GetEC2InstanceRecommendations",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Returns the projected utilization metrics of Amazon EC2 instance recommendations.</p>
    async fn get_ec2_recommendation_projected_metrics(
        &self,
        input: GetEC2RecommendationProjectedMetricsRequest,
    ) -> Result<
        GetEC2RecommendationProjectedMetricsResponse,
        RusotoError<GetEC2RecommendationProjectedMetricsError>,
    > {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.GetEC2RecommendationProjectedMetrics",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is the master account of an organization, this action also confirms the enrollment status of member accounts within the organization.</p>
    async fn get_enrollment_status(
        &self,
    ) -> Result<GetEnrollmentStatusResponse, RusotoError<GetEnrollmentStatusError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.GetEnrollmentStatus",
        );
        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));

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

    /// <p>Returns the optimization findings for an account.</p> <p>For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.</p>
    async fn get_recommendation_summaries(
        &self,
        input: GetRecommendationSummariesRequest,
    ) -> Result<GetRecommendationSummariesResponse, RusotoError<GetRecommendationSummariesError>>
    {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.GetRecommendationSummaries",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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

    /// <p>Updates the enrollment (opt in) status of an account to the AWS Compute Optimizer service.</p> <p>If the account is a master account of an organization, this action can also be used to enroll member accounts within the organization.</p>
    async fn update_enrollment_status(
        &self,
        input: UpdateEnrollmentStatusRequest,
    ) -> Result<UpdateEnrollmentStatusResponse, RusotoError<UpdateEnrollmentStatusError>> {
        let mut request = self.new_signed_request("POST", "/");
        request.add_header(
            "x-amz-target",
            "ComputeOptimizerService.UpdateEnrollmentStatus",
        );
        let encoded = serde_json::to_string(&input).unwrap();
        request.set_payload(Some(encoded));

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