diff --git a/clients/client-trustedadvisor/.gitignore b/clients/client-trustedadvisor/.gitignore new file mode 100644 index 000000000000..54f14c9aef25 --- /dev/null +++ b/clients/client-trustedadvisor/.gitignore @@ -0,0 +1,9 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/dist-* +*.tsbuildinfo +*.tgz +*.log +package-lock.json diff --git a/clients/client-trustedadvisor/LICENSE b/clients/client-trustedadvisor/LICENSE new file mode 100644 index 000000000000..5001cd317c44 --- /dev/null +++ b/clients/client-trustedadvisor/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/clients/client-trustedadvisor/README.md b/clients/client-trustedadvisor/README.md new file mode 100644 index 000000000000..82b1792ba2b8 --- /dev/null +++ b/clients/client-trustedadvisor/README.md @@ -0,0 +1,285 @@ + + +# @aws-sdk/client-trustedadvisor + +## Description + +AWS SDK for JavaScript TrustedAdvisor Client for Node.js, Browser and React Native. + +

TrustedAdvisor Public API

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-trustedadvisor +using your favorite package manager: + +- `npm install @aws-sdk/client-trustedadvisor` +- `yarn add @aws-sdk/client-trustedadvisor` +- `pnpm add @aws-sdk/client-trustedadvisor` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TrustedAdvisorClient` and +the commands you need, for example `ListChecksCommand`: + +```js +// ES5 example +const { TrustedAdvisorClient, ListChecksCommand } = require("@aws-sdk/client-trustedadvisor"); +``` + +```ts +// ES6+ example +import { TrustedAdvisorClient, ListChecksCommand } from "@aws-sdk/client-trustedadvisor"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by different commands. +const client = new TrustedAdvisorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListChecksCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // process err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-trustedadvisor"; +const client = new AWS.TrustedAdvisor({ region: "REGION" }); + +// async/await. +try { + const data = await client.listChecks(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listChecks(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listChecks(params, (err, data) => { + // process err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-trustedadvisor` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/main/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. + +## Client Commands (Operations List) + +
+ +GetOrganizationRecommendation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/getorganizationrecommendationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/getorganizationrecommendationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/getorganizationrecommendationcommandoutput.html) + +
+
+ +GetRecommendation + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/getrecommendationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/getrecommendationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/getrecommendationcommandoutput.html) + +
+
+ +ListChecks + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listcheckscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listcheckscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listcheckscommandoutput.html) + +
+
+ +ListOrganizationRecommendationAccounts + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listorganizationrecommendationaccountscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationaccountscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationaccountscommandoutput.html) + +
+
+ +ListOrganizationRecommendationResources + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listorganizationrecommendationresourcescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationresourcescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationresourcescommandoutput.html) + +
+
+ +ListOrganizationRecommendations + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listorganizationrecommendationscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listorganizationrecommendationscommandoutput.html) + +
+
+ +ListRecommendationResources + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listrecommendationresourcescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listrecommendationresourcescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listrecommendationresourcescommandoutput.html) + +
+
+ +ListRecommendations + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/listrecommendationscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listrecommendationscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/listrecommendationscommandoutput.html) + +
+
+ +UpdateOrganizationRecommendationLifecycle + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/updateorganizationrecommendationlifecyclecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/updateorganizationrecommendationlifecyclecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/updateorganizationrecommendationlifecyclecommandoutput.html) + +
+
+ +UpdateRecommendationLifecycle + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/classes/updaterecommendationlifecyclecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/updaterecommendationlifecyclecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-trustedadvisor/interfaces/updaterecommendationlifecyclecommandoutput.html) + +
diff --git a/clients/client-trustedadvisor/api-extractor.json b/clients/client-trustedadvisor/api-extractor.json new file mode 100644 index 000000000000..d5bf5ffeee85 --- /dev/null +++ b/clients/client-trustedadvisor/api-extractor.json @@ -0,0 +1,4 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "/dist-types/index.d.ts" +} diff --git a/clients/client-trustedadvisor/package.json b/clients/client-trustedadvisor/package.json new file mode 100644 index 000000000000..22ba1747d39d --- /dev/null +++ b/clients/client-trustedadvisor/package.json @@ -0,0 +1,102 @@ +{ + "name": "@aws-sdk/client-trustedadvisor", + "description": "AWS SDK for JavaScript Trustedadvisor Client for Node.js, Browser and React Native", + "version": "3.0.0", + "scripts": { + "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:docs": "typedoc", + "build:es": "tsc -p tsconfig.es.json", + "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build", + "build:types": "tsc -p tsconfig.types.json", + "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4", + "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo", + "extract:docs": "api-extractor run --local", + "generate:client": "node ../../scripts/generate-clients/single-service --solo trustedadvisor" + }, + "main": "./dist-cjs/index.js", + "types": "./dist-types/index.d.ts", + "module": "./dist-es/index.js", + "sideEffects": false, + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "*", + "@aws-sdk/core": "*", + "@aws-sdk/credential-provider-node": "*", + "@aws-sdk/middleware-host-header": "*", + "@aws-sdk/middleware-logger": "*", + "@aws-sdk/middleware-recursion-detection": "*", + "@aws-sdk/middleware-signing": "*", + "@aws-sdk/middleware-user-agent": "*", + "@aws-sdk/region-config-resolver": "*", + "@aws-sdk/types": "*", + "@aws-sdk/util-endpoints": "*", + "@aws-sdk/util-user-agent-browser": "*", + "@aws-sdk/util-user-agent-node": "*", + "@smithy/config-resolver": "^2.0.18", + "@smithy/fetch-http-handler": "^2.2.6", + "@smithy/hash-node": "^2.0.15", + "@smithy/invalid-dependency": "^2.0.13", + "@smithy/middleware-content-length": "^2.0.15", + "@smithy/middleware-endpoint": "^2.2.0", + "@smithy/middleware-retry": "^2.0.20", + "@smithy/middleware-serde": "^2.0.13", + "@smithy/middleware-stack": "^2.0.7", + "@smithy/node-config-provider": "^2.1.5", + "@smithy/node-http-handler": "^2.1.9", + "@smithy/protocol-http": "^3.0.9", + "@smithy/smithy-client": "^2.1.15", + "@smithy/types": "^2.5.0", + "@smithy/url-parser": "^2.0.13", + "@smithy/util-base64": "^2.0.1", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.19", + "@smithy/util-defaults-mode-node": "^2.0.25", + "@smithy/util-endpoints": "^1.0.4", + "@smithy/util-retry": "^2.0.6", + "@smithy/util-utf8": "^2.0.2", + "tslib": "^2.5.0" + }, + "devDependencies": { + "@smithy/service-client-documentation-generator": "^2.0.0", + "@tsconfig/node14": "1.0.3", + "@types/node": "^14.14.31", + "concurrently": "7.0.0", + "downlevel-dts": "0.10.1", + "rimraf": "3.0.2", + "typedoc": "0.23.23", + "typescript": "~4.9.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "typesVersions": { + "<4.0": { + "dist-types/*": [ + "dist-types/ts3.4/*" + ] + } + }, + "files": [ + "dist-*/**" + ], + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0", + "browser": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" + }, + "react-native": { + "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" + }, + "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-trustedadvisor", + "repository": { + "type": "git", + "url": "https://github.com/aws/aws-sdk-js-v3.git", + "directory": "clients/client-trustedadvisor" + } +} diff --git a/clients/client-trustedadvisor/src/TrustedAdvisor.ts b/clients/client-trustedadvisor/src/TrustedAdvisor.ts new file mode 100644 index 000000000000..b5a3aea0da6f --- /dev/null +++ b/clients/client-trustedadvisor/src/TrustedAdvisor.ts @@ -0,0 +1,237 @@ +// smithy-typescript generated code +import { createAggregatedClient } from "@smithy/smithy-client"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; + +import { + GetOrganizationRecommendationCommand, + GetOrganizationRecommendationCommandInput, + GetOrganizationRecommendationCommandOutput, +} from "./commands/GetOrganizationRecommendationCommand"; +import { + GetRecommendationCommand, + GetRecommendationCommandInput, + GetRecommendationCommandOutput, +} from "./commands/GetRecommendationCommand"; +import { ListChecksCommand, ListChecksCommandInput, ListChecksCommandOutput } from "./commands/ListChecksCommand"; +import { + ListOrganizationRecommendationAccountsCommand, + ListOrganizationRecommendationAccountsCommandInput, + ListOrganizationRecommendationAccountsCommandOutput, +} from "./commands/ListOrganizationRecommendationAccountsCommand"; +import { + ListOrganizationRecommendationResourcesCommand, + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput, +} from "./commands/ListOrganizationRecommendationResourcesCommand"; +import { + ListOrganizationRecommendationsCommand, + ListOrganizationRecommendationsCommandInput, + ListOrganizationRecommendationsCommandOutput, +} from "./commands/ListOrganizationRecommendationsCommand"; +import { + ListRecommendationResourcesCommand, + ListRecommendationResourcesCommandInput, + ListRecommendationResourcesCommandOutput, +} from "./commands/ListRecommendationResourcesCommand"; +import { + ListRecommendationsCommand, + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, +} from "./commands/ListRecommendationsCommand"; +import { + UpdateOrganizationRecommendationLifecycleCommand, + UpdateOrganizationRecommendationLifecycleCommandInput, + UpdateOrganizationRecommendationLifecycleCommandOutput, +} from "./commands/UpdateOrganizationRecommendationLifecycleCommand"; +import { + UpdateRecommendationLifecycleCommand, + UpdateRecommendationLifecycleCommandInput, + UpdateRecommendationLifecycleCommandOutput, +} from "./commands/UpdateRecommendationLifecycleCommand"; +import { TrustedAdvisorClient, TrustedAdvisorClientConfig } from "./TrustedAdvisorClient"; + +const commands = { + GetOrganizationRecommendationCommand, + GetRecommendationCommand, + ListChecksCommand, + ListOrganizationRecommendationAccountsCommand, + ListOrganizationRecommendationResourcesCommand, + ListOrganizationRecommendationsCommand, + ListRecommendationResourcesCommand, + ListRecommendationsCommand, + UpdateOrganizationRecommendationLifecycleCommand, + UpdateRecommendationLifecycleCommand, +}; + +export interface TrustedAdvisor { + /** + * @see {@link GetOrganizationRecommendationCommand} + */ + getOrganizationRecommendation( + args: GetOrganizationRecommendationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getOrganizationRecommendation( + args: GetOrganizationRecommendationCommandInput, + cb: (err: any, data?: GetOrganizationRecommendationCommandOutput) => void + ): void; + getOrganizationRecommendation( + args: GetOrganizationRecommendationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetOrganizationRecommendationCommandOutput) => void + ): void; + + /** + * @see {@link GetRecommendationCommand} + */ + getRecommendation( + args: GetRecommendationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getRecommendation( + args: GetRecommendationCommandInput, + cb: (err: any, data?: GetRecommendationCommandOutput) => void + ): void; + getRecommendation( + args: GetRecommendationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetRecommendationCommandOutput) => void + ): void; + + /** + * @see {@link ListChecksCommand} + */ + listChecks(args: ListChecksCommandInput, options?: __HttpHandlerOptions): Promise; + listChecks(args: ListChecksCommandInput, cb: (err: any, data?: ListChecksCommandOutput) => void): void; + listChecks( + args: ListChecksCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListChecksCommandOutput) => void + ): void; + + /** + * @see {@link ListOrganizationRecommendationAccountsCommand} + */ + listOrganizationRecommendationAccounts( + args: ListOrganizationRecommendationAccountsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listOrganizationRecommendationAccounts( + args: ListOrganizationRecommendationAccountsCommandInput, + cb: (err: any, data?: ListOrganizationRecommendationAccountsCommandOutput) => void + ): void; + listOrganizationRecommendationAccounts( + args: ListOrganizationRecommendationAccountsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListOrganizationRecommendationAccountsCommandOutput) => void + ): void; + + /** + * @see {@link ListOrganizationRecommendationResourcesCommand} + */ + listOrganizationRecommendationResources( + args: ListOrganizationRecommendationResourcesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listOrganizationRecommendationResources( + args: ListOrganizationRecommendationResourcesCommandInput, + cb: (err: any, data?: ListOrganizationRecommendationResourcesCommandOutput) => void + ): void; + listOrganizationRecommendationResources( + args: ListOrganizationRecommendationResourcesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListOrganizationRecommendationResourcesCommandOutput) => void + ): void; + + /** + * @see {@link ListOrganizationRecommendationsCommand} + */ + listOrganizationRecommendations( + args: ListOrganizationRecommendationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listOrganizationRecommendations( + args: ListOrganizationRecommendationsCommandInput, + cb: (err: any, data?: ListOrganizationRecommendationsCommandOutput) => void + ): void; + listOrganizationRecommendations( + args: ListOrganizationRecommendationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListOrganizationRecommendationsCommandOutput) => void + ): void; + + /** + * @see {@link ListRecommendationResourcesCommand} + */ + listRecommendationResources( + args: ListRecommendationResourcesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listRecommendationResources( + args: ListRecommendationResourcesCommandInput, + cb: (err: any, data?: ListRecommendationResourcesCommandOutput) => void + ): void; + listRecommendationResources( + args: ListRecommendationResourcesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListRecommendationResourcesCommandOutput) => void + ): void; + + /** + * @see {@link ListRecommendationsCommand} + */ + listRecommendations( + args: ListRecommendationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listRecommendations( + args: ListRecommendationsCommandInput, + cb: (err: any, data?: ListRecommendationsCommandOutput) => void + ): void; + listRecommendations( + args: ListRecommendationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListRecommendationsCommandOutput) => void + ): void; + + /** + * @see {@link UpdateOrganizationRecommendationLifecycleCommand} + */ + updateOrganizationRecommendationLifecycle( + args: UpdateOrganizationRecommendationLifecycleCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateOrganizationRecommendationLifecycle( + args: UpdateOrganizationRecommendationLifecycleCommandInput, + cb: (err: any, data?: UpdateOrganizationRecommendationLifecycleCommandOutput) => void + ): void; + updateOrganizationRecommendationLifecycle( + args: UpdateOrganizationRecommendationLifecycleCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateOrganizationRecommendationLifecycleCommandOutput) => void + ): void; + + /** + * @see {@link UpdateRecommendationLifecycleCommand} + */ + updateRecommendationLifecycle( + args: UpdateRecommendationLifecycleCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateRecommendationLifecycle( + args: UpdateRecommendationLifecycleCommandInput, + cb: (err: any, data?: UpdateRecommendationLifecycleCommandOutput) => void + ): void; + updateRecommendationLifecycle( + args: UpdateRecommendationLifecycleCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateRecommendationLifecycleCommandOutput) => void + ): void; +} + +/** + * @public + *

TrustedAdvisor Public API

+ */ +export class TrustedAdvisor extends TrustedAdvisorClient implements TrustedAdvisor {} +createAggregatedClient(commands, TrustedAdvisor); diff --git a/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts b/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts new file mode 100644 index 000000000000..923ed363caa2 --- /dev/null +++ b/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts @@ -0,0 +1,342 @@ +// smithy-typescript generated code +import { + getHostHeaderPlugin, + HostHeaderInputConfig, + HostHeaderResolvedConfig, + resolveHostHeaderConfig, +} from "@aws-sdk/middleware-host-header"; +import { getLoggerPlugin } from "@aws-sdk/middleware-logger"; +import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig, +} from "@aws-sdk/middleware-signing"; +import { + getUserAgentPlugin, + resolveUserAgentConfig, + UserAgentInputConfig, + UserAgentResolvedConfig, +} from "@aws-sdk/middleware-user-agent"; +import { Credentials as __Credentials } from "@aws-sdk/types"; +import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver"; +import { getContentLengthPlugin } from "@smithy/middleware-content-length"; +import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint"; +import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry"; +import { HttpHandler as __HttpHandler } from "@smithy/protocol-http"; +import { + Client as __Client, + DefaultsMode as __DefaultsMode, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration, +} from "@smithy/smithy-client"; +import { + BodyLengthCalculator as __BodyLengthCalculator, + CheckOptionalClientConfig as __CheckOptionalClientConfig, + Checksum as __Checksum, + ChecksumConstructor as __ChecksumConstructor, + Decoder as __Decoder, + Encoder as __Encoder, + EndpointV2 as __EndpointV2, + Hash as __Hash, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Logger as __Logger, + Provider as __Provider, + Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser, + UserAgent as __UserAgent, +} from "@smithy/types"; + +import { + GetOrganizationRecommendationCommandInput, + GetOrganizationRecommendationCommandOutput, +} from "./commands/GetOrganizationRecommendationCommand"; +import { GetRecommendationCommandInput, GetRecommendationCommandOutput } from "./commands/GetRecommendationCommand"; +import { ListChecksCommandInput, ListChecksCommandOutput } from "./commands/ListChecksCommand"; +import { + ListOrganizationRecommendationAccountsCommandInput, + ListOrganizationRecommendationAccountsCommandOutput, +} from "./commands/ListOrganizationRecommendationAccountsCommand"; +import { + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput, +} from "./commands/ListOrganizationRecommendationResourcesCommand"; +import { + ListOrganizationRecommendationsCommandInput, + ListOrganizationRecommendationsCommandOutput, +} from "./commands/ListOrganizationRecommendationsCommand"; +import { + ListRecommendationResourcesCommandInput, + ListRecommendationResourcesCommandOutput, +} from "./commands/ListRecommendationResourcesCommand"; +import { + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, +} from "./commands/ListRecommendationsCommand"; +import { + UpdateOrganizationRecommendationLifecycleCommandInput, + UpdateOrganizationRecommendationLifecycleCommandOutput, +} from "./commands/UpdateOrganizationRecommendationLifecycleCommand"; +import { + UpdateRecommendationLifecycleCommandInput, + UpdateRecommendationLifecycleCommandOutput, +} from "./commands/UpdateRecommendationLifecycleCommand"; +import { + ClientInputEndpointParameters, + ClientResolvedEndpointParameters, + EndpointParameters, + resolveClientEndpointParameters, +} from "./endpoint/EndpointParameters"; +import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; +import { resolveRuntimeExtensions, RuntimeExtension, RuntimeExtensionsConfig } from "./runtimeExtensions"; + +export { __Client }; + +/** + * @public + */ +export type ServiceInputTypes = + | GetOrganizationRecommendationCommandInput + | GetRecommendationCommandInput + | ListChecksCommandInput + | ListOrganizationRecommendationAccountsCommandInput + | ListOrganizationRecommendationResourcesCommandInput + | ListOrganizationRecommendationsCommandInput + | ListRecommendationResourcesCommandInput + | ListRecommendationsCommandInput + | UpdateOrganizationRecommendationLifecycleCommandInput + | UpdateRecommendationLifecycleCommandInput; + +/** + * @public + */ +export type ServiceOutputTypes = + | GetOrganizationRecommendationCommandOutput + | GetRecommendationCommandOutput + | ListChecksCommandOutput + | ListOrganizationRecommendationAccountsCommandOutput + | ListOrganizationRecommendationResourcesCommandOutput + | ListOrganizationRecommendationsCommandOutput + | ListRecommendationResourcesCommandOutput + | ListRecommendationsCommandOutput + | UpdateOrganizationRecommendationLifecycleCommandOutput + | UpdateRecommendationLifecycleCommandOutput; + +/** + * @public + */ +export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + + /** + * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor} interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + * @internal + */ + sha256?: __ChecksumConstructor | __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + * @internal + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + * @internal + */ + bodyLengthChecker?: __BodyLengthCalculator; + + /** + * A function that converts a stream into an array of bytes. + * @internal + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array. + * @internal + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string. + * @internal + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array. + * @internal + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string. + * @internal + */ + utf8Encoder?: __Encoder; + + /** + * The runtime environment. + * @internal + */ + runtime?: string; + + /** + * Disable dynamically changing the endpoint of the client based on the hostPrefix + * trait of an operation. + */ + disableHostPrefix?: boolean; + + /** + * Unique service identifier. + * @internal + */ + serviceId?: string; + + /** + * Enables IPv6/IPv4 dualstack endpoint. + */ + useDualstackEndpoint?: boolean | __Provider; + + /** + * Enables FIPS compatible endpoints. + */ + useFipsEndpoint?: boolean | __Provider; + + /** + * The AWS region to which this client will send requests + */ + region?: string | __Provider; + + /** + * Default credentials provider; Not available in browser runtime. + * @internal + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header + * @internal + */ + defaultUserAgentProvider?: Provider<__UserAgent>; + + /** + * Value for how many times a request will be made at most in case of retry. + */ + maxAttempts?: number | __Provider; + + /** + * Specifies which retry algorithm to use. + * @see https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-smithy-util-retry/Enum/RETRY_MODES/ + * + */ + retryMode?: string | __Provider; + + /** + * Optional logger for logging debug/info/warn/error. + */ + logger?: __Logger; + + /** + * Optional extensions + */ + extensions?: RuntimeExtension[]; + + /** + * The {@link @smithy/smithy-client#DefaultsMode} that will be used to determine how certain default configuration options are resolved in the SDK. + */ + defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>; +} + +/** + * @public + */ +export type TrustedAdvisorClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & + ClientDefaults & + RegionInputConfig & + EndpointInputConfig & + RetryInputConfig & + HostHeaderInputConfig & + AwsAuthInputConfig & + UserAgentInputConfig & + ClientInputEndpointParameters; +/** + * @public + * + * The configuration interface of TrustedAdvisorClient class constructor that set the region, credentials and other options. + */ +export interface TrustedAdvisorClientConfig extends TrustedAdvisorClientConfigType {} + +/** + * @public + */ +export type TrustedAdvisorClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & + Required & + RuntimeExtensionsConfig & + RegionResolvedConfig & + EndpointResolvedConfig & + RetryResolvedConfig & + HostHeaderResolvedConfig & + AwsAuthResolvedConfig & + UserAgentResolvedConfig & + ClientResolvedEndpointParameters; +/** + * @public + * + * The resolved configuration interface of TrustedAdvisorClient class. This is resolved and normalized from the {@link TrustedAdvisorClientConfig | constructor configuration interface}. + */ +export interface TrustedAdvisorClientResolvedConfig extends TrustedAdvisorClientResolvedConfigType {} + +/** + * @public + *

TrustedAdvisor Public API

+ */ +export class TrustedAdvisorClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + TrustedAdvisorClientResolvedConfig +> { + /** + * The resolved configuration of TrustedAdvisorClient class. This is resolved and normalized from the {@link TrustedAdvisorClientConfig | constructor configuration interface}. + */ + readonly config: TrustedAdvisorClientResolvedConfig; + + constructor(...[configuration]: __CheckOptionalClientConfig) { + const _config_0 = __getRuntimeConfig(configuration || {}); + const _config_1 = resolveClientEndpointParameters(_config_0); + const _config_2 = resolveRegionConfig(_config_1); + const _config_3 = resolveEndpointConfig(_config_2); + const _config_4 = resolveRetryConfig(_config_3); + const _config_5 = resolveHostHeaderConfig(_config_4); + const _config_6 = resolveAwsAuthConfig(_config_5); + const _config_7 = resolveUserAgentConfig(_config_6); + const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []); + super(_config_8); + this.config = _config_8; + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + this.middlewareStack.use(getLoggerPlugin(this.config)); + this.middlewareStack.use(getRecursionDetectionPlugin(this.config)); + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + } + + /** + * Destroy underlying resources, like sockets. It's usually not necessary to do this. + * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. + * Otherwise, sockets might stay open for quite a long time before the server terminates them. + */ + destroy(): void { + super.destroy(); + } +} diff --git a/clients/client-trustedadvisor/src/commands/GetOrganizationRecommendationCommand.ts b/clients/client-trustedadvisor/src/commands/GetOrganizationRecommendationCommand.ts new file mode 100644 index 000000000000..d111c2f38980 --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/GetOrganizationRecommendationCommand.ts @@ -0,0 +1,203 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + GetOrganizationRecommendationRequest, + GetOrganizationRecommendationResponse, + GetOrganizationRecommendationResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_GetOrganizationRecommendationCommand, + se_GetOrganizationRecommendationCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetOrganizationRecommendationCommand}. + */ +export interface GetOrganizationRecommendationCommandInput extends GetOrganizationRecommendationRequest {} +/** + * @public + * + * The output of {@link GetOrganizationRecommendationCommand}. + */ +export interface GetOrganizationRecommendationCommandOutput + extends GetOrganizationRecommendationResponse, + __MetadataBearer {} + +/** + * @public + *

Get a specific recommendation within an AWS Organizations organization. This API supports only prioritized + * recommendations. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, GetOrganizationRecommendationCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, GetOrganizationRecommendationCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // GetOrganizationRecommendationRequest + * organizationRecommendationIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetOrganizationRecommendationCommand(input); + * const response = await client.send(command); + * // { // GetOrganizationRecommendationResponse + * // organizationRecommendation: { // OrganizationRecommendation + * // id: "STRING_VALUE", // required + * // type: "standard" || "priority", // required + * // checkArn: "STRING_VALUE", + * // status: "ok" || "warning" || "error", // required + * // lifecycleStage: "in_progress" || "pending_response" || "dismissed" || "resolved", + * // pillars: [ // RecommendationPillarList // required + * // "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * // ], + * // source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", // required + * // awsServices: [ // RecommendationAwsServiceList + * // "STRING_VALUE", + * // ], + * // name: "STRING_VALUE", // required + * // resourcesAggregates: { // RecommendationResourcesAggregates + * // okCount: Number("long"), // required + * // warningCount: Number("long"), // required + * // errorCount: Number("long"), // required + * // }, + * // pillarSpecificAggregates: { // RecommendationPillarSpecificAggregates + * // costOptimizing: { // RecommendationCostOptimizingAggregates + * // estimatedMonthlySavings: Number("double"), // required + * // estimatedPercentMonthlySavings: Number("double"), // required + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), + * // lastUpdatedAt: new Date("TIMESTAMP"), + * // arn: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // createdBy: "STRING_VALUE", + * // updatedOnBehalfOf: "STRING_VALUE", + * // updatedOnBehalfOfJobTitle: "STRING_VALUE", + * // updateReason: "STRING_VALUE", + * // updateReasonCode: "non_critical_account" || "temporary_account" || "valid_business_case" || "other_methods_available" || "low_priority" || "not_applicable" || "other", + * // resolvedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param GetOrganizationRecommendationCommandInput - {@link GetOrganizationRecommendationCommandInput} + * @returns {@link GetOrganizationRecommendationCommandOutput} + * @see {@link GetOrganizationRecommendationCommandInput} for command's `input` shape. + * @see {@link GetOrganizationRecommendationCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class GetOrganizationRecommendationCommand extends $Command< + GetOrganizationRecommendationCommandInput, + GetOrganizationRecommendationCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetOrganizationRecommendationCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetOrganizationRecommendationCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "GetOrganizationRecommendationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetOrganizationRecommendationResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "GetOrganizationRecommendation", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetOrganizationRecommendationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetOrganizationRecommendationCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_GetOrganizationRecommendationCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/GetRecommendationCommand.ts b/clients/client-trustedadvisor/src/commands/GetRecommendationCommand.ts new file mode 100644 index 000000000000..f14cdaab723a --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/GetRecommendationCommand.ts @@ -0,0 +1,193 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + GetRecommendationRequest, + GetRecommendationResponse, + GetRecommendationResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_GetRecommendationCommand, se_GetRecommendationCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link GetRecommendationCommand}. + */ +export interface GetRecommendationCommandInput extends GetRecommendationRequest {} +/** + * @public + * + * The output of {@link GetRecommendationCommand}. + */ +export interface GetRecommendationCommandOutput extends GetRecommendationResponse, __MetadataBearer {} + +/** + * @public + *

Get a specific Recommendation

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, GetRecommendationCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, GetRecommendationCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // GetRecommendationRequest + * recommendationIdentifier: "STRING_VALUE", // required + * }; + * const command = new GetRecommendationCommand(input); + * const response = await client.send(command); + * // { // GetRecommendationResponse + * // recommendation: { // Recommendation + * // id: "STRING_VALUE", // required + * // type: "standard" || "priority", // required + * // checkArn: "STRING_VALUE", + * // status: "ok" || "warning" || "error", // required + * // lifecycleStage: "in_progress" || "pending_response" || "dismissed" || "resolved", + * // pillars: [ // RecommendationPillarList // required + * // "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * // ], + * // source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", // required + * // awsServices: [ // RecommendationAwsServiceList + * // "STRING_VALUE", + * // ], + * // name: "STRING_VALUE", // required + * // resourcesAggregates: { // RecommendationResourcesAggregates + * // okCount: Number("long"), // required + * // warningCount: Number("long"), // required + * // errorCount: Number("long"), // required + * // }, + * // pillarSpecificAggregates: { // RecommendationPillarSpecificAggregates + * // costOptimizing: { // RecommendationCostOptimizingAggregates + * // estimatedMonthlySavings: Number("double"), // required + * // estimatedPercentMonthlySavings: Number("double"), // required + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), + * // lastUpdatedAt: new Date("TIMESTAMP"), + * // arn: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // createdBy: "STRING_VALUE", + * // updatedOnBehalfOf: "STRING_VALUE", + * // updatedOnBehalfOfJobTitle: "STRING_VALUE", + * // updateReason: "STRING_VALUE", + * // updateReasonCode: "non_critical_account" || "temporary_account" || "valid_business_case" || "other_methods_available" || "low_priority" || "not_applicable" || "other", + * // resolvedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param GetRecommendationCommandInput - {@link GetRecommendationCommandInput} + * @returns {@link GetRecommendationCommandOutput} + * @see {@link GetRecommendationCommandInput} for command's `input` shape. + * @see {@link GetRecommendationCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class GetRecommendationCommand extends $Command< + GetRecommendationCommandInput, + GetRecommendationCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: GetRecommendationCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, GetRecommendationCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "GetRecommendationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: GetRecommendationResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "GetRecommendation", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: GetRecommendationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_GetRecommendationCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_GetRecommendationCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListChecksCommand.ts b/clients/client-trustedadvisor/src/commands/ListChecksCommand.ts new file mode 100644 index 000000000000..bd63070d4eff --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListChecksCommand.ts @@ -0,0 +1,172 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListChecksRequest, ListChecksResponse } from "../models/models_0"; +import { de_ListChecksCommand, se_ListChecksCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListChecksCommand}. + */ +export interface ListChecksCommandInput extends ListChecksRequest {} +/** + * @public + * + * The output of {@link ListChecksCommand}. + */ +export interface ListChecksCommandOutput extends ListChecksResponse, __MetadataBearer {} + +/** + * @public + *

List a filterable set of Checks

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListChecksCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListChecksCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListChecksRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * pillar: "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * awsService: "STRING_VALUE", + * source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", + * language: "en" || "ja" || "zh" || "fr" || "de" || "ko" || "zh_TW" || "it" || "es" || "pt_BR" || "id", + * }; + * const command = new ListChecksCommand(input); + * const response = await client.send(command); + * // { // ListChecksResponse + * // nextToken: "STRING_VALUE", + * // checkSummaries: [ // CheckSummaryList // required + * // { // CheckSummary + * // id: "STRING_VALUE", // required + * // arn: "STRING_VALUE", // required + * // name: "STRING_VALUE", // required + * // description: "STRING_VALUE", // required + * // pillars: [ // RecommendationPillarList // required + * // "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * // ], + * // awsServices: [ // RecommendationAwsServiceList // required + * // "STRING_VALUE", + * // ], + * // source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", // required + * // metadata: { // StringMap // required + * // "": "STRING_VALUE", + * // }, + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListChecksCommandInput - {@link ListChecksCommandInput} + * @returns {@link ListChecksCommandOutput} + * @see {@link ListChecksCommandInput} for command's `input` shape. + * @see {@link ListChecksCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListChecksCommand extends $Command< + ListChecksCommandInput, + ListChecksCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListChecksCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, ListChecksCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListChecksCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListChecks", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListChecksCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListChecksCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListChecksCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationAccountsCommand.ts b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationAccountsCommand.ts new file mode 100644 index 000000000000..8d9ddc267a1d --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationAccountsCommand.ts @@ -0,0 +1,187 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + ListOrganizationRecommendationAccountsRequest, + ListOrganizationRecommendationAccountsResponse, + ListOrganizationRecommendationAccountsResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_ListOrganizationRecommendationAccountsCommand, + se_ListOrganizationRecommendationAccountsCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListOrganizationRecommendationAccountsCommand}. + */ +export interface ListOrganizationRecommendationAccountsCommandInput + extends ListOrganizationRecommendationAccountsRequest {} +/** + * @public + * + * The output of {@link ListOrganizationRecommendationAccountsCommand}. + */ +export interface ListOrganizationRecommendationAccountsCommandOutput + extends ListOrganizationRecommendationAccountsResponse, + __MetadataBearer {} + +/** + * @public + *

Lists the accounts that own the resources for an organization aggregate recommendation. This API only + * supports prioritized recommendations. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListOrganizationRecommendationAccountsCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListOrganizationRecommendationAccountsCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListOrganizationRecommendationAccountsRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * organizationRecommendationIdentifier: "STRING_VALUE", // required + * affectedAccountId: "STRING_VALUE", + * }; + * const command = new ListOrganizationRecommendationAccountsCommand(input); + * const response = await client.send(command); + * // { // ListOrganizationRecommendationAccountsResponse + * // nextToken: "STRING_VALUE", + * // accountRecommendationLifecycleSummaries: [ // AccountRecommendationLifecycleSummaryList // required + * // { // AccountRecommendationLifecycleSummary + * // accountId: "STRING_VALUE", + * // accountRecommendationArn: "STRING_VALUE", + * // lifecycleStage: "in_progress" || "pending_response" || "dismissed" || "resolved", + * // updatedOnBehalfOf: "STRING_VALUE", + * // updatedOnBehalfOfJobTitle: "STRING_VALUE", + * // updateReason: "STRING_VALUE", + * // updateReasonCode: "non_critical_account" || "temporary_account" || "valid_business_case" || "other_methods_available" || "low_priority" || "not_applicable" || "other", + * // lastUpdatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListOrganizationRecommendationAccountsCommandInput - {@link ListOrganizationRecommendationAccountsCommandInput} + * @returns {@link ListOrganizationRecommendationAccountsCommandOutput} + * @see {@link ListOrganizationRecommendationAccountsCommandInput} for command's `input` shape. + * @see {@link ListOrganizationRecommendationAccountsCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListOrganizationRecommendationAccountsCommand extends $Command< + ListOrganizationRecommendationAccountsCommandInput, + ListOrganizationRecommendationAccountsCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListOrganizationRecommendationAccountsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListOrganizationRecommendationAccountsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListOrganizationRecommendationAccountsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: ListOrganizationRecommendationAccountsResponseFilterSensitiveLog, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListOrganizationRecommendationAccounts", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: ListOrganizationRecommendationAccountsCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_ListOrganizationRecommendationAccountsCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_ListOrganizationRecommendationAccountsCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationResourcesCommand.ts b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationResourcesCommand.ts new file mode 100644 index 000000000000..fdfa5782fc34 --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationResourcesCommand.ts @@ -0,0 +1,197 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + ListOrganizationRecommendationResourcesRequest, + ListOrganizationRecommendationResourcesResponse, +} from "../models/models_0"; +import { + de_ListOrganizationRecommendationResourcesCommand, + se_ListOrganizationRecommendationResourcesCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListOrganizationRecommendationResourcesCommand}. + */ +export interface ListOrganizationRecommendationResourcesCommandInput + extends ListOrganizationRecommendationResourcesRequest {} +/** + * @public + * + * The output of {@link ListOrganizationRecommendationResourcesCommand}. + */ +export interface ListOrganizationRecommendationResourcesCommandOutput + extends ListOrganizationRecommendationResourcesResponse, + __MetadataBearer {} + +/** + * @public + *

List Resources of a Recommendation within an Organization. This API only supports prioritized + * recommendations. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListOrganizationRecommendationResourcesCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListOrganizationRecommendationResourcesCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListOrganizationRecommendationResourcesRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * status: "ok" || "warning" || "error", + * regionCode: "STRING_VALUE", + * organizationRecommendationIdentifier: "STRING_VALUE", // required + * affectedAccountId: "STRING_VALUE", + * }; + * const command = new ListOrganizationRecommendationResourcesCommand(input); + * const response = await client.send(command); + * // { // ListOrganizationRecommendationResourcesResponse + * // nextToken: "STRING_VALUE", + * // organizationRecommendationResourceSummaries: [ // OrganizationRecommendationResourceSummaryList // required + * // { // OrganizationRecommendationResourceSummary + * // id: "STRING_VALUE", // required + * // arn: "STRING_VALUE", // required + * // awsResourceId: "STRING_VALUE", // required + * // regionCode: "STRING_VALUE", // required + * // status: "ok" || "warning" || "error", // required + * // metadata: { // StringMap // required + * // "": "STRING_VALUE", + * // }, + * // lastUpdatedAt: new Date("TIMESTAMP"), // required + * // accountId: "STRING_VALUE", + * // recommendationArn: "STRING_VALUE", // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListOrganizationRecommendationResourcesCommandInput - {@link ListOrganizationRecommendationResourcesCommandInput} + * @returns {@link ListOrganizationRecommendationResourcesCommandOutput} + * @see {@link ListOrganizationRecommendationResourcesCommandInput} for command's `input` shape. + * @see {@link ListOrganizationRecommendationResourcesCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListOrganizationRecommendationResourcesCommand extends $Command< + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListOrganizationRecommendationResourcesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput + > { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin( + configuration, + ListOrganizationRecommendationResourcesCommand.getEndpointParameterInstructions() + ) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListOrganizationRecommendationResourcesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListOrganizationRecommendationResources", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: ListOrganizationRecommendationResourcesCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_ListOrganizationRecommendationResourcesCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_ListOrganizationRecommendationResourcesCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationsCommand.ts b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationsCommand.ts new file mode 100644 index 000000000000..5d579345fae4 --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListOrganizationRecommendationsCommand.ts @@ -0,0 +1,204 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListOrganizationRecommendationsRequest, ListOrganizationRecommendationsResponse } from "../models/models_0"; +import { + de_ListOrganizationRecommendationsCommand, + se_ListOrganizationRecommendationsCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListOrganizationRecommendationsCommand}. + */ +export interface ListOrganizationRecommendationsCommandInput extends ListOrganizationRecommendationsRequest {} +/** + * @public + * + * The output of {@link ListOrganizationRecommendationsCommand}. + */ +export interface ListOrganizationRecommendationsCommandOutput + extends ListOrganizationRecommendationsResponse, + __MetadataBearer {} + +/** + * @public + *

List a filterable set of Recommendations within an Organization. This API only supports prioritized + * recommendations. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListOrganizationRecommendationsCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListOrganizationRecommendationsCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListOrganizationRecommendationsRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * type: "standard" || "priority", + * status: "ok" || "warning" || "error", + * pillar: "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * awsService: "STRING_VALUE", + * source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", + * checkIdentifier: "STRING_VALUE", + * afterLastUpdatedAt: new Date("TIMESTAMP"), + * beforeLastUpdatedAt: new Date("TIMESTAMP"), + * }; + * const command = new ListOrganizationRecommendationsCommand(input); + * const response = await client.send(command); + * // { // ListOrganizationRecommendationsResponse + * // nextToken: "STRING_VALUE", + * // organizationRecommendationSummaries: [ // OrganizationRecommendationSummaryList // required + * // { // OrganizationRecommendationSummary + * // id: "STRING_VALUE", // required + * // type: "standard" || "priority", // required + * // checkArn: "STRING_VALUE", + * // status: "ok" || "warning" || "error", // required + * // lifecycleStage: "in_progress" || "pending_response" || "dismissed" || "resolved", + * // pillars: [ // RecommendationPillarList // required + * // "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * // ], + * // source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", // required + * // awsServices: [ // RecommendationAwsServiceList + * // "STRING_VALUE", + * // ], + * // name: "STRING_VALUE", // required + * // resourcesAggregates: { // RecommendationResourcesAggregates + * // okCount: Number("long"), // required + * // warningCount: Number("long"), // required + * // errorCount: Number("long"), // required + * // }, + * // pillarSpecificAggregates: { // RecommendationPillarSpecificAggregates + * // costOptimizing: { // RecommendationCostOptimizingAggregates + * // estimatedMonthlySavings: Number("double"), // required + * // estimatedPercentMonthlySavings: Number("double"), // required + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), + * // lastUpdatedAt: new Date("TIMESTAMP"), + * // arn: "STRING_VALUE", // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListOrganizationRecommendationsCommandInput - {@link ListOrganizationRecommendationsCommandInput} + * @returns {@link ListOrganizationRecommendationsCommandOutput} + * @see {@link ListOrganizationRecommendationsCommandInput} for command's `input` shape. + * @see {@link ListOrganizationRecommendationsCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListOrganizationRecommendationsCommand extends $Command< + ListOrganizationRecommendationsCommandInput, + ListOrganizationRecommendationsCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListOrganizationRecommendationsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListOrganizationRecommendationsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListOrganizationRecommendationsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListOrganizationRecommendations", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: ListOrganizationRecommendationsCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_ListOrganizationRecommendationsCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_ListOrganizationRecommendationsCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListRecommendationResourcesCommand.ts b/clients/client-trustedadvisor/src/commands/ListRecommendationResourcesCommand.ts new file mode 100644 index 000000000000..c6cd63320c79 --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListRecommendationResourcesCommand.ts @@ -0,0 +1,180 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListRecommendationResourcesRequest, ListRecommendationResourcesResponse } from "../models/models_0"; +import { + de_ListRecommendationResourcesCommand, + se_ListRecommendationResourcesCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListRecommendationResourcesCommand}. + */ +export interface ListRecommendationResourcesCommandInput extends ListRecommendationResourcesRequest {} +/** + * @public + * + * The output of {@link ListRecommendationResourcesCommand}. + */ +export interface ListRecommendationResourcesCommandOutput + extends ListRecommendationResourcesResponse, + __MetadataBearer {} + +/** + * @public + *

List Resources of a Recommendation

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListRecommendationResourcesCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListRecommendationResourcesCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListRecommendationResourcesRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * status: "ok" || "warning" || "error", + * regionCode: "STRING_VALUE", + * recommendationIdentifier: "STRING_VALUE", // required + * }; + * const command = new ListRecommendationResourcesCommand(input); + * const response = await client.send(command); + * // { // ListRecommendationResourcesResponse + * // nextToken: "STRING_VALUE", + * // recommendationResourceSummaries: [ // RecommendationResourceSummaryList // required + * // { // RecommendationResourceSummary + * // id: "STRING_VALUE", // required + * // arn: "STRING_VALUE", // required + * // awsResourceId: "STRING_VALUE", // required + * // regionCode: "STRING_VALUE", // required + * // status: "ok" || "warning" || "error", // required + * // metadata: { // StringMap // required + * // "": "STRING_VALUE", + * // }, + * // lastUpdatedAt: new Date("TIMESTAMP"), // required + * // recommendationArn: "STRING_VALUE", // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListRecommendationResourcesCommandInput - {@link ListRecommendationResourcesCommandInput} + * @returns {@link ListRecommendationResourcesCommandOutput} + * @see {@link ListRecommendationResourcesCommandInput} for command's `input` shape. + * @see {@link ListRecommendationResourcesCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListRecommendationResourcesCommand extends $Command< + ListRecommendationResourcesCommandInput, + ListRecommendationResourcesCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListRecommendationResourcesCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListRecommendationResourcesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListRecommendationResourcesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListRecommendationResources", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListRecommendationResourcesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListRecommendationResourcesCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_ListRecommendationResourcesCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/ListRecommendationsCommand.ts b/clients/client-trustedadvisor/src/commands/ListRecommendationsCommand.ts new file mode 100644 index 000000000000..d91660e8a55b --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/ListRecommendationsCommand.ts @@ -0,0 +1,191 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { ListRecommendationsRequest, ListRecommendationsResponse } from "../models/models_0"; +import { de_ListRecommendationsCommand, se_ListRecommendationsCommand } from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ListRecommendationsCommand}. + */ +export interface ListRecommendationsCommandInput extends ListRecommendationsRequest {} +/** + * @public + * + * The output of {@link ListRecommendationsCommand}. + */ +export interface ListRecommendationsCommandOutput extends ListRecommendationsResponse, __MetadataBearer {} + +/** + * @public + *

List a filterable set of Recommendations

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, ListRecommendationsCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, ListRecommendationsCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // ListRecommendationsRequest + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * type: "standard" || "priority", + * status: "ok" || "warning" || "error", + * pillar: "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * awsService: "STRING_VALUE", + * source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", + * checkIdentifier: "STRING_VALUE", + * afterLastUpdatedAt: new Date("TIMESTAMP"), + * beforeLastUpdatedAt: new Date("TIMESTAMP"), + * }; + * const command = new ListRecommendationsCommand(input); + * const response = await client.send(command); + * // { // ListRecommendationsResponse + * // nextToken: "STRING_VALUE", + * // recommendationSummaries: [ // RecommendationSummaryList // required + * // { // RecommendationSummary + * // id: "STRING_VALUE", // required + * // type: "standard" || "priority", // required + * // checkArn: "STRING_VALUE", + * // status: "ok" || "warning" || "error", // required + * // lifecycleStage: "in_progress" || "pending_response" || "dismissed" || "resolved", + * // pillars: [ // RecommendationPillarList // required + * // "cost_optimizing" || "performance" || "security" || "service_limits" || "fault_tolerance" || "operational_excellence", + * // ], + * // source: "aws_config" || "compute_optimizer" || "cost_explorer" || "lse" || "manual" || "pse" || "rds" || "resilience" || "resilience_hub" || "security_hub" || "stir" || "ta_check" || "well_architected", // required + * // awsServices: [ // RecommendationAwsServiceList + * // "STRING_VALUE", + * // ], + * // name: "STRING_VALUE", // required + * // resourcesAggregates: { // RecommendationResourcesAggregates + * // okCount: Number("long"), // required + * // warningCount: Number("long"), // required + * // errorCount: Number("long"), // required + * // }, + * // pillarSpecificAggregates: { // RecommendationPillarSpecificAggregates + * // costOptimizing: { // RecommendationCostOptimizingAggregates + * // estimatedMonthlySavings: Number("double"), // required + * // estimatedPercentMonthlySavings: Number("double"), // required + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), + * // lastUpdatedAt: new Date("TIMESTAMP"), + * // arn: "STRING_VALUE", // required + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListRecommendationsCommandInput - {@link ListRecommendationsCommandInput} + * @returns {@link ListRecommendationsCommandOutput} + * @see {@link ListRecommendationsCommandInput} for command's `input` shape. + * @see {@link ListRecommendationsCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class ListRecommendationsCommand extends $Command< + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: ListRecommendationsCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, ListRecommendationsCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "ListRecommendationsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "ListRecommendations", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: ListRecommendationsCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_ListRecommendationsCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_ListRecommendationsCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/UpdateOrganizationRecommendationLifecycleCommand.ts b/clients/client-trustedadvisor/src/commands/UpdateOrganizationRecommendationLifecycleCommand.ts new file mode 100644 index 000000000000..8a033203313b --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/UpdateOrganizationRecommendationLifecycleCommand.ts @@ -0,0 +1,179 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + UpdateOrganizationRecommendationLifecycleRequest, + UpdateOrganizationRecommendationLifecycleRequestFilterSensitiveLog, +} from "../models/models_0"; +import { + de_UpdateOrganizationRecommendationLifecycleCommand, + se_UpdateOrganizationRecommendationLifecycleCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateOrganizationRecommendationLifecycleCommand}. + */ +export interface UpdateOrganizationRecommendationLifecycleCommandInput + extends UpdateOrganizationRecommendationLifecycleRequest {} +/** + * @public + * + * The output of {@link UpdateOrganizationRecommendationLifecycleCommand}. + */ +export interface UpdateOrganizationRecommendationLifecycleCommandOutput extends __MetadataBearer {} + +/** + * @public + *

Update the lifecyle of a Recommendation within an Organization. This API only supports prioritized + * recommendations. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, UpdateOrganizationRecommendationLifecycleCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, UpdateOrganizationRecommendationLifecycleCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // UpdateOrganizationRecommendationLifecycleRequest + * lifecycleStage: "pending_response" || "in_progress" || "dismissed" || "resolved", // required + * updateReason: "STRING_VALUE", + * updateReasonCode: "non_critical_account" || "temporary_account" || "valid_business_case" || "other_methods_available" || "low_priority" || "not_applicable" || "other", + * organizationRecommendationIdentifier: "STRING_VALUE", // required + * }; + * const command = new UpdateOrganizationRecommendationLifecycleCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UpdateOrganizationRecommendationLifecycleCommandInput - {@link UpdateOrganizationRecommendationLifecycleCommandInput} + * @returns {@link UpdateOrganizationRecommendationLifecycleCommandOutput} + * @see {@link UpdateOrganizationRecommendationLifecycleCommandInput} for command's `input` shape. + * @see {@link UpdateOrganizationRecommendationLifecycleCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link ConflictException} (client fault) + *

Exception that the request was denied due to conflictions in state

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class UpdateOrganizationRecommendationLifecycleCommand extends $Command< + UpdateOrganizationRecommendationLifecycleCommandInput, + UpdateOrganizationRecommendationLifecycleCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateOrganizationRecommendationLifecycleCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + UpdateOrganizationRecommendationLifecycleCommandInput, + UpdateOrganizationRecommendationLifecycleCommandOutput + > { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin( + configuration, + UpdateOrganizationRecommendationLifecycleCommand.getEndpointParameterInstructions() + ) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "UpdateOrganizationRecommendationLifecycleCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateOrganizationRecommendationLifecycleRequestFilterSensitiveLog, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "UpdateOrganizationRecommendationLifecycle", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: UpdateOrganizationRecommendationLifecycleCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_UpdateOrganizationRecommendationLifecycleCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateOrganizationRecommendationLifecycleCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/UpdateRecommendationLifecycleCommand.ts b/clients/client-trustedadvisor/src/commands/UpdateRecommendationLifecycleCommand.ts new file mode 100644 index 000000000000..6b3afba2acb0 --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/UpdateRecommendationLifecycleCommand.ts @@ -0,0 +1,167 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { + UpdateRecommendationLifecycleRequest, + UpdateRecommendationLifecycleRequestFilterSensitiveLog, +} from "../models/models_0"; +import { + de_UpdateRecommendationLifecycleCommand, + se_UpdateRecommendationLifecycleCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link UpdateRecommendationLifecycleCommand}. + */ +export interface UpdateRecommendationLifecycleCommandInput extends UpdateRecommendationLifecycleRequest {} +/** + * @public + * + * The output of {@link UpdateRecommendationLifecycleCommand}. + */ +export interface UpdateRecommendationLifecycleCommandOutput extends __MetadataBearer {} + +/** + * @public + *

Update the lifecyle of a Recommendation. This API only supports prioritized recommendations.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { TrustedAdvisorClient, UpdateRecommendationLifecycleCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import + * // const { TrustedAdvisorClient, UpdateRecommendationLifecycleCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import + * const client = new TrustedAdvisorClient(config); + * const input = { // UpdateRecommendationLifecycleRequest + * lifecycleStage: "pending_response" || "in_progress" || "dismissed" || "resolved", // required + * updateReason: "STRING_VALUE", + * updateReasonCode: "non_critical_account" || "temporary_account" || "valid_business_case" || "other_methods_available" || "low_priority" || "not_applicable" || "other", + * recommendationIdentifier: "STRING_VALUE", // required + * }; + * const command = new UpdateRecommendationLifecycleCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UpdateRecommendationLifecycleCommandInput - {@link UpdateRecommendationLifecycleCommandInput} + * @returns {@link UpdateRecommendationLifecycleCommandOutput} + * @see {@link UpdateRecommendationLifecycleCommandInput} for command's `input` shape. + * @see {@link UpdateRecommendationLifecycleCommandOutput} for command's `response` shape. + * @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

Exception that access has been denied due to insufficient access

+ * + * @throws {@link ConflictException} (client fault) + *

Exception that the request was denied due to conflictions in state

+ * + * @throws {@link InternalServerException} (server fault) + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

Exception that the requested resource has not been found

+ * + * @throws {@link ThrottlingException} (client fault) + *

Exception to notify that requests are being throttled

+ * + * @throws {@link ValidationException} (client fault) + *

Exception that the request failed to satisfy service constraints

+ * + * @throws {@link TrustedAdvisorServiceException} + *

Base exception class for all service exceptions from TrustedAdvisor service.

+ * + */ +export class UpdateRecommendationLifecycleCommand extends $Command< + UpdateRecommendationLifecycleCommandInput, + UpdateRecommendationLifecycleCommandOutput, + TrustedAdvisorClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateRecommendationLifecycleCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: TrustedAdvisorClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateRecommendationLifecycleCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "TrustedAdvisorClient"; + const commandName = "UpdateRecommendationLifecycleCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateRecommendationLifecycleRequestFilterSensitiveLog, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "TrustedAdvisor", + operation: "UpdateRecommendationLifecycle", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: UpdateRecommendationLifecycleCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_UpdateRecommendationLifecycleCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateRecommendationLifecycleCommand(output, context); + } +} diff --git a/clients/client-trustedadvisor/src/commands/index.ts b/clients/client-trustedadvisor/src/commands/index.ts new file mode 100644 index 000000000000..5d05b3e1dd7f --- /dev/null +++ b/clients/client-trustedadvisor/src/commands/index.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +export * from "./GetOrganizationRecommendationCommand"; +export * from "./GetRecommendationCommand"; +export * from "./ListChecksCommand"; +export * from "./ListOrganizationRecommendationAccountsCommand"; +export * from "./ListOrganizationRecommendationResourcesCommand"; +export * from "./ListOrganizationRecommendationsCommand"; +export * from "./ListRecommendationResourcesCommand"; +export * from "./ListRecommendationsCommand"; +export * from "./UpdateOrganizationRecommendationLifecycleCommand"; +export * from "./UpdateRecommendationLifecycleCommand"; diff --git a/clients/client-trustedadvisor/src/endpoint/EndpointParameters.ts b/clients/client-trustedadvisor/src/endpoint/EndpointParameters.ts new file mode 100644 index 000000000000..6a6205829bab --- /dev/null +++ b/clients/client-trustedadvisor/src/endpoint/EndpointParameters.ts @@ -0,0 +1,34 @@ +// smithy-typescript generated code +import { Endpoint, EndpointParameters as __EndpointParameters, EndpointV2, Provider } from "@smithy/types"; + +/** + * @public + */ +export interface ClientInputEndpointParameters { + region?: string | Provider; + useDualstackEndpoint?: boolean | Provider; + useFipsEndpoint?: boolean | Provider; + endpoint?: string | Provider | Endpoint | Provider | EndpointV2 | Provider; +} + +export type ClientResolvedEndpointParameters = ClientInputEndpointParameters & { + defaultSigningName: string; +}; + +export const resolveClientEndpointParameters = ( + options: T & ClientInputEndpointParameters +): T & ClientResolvedEndpointParameters => { + return { + ...options, + useDualstackEndpoint: options.useDualstackEndpoint ?? false, + useFipsEndpoint: options.useFipsEndpoint ?? false, + defaultSigningName: "trustedadvisor", + }; +}; + +export interface EndpointParameters extends __EndpointParameters { + Region?: string; + UseDualStack?: boolean; + UseFIPS?: boolean; + Endpoint?: string; +} diff --git a/clients/client-trustedadvisor/src/endpoint/endpointResolver.ts b/clients/client-trustedadvisor/src/endpoint/endpointResolver.ts new file mode 100644 index 000000000000..5a2f95973187 --- /dev/null +++ b/clients/client-trustedadvisor/src/endpoint/endpointResolver.ts @@ -0,0 +1,16 @@ +// smithy-typescript generated code +import { EndpointV2, Logger } from "@smithy/types"; +import { EndpointParams, resolveEndpoint } from "@smithy/util-endpoints"; + +import { EndpointParameters } from "./EndpointParameters"; +import { ruleSet } from "./ruleset"; + +export const defaultEndpointResolver = ( + endpointParams: EndpointParameters, + context: { logger?: Logger } = {} +): EndpointV2 => { + return resolveEndpoint(ruleSet, { + endpointParams: endpointParams as EndpointParams, + logger: context.logger, + }); +}; diff --git a/clients/client-trustedadvisor/src/endpoint/ruleset.ts b/clients/client-trustedadvisor/src/endpoint/ruleset.ts new file mode 100644 index 000000000000..0145fd6d8810 --- /dev/null +++ b/clients/client-trustedadvisor/src/endpoint/ruleset.ts @@ -0,0 +1,32 @@ +// @ts-nocheck +// generated code, do not edit +import { RuleSetObject } from "@smithy/types"; + +/* This file is compressed. Log this object + or see "smithy.rules#endpointRuleSet" + in codegen/sdk-codegen/aws-models/trustedadvisor.json */ + +const s="required", +t="fn", +u="argv", +v="ref"; +const a=true, +b="isSet", +c="booleanEquals", +d="error", +e="endpoint", +f="tree", +g="PartitionResult", +h={[s]:false,"type":"String"}, +i={[s]:true,"default":false,"type":"Boolean"}, +j={[v]:"Endpoint"}, +k={[t]:c,[u]:[{[v]:"UseFIPS"},true]}, +l={[t]:c,[u]:[{[v]:"UseDualStack"},true]}, +m={}, +n={[t]:"getAttr",[u]:[{[v]:g},"supportsFIPS"]}, +o={[t]:c,[u]:[true,{[t]:"getAttr",[u]:[{[v]:g},"supportsDualStack"]}]}, +p=[k], +q=[l], +r=[{[v]:"Region"}]; +const _data={version:"1.0",parameters:{Region:h,UseDualStack:i,UseFIPS:i,Endpoint:h},rules:[{conditions:[{[t]:b,[u]:[j]}],rules:[{conditions:p,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{rules:[{conditions:q,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:j,properties:m,headers:m},type:e}],type:f}],type:f},{rules:[{conditions:[{[t]:b,[u]:r}],rules:[{conditions:[{[t]:"aws.partition",[u]:r,assign:g}],rules:[{conditions:[k,l],rules:[{conditions:[{[t]:c,[u]:[a,n]},o],rules:[{rules:[{endpoint:{url:"https://trustedadvisor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:p,rules:[{conditions:[{[t]:c,[u]:[n,a]}],rules:[{rules:[{endpoint:{url:"https://trustedadvisor-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:q,rules:[{conditions:[o],rules:[{rules:[{endpoint:{url:"https://trustedadvisor.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{rules:[{endpoint:{url:"https://trustedadvisor.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:e}],type:f}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}],type:f}]}; +export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-trustedadvisor/src/extensionConfiguration.ts b/clients/client-trustedadvisor/src/extensionConfiguration.ts new file mode 100644 index 000000000000..6ed2817be8b9 --- /dev/null +++ b/clients/client-trustedadvisor/src/extensionConfiguration.ts @@ -0,0 +1,12 @@ +// smithy-typescript generated code +import { AwsRegionExtensionConfiguration } from "@aws-sdk/types"; +import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http"; +import { DefaultExtensionConfiguration } from "@smithy/types"; + +/** + * @internal + */ +export interface TrustedAdvisorExtensionConfiguration + extends HttpHandlerExtensionConfiguration, + DefaultExtensionConfiguration, + AwsRegionExtensionConfiguration {} diff --git a/clients/client-trustedadvisor/src/index.ts b/clients/client-trustedadvisor/src/index.ts new file mode 100644 index 000000000000..b991bc178f23 --- /dev/null +++ b/clients/client-trustedadvisor/src/index.ts @@ -0,0 +1,19 @@ +// smithy-typescript generated code +/* eslint-disable */ +/** + *

TrustedAdvisor Public API

+ * + * @packageDocumentation + */ +export * from "./TrustedAdvisorClient"; +export * from "./TrustedAdvisor"; +export { ClientInputEndpointParameters } from "./endpoint/EndpointParameters"; +export { RuntimeExtension } from "./runtimeExtensions"; +export { TrustedAdvisorExtensionConfiguration } from "./extensionConfiguration"; +export * from "./commands"; +export * from "./pagination"; +export * from "./models"; + +import "@aws-sdk/util-endpoints"; + +export { TrustedAdvisorServiceException } from "./models/TrustedAdvisorServiceException"; diff --git a/clients/client-trustedadvisor/src/models/TrustedAdvisorServiceException.ts b/clients/client-trustedadvisor/src/models/TrustedAdvisorServiceException.ts new file mode 100644 index 000000000000..a41db1549dbb --- /dev/null +++ b/clients/client-trustedadvisor/src/models/TrustedAdvisorServiceException.ts @@ -0,0 +1,22 @@ +// smithy-typescript generated code +import { + ServiceException as __ServiceException, + ServiceExceptionOptions as __ServiceExceptionOptions, +} from "@smithy/smithy-client"; + +export { __ServiceException, __ServiceExceptionOptions }; + +/** + * @public + * + * Base exception class for all service exceptions from TrustedAdvisor service. + */ +export class TrustedAdvisorServiceException extends __ServiceException { + /** + * @internal + */ + constructor(options: __ServiceExceptionOptions) { + super(options); + Object.setPrototypeOf(this, TrustedAdvisorServiceException.prototype); + } +} diff --git a/clients/client-trustedadvisor/src/models/index.ts b/clients/client-trustedadvisor/src/models/index.ts new file mode 100644 index 000000000000..9eaceb12865f --- /dev/null +++ b/clients/client-trustedadvisor/src/models/index.ts @@ -0,0 +1,2 @@ +// smithy-typescript generated code +export * from "./models_0"; diff --git a/clients/client-trustedadvisor/src/models/models_0.ts b/clients/client-trustedadvisor/src/models/models_0.ts new file mode 100644 index 000000000000..13a7ccb88b01 --- /dev/null +++ b/clients/client-trustedadvisor/src/models/models_0.ts @@ -0,0 +1,1615 @@ +// smithy-typescript generated code +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client"; + +import { TrustedAdvisorServiceException as __BaseException } from "./TrustedAdvisorServiceException"; + +/** + * @public + *

Exception that access has been denied due to insufficient access

+ */ +export class AccessDeniedException extends __BaseException { + readonly name: "AccessDeniedException" = "AccessDeniedException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "AccessDeniedException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, AccessDeniedException.prototype); + } +} + +/** + * @public + * @enum + */ +export const RecommendationLifecycleStage = { + DISMISSED: "dismissed", + IN_PROGRESS: "in_progress", + PENDING_RESPONSE: "pending_response", + RESOLVED: "resolved", +} as const; + +/** + * @public + */ +export type RecommendationLifecycleStage = + (typeof RecommendationLifecycleStage)[keyof typeof RecommendationLifecycleStage]; + +/** + * @public + * @enum + */ +export const UpdateRecommendationLifecycleStageReasonCode = { + LOW_PRIORITY: "low_priority", + NON_CRITICAL_ACCOUNT: "non_critical_account", + NOT_APPLICABLE: "not_applicable", + OTHER: "other", + OTHER_METHODS_AVAILABLE: "other_methods_available", + TEMPORARY_ACCOUNT: "temporary_account", + VALID_BUSINESS_CASE: "valid_business_case", +} as const; + +/** + * @public + */ +export type UpdateRecommendationLifecycleStageReasonCode = + (typeof UpdateRecommendationLifecycleStageReasonCode)[keyof typeof UpdateRecommendationLifecycleStageReasonCode]; + +/** + * @public + *

Summary of an AccountRecommendationLifecycle for an Organization Recommendation

+ */ +export interface AccountRecommendationLifecycleSummary { + /** + * @public + *

The AWS account ID

+ */ + accountId?: string; + + /** + * @public + *

The Recommendation ARN

+ */ + accountRecommendationArn?: string; + + /** + * @public + *

The lifecycle stage from AWS Trusted Advisor Priority

+ */ + lifecycleStage?: RecommendationLifecycleStage; + + /** + * @public + *

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information + * is only available when a Technical Account Manager takes an action on a recommendation managed by AWS + * Trusted Advisor Priority + *

+ */ + updatedOnBehalfOf?: string; + + /** + * @public + *

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation. + * This information is only available when a Technical Account Manager takes an action on a recommendation + * managed by AWS Trusted Advisor Priority + *

+ */ + updatedOnBehalfOfJobTitle?: string; + + /** + * @public + *

Reason for the lifecycle stage change

+ */ + updateReason?: string; + + /** + * @public + *

Reason code for the lifecycle state change

+ */ + updateReasonCode?: UpdateRecommendationLifecycleStageReasonCode; + + /** + * @public + *

When the Recommendation was last updated

+ */ + lastUpdatedAt?: Date; +} + +/** + * @public + * @enum + */ +export const RecommendationPillar = { + COST_OPTIMIZING: "cost_optimizing", + FAULT_TOLERANCE: "fault_tolerance", + OPERATIONAL_EXCELLENCE: "operational_excellence", + PERFORMANCE: "performance", + SECURITY: "security", + SERVICE_LIMITS: "service_limits", +} as const; + +/** + * @public + */ +export type RecommendationPillar = (typeof RecommendationPillar)[keyof typeof RecommendationPillar]; + +/** + * @public + * @enum + */ +export const RecommendationSource = { + AWS_CONFIG: "aws_config", + COMPUTE_OPTIMIZER: "compute_optimizer", + COST_EXPLORER: "cost_explorer", + LSE: "lse", + MANUAL: "manual", + PSE: "pse", + RDS: "rds", + RESILIENCE: "resilience", + RESILIENCE_HUB: "resilience_hub", + SECURITY_HUB: "security_hub", + STIR: "stir", + TA_CHECK: "ta_check", + WELL_ARCHITECTED: "well_architected", +} as const; + +/** + * @public + */ +export type RecommendationSource = (typeof RecommendationSource)[keyof typeof RecommendationSource]; + +/** + * @public + *

A summary of an AWS Trusted Advisor Check

+ */ +export interface CheckSummary { + /** + * @public + *

The unique identifier of the AWS Trusted Advisor Check

+ */ + id: string | undefined; + + /** + * @public + *

The ARN of the AWS Trusted Advisor Check

+ */ + arn: string | undefined; + + /** + * @public + *

The name of the AWS Trusted Advisor Check

+ */ + name: string | undefined; + + /** + * @public + *

A description of what the AWS Trusted Advisor Check is monitoring

+ */ + description: string | undefined; + + /** + * @public + *

The Recommendation pillars that the AWS Trusted Advisor Check falls under

+ */ + pillars: RecommendationPillar[] | undefined; + + /** + * @public + *

The AWS Services that the Check applies to

+ */ + awsServices: string[] | undefined; + + /** + * @public + *

The source of the Recommendation

+ */ + source: RecommendationSource | undefined; + + /** + * @public + *

The column headings for the metadata returned in the resource

+ */ + metadata: Record | undefined; +} + +/** + * @public + *

Exception that the request was denied due to conflictions in state

+ */ +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + } +} + +/** + * @public + */ +export interface GetOrganizationRecommendationRequest { + /** + * @public + *

The Recommendation identifier

+ */ + organizationRecommendationIdentifier: string | undefined; +} + +/** + * @public + *

Cost optimizing aggregates for a Recommendation

+ */ +export interface RecommendationCostOptimizingAggregates { + /** + * @public + *

The estimated monthly savings

+ */ + estimatedMonthlySavings: number | undefined; + + /** + * @public + *

The estimated percently monthly savings

+ */ + estimatedPercentMonthlySavings: number | undefined; +} + +/** + * @public + *

Recommendation pillar aggregates

+ */ +export interface RecommendationPillarSpecificAggregates { + /** + * @public + *

Cost optimizing aggregates

+ */ + costOptimizing?: RecommendationCostOptimizingAggregates; +} + +/** + * @public + *

Aggregation of Recommendation Resources

+ */ +export interface RecommendationResourcesAggregates { + /** + * @public + *

The number of AWS resources that were flagged to be OK according to the Trusted Advisor check

+ */ + okCount: number | undefined; + + /** + * @public + *

The number of AWS resources that were flagged to have warning according to the Trusted Advisor check + *

+ */ + warningCount: number | undefined; + + /** + * @public + *

The number of AWS resources that were flagged to have errors according to the Trusted Advisor check

+ */ + errorCount: number | undefined; +} + +/** + * @public + * @enum + */ +export const RecommendationStatus = { + ERROR: "error", + OK: "ok", + WARNING: "warning", +} as const; + +/** + * @public + */ +export type RecommendationStatus = (typeof RecommendationStatus)[keyof typeof RecommendationStatus]; + +/** + * @public + * @enum + */ +export const RecommendationType = { + PRIORITY: "priority", + STANDARD: "standard", +} as const; + +/** + * @public + */ +export type RecommendationType = (typeof RecommendationType)[keyof typeof RecommendationType]; + +/** + * @public + *

A Recommendation for accounts within an Organization

+ */ +export interface OrganizationRecommendation { + /** + * @public + *

The ID which identifies where the Recommendation was produced

+ */ + id: string | undefined; + + /** + * @public + *

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

+ */ + type: RecommendationType | undefined; + + /** + * @public + *

The AWS Trusted Advisor Check ARN that relates to the Recommendation

+ */ + checkArn?: string; + + /** + * @public + *

The status of the Recommendation

+ */ + status: RecommendationStatus | undefined; + + /** + * @public + *

The lifecycle stage from AWS Trusted Advisor Priority

+ */ + lifecycleStage?: RecommendationLifecycleStage; + + /** + * @public + *

The Pillars that the Recommendation is optimizing

+ */ + pillars: RecommendationPillar[] | undefined; + + /** + * @public + *

The source of the Recommendation

+ */ + source: RecommendationSource | undefined; + + /** + * @public + *

The AWS Services that the Recommendation applies to

+ */ + awsServices?: string[]; + + /** + * @public + *

The name of the AWS Trusted Advisor Recommendation

+ */ + name: string | undefined; + + /** + * @public + *

An aggregation of all resources

+ */ + resourcesAggregates: RecommendationResourcesAggregates | undefined; + + /** + * @public + *

The pillar aggregations for cost savings

+ */ + pillarSpecificAggregates?: RecommendationPillarSpecificAggregates; + + /** + * @public + *

When the Recommendation was created, if created by AWS Trusted Advisor Priority

+ */ + createdAt?: Date; + + /** + * @public + *

When the Recommendation was last updated

+ */ + lastUpdatedAt?: Date; + + /** + * @public + *

The ARN of the Recommendation

+ */ + arn: string | undefined; + + /** + * @public + *

A description for AWS Trusted Advisor recommendations

+ */ + description: string | undefined; + + /** + * @public + *

The creator, if created by AWS Trusted Advisor Priority

+ */ + createdBy?: string; + + /** + * @public + *

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information + * is only available when a Technical Account Manager takes an action on a recommendation managed by AWS + * Trusted Advisor Priority + *

+ */ + updatedOnBehalfOf?: string; + + /** + * @public + *

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation. + * This information is only available when a Technical Account Manager takes an action on a recommendation + * managed by AWS Trusted Advisor Priority + *

+ */ + updatedOnBehalfOfJobTitle?: string; + + /** + * @public + *

Reason for the lifecycle stage change

+ */ + updateReason?: string; + + /** + * @public + *

Reason code for the lifecycle state change

+ */ + updateReasonCode?: UpdateRecommendationLifecycleStageReasonCode; + + /** + * @public + *

When the Recommendation was resolved

+ */ + resolvedAt?: Date; +} + +/** + * @public + */ +export interface GetOrganizationRecommendationResponse { + /** + * @public + *

The Recommendation

+ */ + organizationRecommendation?: OrganizationRecommendation; +} + +/** + * @public + *

Exception to notify that an unexpected internal error occurred during processing of the request

+ */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + $retryable = {}; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + } +} + +/** + * @public + *

Exception that the requested resource has not been found

+ */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + } +} + +/** + * @public + *

Exception to notify that requests are being throttled

+ */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + $retryable = { + throttling: true, + }; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + } +} + +/** + * @public + *

Exception that the request failed to satisfy service constraints

+ */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ValidationException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ValidationException.prototype); + } +} + +/** + * @public + */ +export interface GetRecommendationRequest { + /** + * @public + *

The Recommendation identifier

+ */ + recommendationIdentifier: string | undefined; +} + +/** + * @public + *

A Recommendation for an Account

+ */ +export interface Recommendation { + /** + * @public + *

The ID which identifies where the Recommendation was produced

+ */ + id: string | undefined; + + /** + * @public + *

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

+ */ + type: RecommendationType | undefined; + + /** + * @public + *

The AWS Trusted Advisor Check ARN that relates to the Recommendation

+ */ + checkArn?: string; + + /** + * @public + *

The status of the Recommendation

+ */ + status: RecommendationStatus | undefined; + + /** + * @public + *

The lifecycle stage from AWS Trusted Advisor Priority

+ */ + lifecycleStage?: RecommendationLifecycleStage; + + /** + * @public + *

The Pillars that the Recommendation is optimizing

+ */ + pillars: RecommendationPillar[] | undefined; + + /** + * @public + *

The source of the Recommendation

+ */ + source: RecommendationSource | undefined; + + /** + * @public + *

The AWS Services that the Recommendation applies to

+ */ + awsServices?: string[]; + + /** + * @public + *

The name of the AWS Trusted Advisor Recommendation

+ */ + name: string | undefined; + + /** + * @public + *

An aggregation of all resources

+ */ + resourcesAggregates: RecommendationResourcesAggregates | undefined; + + /** + * @public + *

The pillar aggregations for cost savings

+ */ + pillarSpecificAggregates?: RecommendationPillarSpecificAggregates; + + /** + * @public + *

When the Recommendation was created, if created by AWS Trusted Advisor Priority

+ */ + createdAt?: Date; + + /** + * @public + *

When the Recommendation was last updated

+ */ + lastUpdatedAt?: Date; + + /** + * @public + *

The ARN of the Recommendation

+ */ + arn: string | undefined; + + /** + * @public + *

A description for AWS Trusted Advisor recommendations

+ */ + description: string | undefined; + + /** + * @public + *

The creator, if created by AWS Trusted Advisor Priority

+ */ + createdBy?: string; + + /** + * @public + *

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information + * is only available when a Technical Account Manager takes an action on a recommendation managed by AWS + * Trusted Advisor Priority + *

+ */ + updatedOnBehalfOf?: string; + + /** + * @public + *

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation. + * This information is only available when a Technical Account Manager takes an action on a recommendation + * managed by AWS Trusted Advisor Priority + *

+ */ + updatedOnBehalfOfJobTitle?: string; + + /** + * @public + *

Reason for the lifecycle stage change

+ */ + updateReason?: string; + + /** + * @public + *

Reason code for the lifecycle state change

+ */ + updateReasonCode?: UpdateRecommendationLifecycleStageReasonCode; + + /** + * @public + *

When the Recommendation was resolved

+ */ + resolvedAt?: Date; +} + +/** + * @public + */ +export interface GetRecommendationResponse { + /** + * @public + *

The Recommendation

+ */ + recommendation?: Recommendation; +} + +/** + * @public + * @enum + */ +export const RecommendationLanguage = { + BAHASA_INDONESIA: "id", + BRAZILIAN_PORTUGUESE: "pt_BR", + CHINESE: "zh", + ENGLISH: "en", + FRENCH: "fr", + GERMAN: "de", + ITALIAN: "it", + JAPANESE: "ja", + KOREAN: "ko", + SPANISH: "es", + TRADITIONAL_CHINESE: "zh_TW", +} as const; + +/** + * @public + */ +export type RecommendationLanguage = (typeof RecommendationLanguage)[keyof typeof RecommendationLanguage]; + +/** + * @public + */ +export interface ListChecksRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The pillar of the check

+ */ + pillar?: RecommendationPillar; + + /** + * @public + *

The aws service associated with the check

+ */ + awsService?: string; + + /** + * @public + *

The source of the check

+ */ + source?: RecommendationSource; + + /** + * @public + *

The ISO 639-1 code for the language that you want your checks to appear in.

+ */ + language?: RecommendationLanguage; +} + +/** + * @public + */ +export interface ListChecksResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The list of Checks

+ */ + checkSummaries: CheckSummary[] | undefined; +} + +/** + * @public + */ +export interface ListOrganizationRecommendationAccountsRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The Recommendation identifier

+ */ + organizationRecommendationIdentifier: string | undefined; + + /** + * @public + *

An account affected by this organization recommendation

+ */ + affectedAccountId?: string; +} + +/** + * @public + */ +export interface ListOrganizationRecommendationAccountsResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The account recommendations lifecycles that are applicable to the Recommendation

+ */ + accountRecommendationLifecycleSummaries: AccountRecommendationLifecycleSummary[] | undefined; +} + +/** + * @public + * @enum + */ +export const ResourceStatus = { + ERROR: "error", + OK: "ok", + WARNING: "warning", +} as const; + +/** + * @public + */ +export type ResourceStatus = (typeof ResourceStatus)[keyof typeof ResourceStatus]; + +/** + * @public + */ +export interface ListOrganizationRecommendationResourcesRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The status of the resource

+ */ + status?: ResourceStatus; + + /** + * @public + *

The AWS Region code of the resource

+ */ + regionCode?: string; + + /** + * @public + *

The AWS Organization organization's Recommendation identifier

+ */ + organizationRecommendationIdentifier: string | undefined; + + /** + * @public + *

An account affected by this organization recommendation

+ */ + affectedAccountId?: string; +} + +/** + * @public + *

Organization Recommendation Resource Summary

+ */ +export interface OrganizationRecommendationResourceSummary { + /** + * @public + *

The ID of the Recommendation Resource

+ */ + id: string | undefined; + + /** + * @public + *

The ARN of the Recommendation Resource

+ */ + arn: string | undefined; + + /** + * @public + *

The AWS resource identifier

+ */ + awsResourceId: string | undefined; + + /** + * @public + *

The AWS Region code that the Recommendation Resource is in

+ */ + regionCode: string | undefined; + + /** + * @public + *

The current status of the Recommendation Resource

+ */ + status: ResourceStatus | undefined; + + /** + * @public + *

Metadata associated with the Recommendation Resource

+ */ + metadata: Record | undefined; + + /** + * @public + *

When the Recommendation Resource was last updated

+ */ + lastUpdatedAt: Date | undefined; + + /** + * @public + *

The AWS account ID

+ */ + accountId?: string; + + /** + * @public + *

The Recommendation ARN

+ */ + recommendationArn: string | undefined; +} + +/** + * @public + */ +export interface ListOrganizationRecommendationResourcesResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

A list of Recommendation Resources

+ */ + organizationRecommendationResourceSummaries: OrganizationRecommendationResourceSummary[] | undefined; +} + +/** + * @public + */ +export interface ListOrganizationRecommendationsRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The type of the Recommendation

+ */ + type?: RecommendationType; + + /** + * @public + *

The status of the Recommendation

+ */ + status?: RecommendationStatus; + + /** + * @public + *

The pillar of the Recommendation

+ */ + pillar?: RecommendationPillar; + + /** + * @public + *

The aws service associated with the Recommendation

+ */ + awsService?: string; + + /** + * @public + *

The source of the Recommendation

+ */ + source?: RecommendationSource; + + /** + * @public + *

The check identifier of the Recommendation

+ */ + checkIdentifier?: string; + + /** + * @public + *

After the last update of the Recommendation

+ */ + afterLastUpdatedAt?: Date; + + /** + * @public + *

Before the last update of the Recommendation

+ */ + beforeLastUpdatedAt?: Date; +} + +/** + * @public + *

Summary of recommendation for accounts within an Organization

+ */ +export interface OrganizationRecommendationSummary { + /** + * @public + *

The ID which identifies where the Recommendation was produced

+ */ + id: string | undefined; + + /** + * @public + *

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

+ */ + type: RecommendationType | undefined; + + /** + * @public + *

The AWS Trusted Advisor Check ARN that relates to the Recommendation

+ */ + checkArn?: string; + + /** + * @public + *

The status of the Recommendation

+ */ + status: RecommendationStatus | undefined; + + /** + * @public + *

The lifecycle stage from AWS Trusted Advisor Priority

+ */ + lifecycleStage?: RecommendationLifecycleStage; + + /** + * @public + *

The Pillars that the Recommendation is optimizing

+ */ + pillars: RecommendationPillar[] | undefined; + + /** + * @public + *

The source of the Recommendation

+ */ + source: RecommendationSource | undefined; + + /** + * @public + *

The AWS Services that the Recommendation applies to

+ */ + awsServices?: string[]; + + /** + * @public + *

The name of the AWS Trusted Advisor Recommendation

+ */ + name: string | undefined; + + /** + * @public + *

An aggregation of all resources

+ */ + resourcesAggregates: RecommendationResourcesAggregates | undefined; + + /** + * @public + *

The pillar aggregations for cost savings

+ */ + pillarSpecificAggregates?: RecommendationPillarSpecificAggregates; + + /** + * @public + *

When the Recommendation was created, if created by AWS Trusted Advisor Priority

+ */ + createdAt?: Date; + + /** + * @public + *

When the Recommendation was last updated

+ */ + lastUpdatedAt?: Date; + + /** + * @public + *

The ARN of the Recommendation

+ */ + arn: string | undefined; +} + +/** + * @public + */ +export interface ListOrganizationRecommendationsResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The list of Recommendations

+ */ + organizationRecommendationSummaries: OrganizationRecommendationSummary[] | undefined; +} + +/** + * @public + */ +export interface ListRecommendationResourcesRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The status of the resource

+ */ + status?: ResourceStatus; + + /** + * @public + *

The AWS Region code of the resource

+ */ + regionCode?: string; + + /** + * @public + *

The Recommendation identifier

+ */ + recommendationIdentifier: string | undefined; +} + +/** + * @public + *

Summary of a Recommendation Resource

+ */ +export interface RecommendationResourceSummary { + /** + * @public + *

The ID of the Recommendation Resource

+ */ + id: string | undefined; + + /** + * @public + *

The ARN of the Recommendation Resource

+ */ + arn: string | undefined; + + /** + * @public + *

The AWS resource identifier

+ */ + awsResourceId: string | undefined; + + /** + * @public + *

The AWS Region code that the Recommendation Resource is in

+ */ + regionCode: string | undefined; + + /** + * @public + *

The current status of the Recommendation Resource

+ */ + status: ResourceStatus | undefined; + + /** + * @public + *

Metadata associated with the Recommendation Resource

+ */ + metadata: Record | undefined; + + /** + * @public + *

When the Recommendation Resource was last updated

+ */ + lastUpdatedAt: Date | undefined; + + /** + * @public + *

The Recommendation ARN

+ */ + recommendationArn: string | undefined; +} + +/** + * @public + */ +export interface ListRecommendationResourcesResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

A list of Recommendation Resources

+ */ + recommendationResourceSummaries: RecommendationResourceSummary[] | undefined; +} + +/** + * @public + */ +export interface ListRecommendationsRequest { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The maximum number of results to return per page.

+ */ + maxResults?: number; + + /** + * @public + *

The type of the Recommendation

+ */ + type?: RecommendationType; + + /** + * @public + *

The status of the Recommendation

+ */ + status?: RecommendationStatus; + + /** + * @public + *

The pillar of the Recommendation

+ */ + pillar?: RecommendationPillar; + + /** + * @public + *

The aws service associated with the Recommendation

+ */ + awsService?: string; + + /** + * @public + *

The source of the Recommendation

+ */ + source?: RecommendationSource; + + /** + * @public + *

The check identifier of the Recommendation

+ */ + checkIdentifier?: string; + + /** + * @public + *

After the last update of the Recommendation

+ */ + afterLastUpdatedAt?: Date; + + /** + * @public + *

Before the last update of the Recommendation

+ */ + beforeLastUpdatedAt?: Date; +} + +/** + * @public + *

Summary of Recommendation for an Account

+ */ +export interface RecommendationSummary { + /** + * @public + *

The ID which identifies where the Recommendation was produced

+ */ + id: string | undefined; + + /** + * @public + *

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

+ */ + type: RecommendationType | undefined; + + /** + * @public + *

The AWS Trusted Advisor Check ARN that relates to the Recommendation

+ */ + checkArn?: string; + + /** + * @public + *

The status of the Recommendation

+ */ + status: RecommendationStatus | undefined; + + /** + * @public + *

The lifecycle stage from AWS Trusted Advisor Priority

+ */ + lifecycleStage?: RecommendationLifecycleStage; + + /** + * @public + *

The Pillars that the Recommendation is optimizing

+ */ + pillars: RecommendationPillar[] | undefined; + + /** + * @public + *

The source of the Recommendation

+ */ + source: RecommendationSource | undefined; + + /** + * @public + *

The AWS Services that the Recommendation applies to

+ */ + awsServices?: string[]; + + /** + * @public + *

The name of the AWS Trusted Advisor Recommendation

+ */ + name: string | undefined; + + /** + * @public + *

An aggregation of all resources

+ */ + resourcesAggregates: RecommendationResourcesAggregates | undefined; + + /** + * @public + *

The pillar aggregations for cost savings

+ */ + pillarSpecificAggregates?: RecommendationPillarSpecificAggregates; + + /** + * @public + *

When the Recommendation was created, if created by AWS Trusted Advisor Priority

+ */ + createdAt?: Date; + + /** + * @public + *

When the Recommendation was last updated

+ */ + lastUpdatedAt?: Date; + + /** + * @public + *

The ARN of the Recommendation

+ */ + arn: string | undefined; +} + +/** + * @public + */ +export interface ListRecommendationsResponse { + /** + * @public + *

The token for the next set of results. Use the value returned in the previous response in the next request + * to retrieve the next set of results. + *

+ */ + nextToken?: string; + + /** + * @public + *

The list of Recommendations

+ */ + recommendationSummaries: RecommendationSummary[] | undefined; +} + +/** + * @public + * @enum + */ +export const UpdateRecommendationLifecycleStage = { + DISMISSED: "dismissed", + IN_PROGRESS: "in_progress", + PENDING_RESPONSE: "pending_response", + RESOLVED: "resolved", +} as const; + +/** + * @public + */ +export type UpdateRecommendationLifecycleStage = + (typeof UpdateRecommendationLifecycleStage)[keyof typeof UpdateRecommendationLifecycleStage]; + +/** + * @public + */ +export interface UpdateOrganizationRecommendationLifecycleRequest { + /** + * @public + *

The new lifecycle stage

+ */ + lifecycleStage: UpdateRecommendationLifecycleStage | undefined; + + /** + * @public + *

Reason for the lifecycle stage change

+ */ + updateReason?: string; + + /** + * @public + *

Reason code for the lifecycle state change

+ */ + updateReasonCode?: UpdateRecommendationLifecycleStageReasonCode; + + /** + * @public + *

The Recommendation identifier for AWS Trusted Advisor Priority recommendations

+ */ + organizationRecommendationIdentifier: string | undefined; +} + +/** + * @public + */ +export interface UpdateRecommendationLifecycleRequest { + /** + * @public + *

The new lifecycle stage

+ */ + lifecycleStage: UpdateRecommendationLifecycleStage | undefined; + + /** + * @public + *

Reason for the lifecycle stage change

+ */ + updateReason?: string; + + /** + * @public + *

Reason code for the lifecycle state change

+ */ + updateReasonCode?: UpdateRecommendationLifecycleStageReasonCode; + + /** + * @public + *

The Recommendation identifier for AWS Trusted Advisor Priority recommendations

+ */ + recommendationIdentifier: string | undefined; +} + +/** + * @internal + */ +export const AccountRecommendationLifecycleSummaryFilterSensitiveLog = ( + obj: AccountRecommendationLifecycleSummary +): any => ({ + ...obj, + ...(obj.updateReason && { updateReason: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const OrganizationRecommendationFilterSensitiveLog = (obj: OrganizationRecommendation): any => ({ + ...obj, + ...(obj.updateReason && { updateReason: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetOrganizationRecommendationResponseFilterSensitiveLog = ( + obj: GetOrganizationRecommendationResponse +): any => ({ + ...obj, + ...(obj.organizationRecommendation && { + organizationRecommendation: OrganizationRecommendationFilterSensitiveLog(obj.organizationRecommendation), + }), +}); + +/** + * @internal + */ +export const RecommendationFilterSensitiveLog = (obj: Recommendation): any => ({ + ...obj, + ...(obj.updateReason && { updateReason: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetRecommendationResponseFilterSensitiveLog = (obj: GetRecommendationResponse): any => ({ + ...obj, + ...(obj.recommendation && { recommendation: RecommendationFilterSensitiveLog(obj.recommendation) }), +}); + +/** + * @internal + */ +export const ListOrganizationRecommendationAccountsResponseFilterSensitiveLog = ( + obj: ListOrganizationRecommendationAccountsResponse +): any => ({ + ...obj, + ...(obj.accountRecommendationLifecycleSummaries && { + accountRecommendationLifecycleSummaries: obj.accountRecommendationLifecycleSummaries.map((item) => + AccountRecommendationLifecycleSummaryFilterSensitiveLog(item) + ), + }), +}); + +/** + * @internal + */ +export const UpdateOrganizationRecommendationLifecycleRequestFilterSensitiveLog = ( + obj: UpdateOrganizationRecommendationLifecycleRequest +): any => ({ + ...obj, + ...(obj.updateReason && { updateReason: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const UpdateRecommendationLifecycleRequestFilterSensitiveLog = ( + obj: UpdateRecommendationLifecycleRequest +): any => ({ + ...obj, + ...(obj.updateReason && { updateReason: SENSITIVE_STRING }), +}); diff --git a/clients/client-trustedadvisor/src/pagination/Interfaces.ts b/clients/client-trustedadvisor/src/pagination/Interfaces.ts new file mode 100644 index 000000000000..2f86a227ead9 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/Interfaces.ts @@ -0,0 +1,11 @@ +// smithy-typescript generated code +import { PaginationConfiguration } from "@smithy/types"; + +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; + +/** + * @public + */ +export interface TrustedAdvisorPaginationConfiguration extends PaginationConfiguration { + client: TrustedAdvisorClient; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListChecksPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListChecksPaginator.ts new file mode 100644 index 000000000000..6143ca3e41bd --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListChecksPaginator.ts @@ -0,0 +1,46 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { ListChecksCommand, ListChecksCommandInput, ListChecksCommandOutput } from "../commands/ListChecksCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListChecksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListChecksCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListChecks( + config: TrustedAdvisorPaginationConfiguration, + input: ListChecksCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListChecksCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationAccountsPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationAccountsPaginator.ts new file mode 100644 index 000000000000..10f7088a778f --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationAccountsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListOrganizationRecommendationAccountsCommand, + ListOrganizationRecommendationAccountsCommandInput, + ListOrganizationRecommendationAccountsCommandOutput, +} from "../commands/ListOrganizationRecommendationAccountsCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListOrganizationRecommendationAccountsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationRecommendationAccountsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListOrganizationRecommendationAccounts( + config: TrustedAdvisorPaginationConfiguration, + input: ListOrganizationRecommendationAccountsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListOrganizationRecommendationAccountsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationResourcesPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationResourcesPaginator.ts new file mode 100644 index 000000000000..6ce62bca4af3 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationResourcesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListOrganizationRecommendationResourcesCommand, + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput, +} from "../commands/ListOrganizationRecommendationResourcesCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListOrganizationRecommendationResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationRecommendationResourcesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListOrganizationRecommendationResources( + config: TrustedAdvisorPaginationConfiguration, + input: ListOrganizationRecommendationResourcesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListOrganizationRecommendationResourcesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationsPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationsPaginator.ts new file mode 100644 index 000000000000..5244835ba858 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListOrganizationRecommendationsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListOrganizationRecommendationsCommand, + ListOrganizationRecommendationsCommandInput, + ListOrganizationRecommendationsCommandOutput, +} from "../commands/ListOrganizationRecommendationsCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListOrganizationRecommendationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListOrganizationRecommendationsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListOrganizationRecommendations( + config: TrustedAdvisorPaginationConfiguration, + input: ListOrganizationRecommendationsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListOrganizationRecommendationsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListRecommendationResourcesPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListRecommendationResourcesPaginator.ts new file mode 100644 index 000000000000..ecbf47096b05 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListRecommendationResourcesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListRecommendationResourcesCommand, + ListRecommendationResourcesCommandInput, + ListRecommendationResourcesCommandOutput, +} from "../commands/ListRecommendationResourcesCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListRecommendationResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecommendationResourcesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListRecommendationResources( + config: TrustedAdvisorPaginationConfiguration, + input: ListRecommendationResourcesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListRecommendationResourcesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/ListRecommendationsPaginator.ts b/clients/client-trustedadvisor/src/pagination/ListRecommendationsPaginator.ts new file mode 100644 index 000000000000..522aa871c5f7 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/ListRecommendationsPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@smithy/types"; + +import { + ListRecommendationsCommand, + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, +} from "../commands/ListRecommendationsCommand"; +import { TrustedAdvisorClient } from "../TrustedAdvisorClient"; +import { TrustedAdvisorPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: TrustedAdvisorClient, + input: ListRecommendationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListRecommendationsCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateListRecommendations( + config: TrustedAdvisorPaginationConfiguration, + input: ListRecommendationsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListRecommendationsCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof TrustedAdvisorClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected TrustedAdvisor | TrustedAdvisorClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-trustedadvisor/src/pagination/index.ts b/clients/client-trustedadvisor/src/pagination/index.ts new file mode 100644 index 000000000000..8fb394e7efb3 --- /dev/null +++ b/clients/client-trustedadvisor/src/pagination/index.ts @@ -0,0 +1,8 @@ +// smithy-typescript generated code +export * from "./Interfaces"; +export * from "./ListChecksPaginator"; +export * from "./ListOrganizationRecommendationAccountsPaginator"; +export * from "./ListOrganizationRecommendationResourcesPaginator"; +export * from "./ListOrganizationRecommendationsPaginator"; +export * from "./ListRecommendationResourcesPaginator"; +export * from "./ListRecommendationsPaginator"; diff --git a/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts b/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts new file mode 100644 index 000000000000..fa533fd1d4cb --- /dev/null +++ b/clients/client-trustedadvisor/src/protocols/Aws_restJson1.ts @@ -0,0 +1,1488 @@ +// smithy-typescript generated code +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { + _json, + collectBody, + decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectObject as __expectObject, + expectString as __expectString, + extendedEncodeURIComponent as __extendedEncodeURIComponent, + limitedParseDouble as __limitedParseDouble, + map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, + resolvedPath as __resolvedPath, + take, + withBaseException, +} from "@smithy/smithy-client"; +import { + Endpoint as __Endpoint, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext, +} from "@smithy/types"; + +import { + GetOrganizationRecommendationCommandInput, + GetOrganizationRecommendationCommandOutput, +} from "../commands/GetOrganizationRecommendationCommand"; +import { GetRecommendationCommandInput, GetRecommendationCommandOutput } from "../commands/GetRecommendationCommand"; +import { ListChecksCommandInput, ListChecksCommandOutput } from "../commands/ListChecksCommand"; +import { + ListOrganizationRecommendationAccountsCommandInput, + ListOrganizationRecommendationAccountsCommandOutput, +} from "../commands/ListOrganizationRecommendationAccountsCommand"; +import { + ListOrganizationRecommendationResourcesCommandInput, + ListOrganizationRecommendationResourcesCommandOutput, +} from "../commands/ListOrganizationRecommendationResourcesCommand"; +import { + ListOrganizationRecommendationsCommandInput, + ListOrganizationRecommendationsCommandOutput, +} from "../commands/ListOrganizationRecommendationsCommand"; +import { + ListRecommendationResourcesCommandInput, + ListRecommendationResourcesCommandOutput, +} from "../commands/ListRecommendationResourcesCommand"; +import { + ListRecommendationsCommandInput, + ListRecommendationsCommandOutput, +} from "../commands/ListRecommendationsCommand"; +import { + UpdateOrganizationRecommendationLifecycleCommandInput, + UpdateOrganizationRecommendationLifecycleCommandOutput, +} from "../commands/UpdateOrganizationRecommendationLifecycleCommand"; +import { + UpdateRecommendationLifecycleCommandInput, + UpdateRecommendationLifecycleCommandOutput, +} from "../commands/UpdateRecommendationLifecycleCommand"; +import { + AccessDeniedException, + AccountRecommendationLifecycleSummary, + ConflictException, + InternalServerException, + OrganizationRecommendation, + OrganizationRecommendationResourceSummary, + OrganizationRecommendationSummary, + Recommendation, + RecommendationCostOptimizingAggregates, + RecommendationPillarSpecificAggregates, + RecommendationResourceSummary, + RecommendationSummary, + ResourceNotFoundException, + ThrottlingException, + ValidationException, +} from "../models/models_0"; +import { TrustedAdvisorServiceException as __BaseException } from "../models/TrustedAdvisorServiceException"; + +/** + * serializeAws_restJson1GetOrganizationRecommendationCommand + */ +export const se_GetOrganizationRecommendationCommand = async ( + input: GetOrganizationRecommendationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/organization-recommendations/{organizationRecommendationIdentifier}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "organizationRecommendationIdentifier", + () => input.organizationRecommendationIdentifier!, + "{organizationRecommendationIdentifier}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1GetRecommendationCommand + */ +export const se_GetRecommendationCommand = async ( + input: GetRecommendationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/recommendations/{recommendationIdentifier}"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "recommendationIdentifier", + () => input.recommendationIdentifier!, + "{recommendationIdentifier}", + false + ); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1ListChecksCommand + */ +export const se_ListChecksCommand = async ( + input: ListChecksCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/checks"; + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + pillar: [, input.pillar!], + awsService: [, input.awsService!], + source: [, input.source!], + language: [, input.language!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListOrganizationRecommendationAccountsCommand + */ +export const se_ListOrganizationRecommendationAccountsCommand = async ( + input: ListOrganizationRecommendationAccountsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/organization-recommendations/{organizationRecommendationIdentifier}/accounts"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "organizationRecommendationIdentifier", + () => input.organizationRecommendationIdentifier!, + "{organizationRecommendationIdentifier}", + false + ); + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + affectedAccountId: [, input.affectedAccountId!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListOrganizationRecommendationResourcesCommand + */ +export const se_ListOrganizationRecommendationResourcesCommand = async ( + input: ListOrganizationRecommendationResourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/organization-recommendations/{organizationRecommendationIdentifier}/resources"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "organizationRecommendationIdentifier", + () => input.organizationRecommendationIdentifier!, + "{organizationRecommendationIdentifier}", + false + ); + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + status: [, input.status!], + regionCode: [, input.regionCode!], + affectedAccountId: [, input.affectedAccountId!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListOrganizationRecommendationsCommand + */ +export const se_ListOrganizationRecommendationsCommand = async ( + input: ListOrganizationRecommendationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/organization-recommendations"; + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + type: [, input.type!], + status: [, input.status!], + pillar: [, input.pillar!], + awsService: [, input.awsService!], + source: [, input.source!], + checkIdentifier: [, input.checkIdentifier!], + afterLastUpdatedAt: [ + () => input.afterLastUpdatedAt !== void 0, + () => (input.afterLastUpdatedAt!.toISOString().split(".")[0] + "Z").toString(), + ], + beforeLastUpdatedAt: [ + () => input.beforeLastUpdatedAt !== void 0, + () => (input.beforeLastUpdatedAt!.toISOString().split(".")[0] + "Z").toString(), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListRecommendationResourcesCommand + */ +export const se_ListRecommendationResourcesCommand = async ( + input: ListRecommendationResourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/recommendations/{recommendationIdentifier}/resources"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "recommendationIdentifier", + () => input.recommendationIdentifier!, + "{recommendationIdentifier}", + false + ); + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + status: [, input.status!], + regionCode: [, input.regionCode!], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1ListRecommendationsCommand + */ +export const se_ListRecommendationsCommand = async ( + input: ListRecommendationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = {}; + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/recommendations"; + const query: any = map({ + nextToken: [, input.nextToken!], + maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()], + type: [, input.type!], + status: [, input.status!], + pillar: [, input.pillar!], + awsService: [, input.awsService!], + source: [, input.source!], + checkIdentifier: [, input.checkIdentifier!], + afterLastUpdatedAt: [ + () => input.afterLastUpdatedAt !== void 0, + () => (input.afterLastUpdatedAt!.toISOString().split(".")[0] + "Z").toString(), + ], + beforeLastUpdatedAt: [ + () => input.beforeLastUpdatedAt !== void 0, + () => (input.beforeLastUpdatedAt!.toISOString().split(".")[0] + "Z").toString(), + ], + }); + let body: any; + return new __HttpRequest({ + protocol, + hostname, + port, + method: "GET", + headers, + path: resolvedPath, + query, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateOrganizationRecommendationLifecycleCommand + */ +export const se_UpdateOrganizationRecommendationLifecycleCommand = async ( + input: UpdateOrganizationRecommendationLifecycleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/organization-recommendations/{organizationRecommendationIdentifier}/lifecycle"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "organizationRecommendationIdentifier", + () => input.organizationRecommendationIdentifier!, + "{organizationRecommendationIdentifier}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + lifecycleStage: [], + updateReason: [], + updateReasonCode: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1UpdateRecommendationLifecycleCommand + */ +export const se_UpdateRecommendationLifecycleCommand = async ( + input: UpdateRecommendationLifecycleCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + + "/v1/recommendations/{recommendationIdentifier}/lifecycle"; + resolvedPath = __resolvedPath( + resolvedPath, + input, + "recommendationIdentifier", + () => input.recommendationIdentifier!, + "{recommendationIdentifier}", + false + ); + let body: any; + body = JSON.stringify( + take(input, { + lifecycleStage: [], + updateReason: [], + updateReasonCode: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * deserializeAws_restJson1GetOrganizationRecommendationCommand + */ +export const de_GetOrganizationRecommendationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetOrganizationRecommendationCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + organizationRecommendation: (_) => de_OrganizationRecommendation(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetOrganizationRecommendationCommandError + */ +const de_GetOrganizationRecommendationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1GetRecommendationCommand + */ +export const de_GetRecommendationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_GetRecommendationCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + recommendation: (_) => de_Recommendation(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1GetRecommendationCommandError + */ +const de_GetRecommendationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListChecksCommand + */ +export const de_ListChecksCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListChecksCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + checkSummaries: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListChecksCommandError + */ +const de_ListChecksCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationAccountsCommand + */ +export const de_ListOrganizationRecommendationAccountsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListOrganizationRecommendationAccountsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + accountRecommendationLifecycleSummaries: (_) => de_AccountRecommendationLifecycleSummaryList(_, context), + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationAccountsCommandError + */ +const de_ListOrganizationRecommendationAccountsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationResourcesCommand + */ +export const de_ListOrganizationRecommendationResourcesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListOrganizationRecommendationResourcesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + organizationRecommendationResourceSummaries: (_) => de_OrganizationRecommendationResourceSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationResourcesCommandError + */ +const de_ListOrganizationRecommendationResourcesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationsCommand + */ +export const de_ListOrganizationRecommendationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListOrganizationRecommendationsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + organizationRecommendationSummaries: (_) => de_OrganizationRecommendationSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListOrganizationRecommendationsCommandError + */ +const de_ListOrganizationRecommendationsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListRecommendationResourcesCommand + */ +export const de_ListRecommendationResourcesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListRecommendationResourcesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + recommendationResourceSummaries: (_) => de_RecommendationResourceSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListRecommendationResourcesCommandError + */ +const de_ListRecommendationResourcesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1ListRecommendationsCommand + */ +export const de_ListRecommendationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ListRecommendationsCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + nextToken: __expectString, + recommendationSummaries: (_) => de_RecommendationSummaryList(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ListRecommendationsCommandError + */ +const de_ListRecommendationsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateOrganizationRecommendationLifecycleCommand + */ +export const de_UpdateOrganizationRecommendationLifecycleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateOrganizationRecommendationLifecycleCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateOrganizationRecommendationLifecycleCommandError + */ +const de_UpdateOrganizationRecommendationLifecycleCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.trustedadvisor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +/** + * deserializeAws_restJson1UpdateRecommendationLifecycleCommand + */ +export const de_UpdateRecommendationLifecycleCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateRecommendationLifecycleCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateRecommendationLifecycleCommandError + */ +const de_UpdateRecommendationLifecycleCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.trustedadvisor#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.trustedadvisor#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.trustedadvisor#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.trustedadvisor#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.trustedadvisor#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.trustedadvisor#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + +const throwDefaultError = withBaseException(__BaseException); +/** + * deserializeAws_restJson1AccessDeniedExceptionRes + */ +const de_AccessDeniedExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new AccessDeniedException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1InternalServerExceptionRes + */ +const de_InternalServerExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new InternalServerException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ThrottlingExceptionRes + */ +const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ThrottlingException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1ValidationExceptionRes + */ +const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const contents: any = map({}); + const data: any = parsedOutput.body; + const doc = take(data, { + message: __expectString, + }); + Object.assign(contents, doc); + const exception = new ValidationException({ + $metadata: deserializeMetadata(parsedOutput), + ...contents, + }); + return __decorateServiceException(exception, parsedOutput.body); +}; + +/** + * deserializeAws_restJson1AccountRecommendationLifecycleSummary + */ +const de_AccountRecommendationLifecycleSummary = ( + output: any, + context: __SerdeContext +): AccountRecommendationLifecycleSummary => { + return take(output, { + accountId: __expectString, + accountRecommendationArn: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lifecycleStage: __expectString, + updateReason: __expectString, + updateReasonCode: __expectString, + updatedOnBehalfOf: __expectString, + updatedOnBehalfOfJobTitle: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1AccountRecommendationLifecycleSummaryList + */ +const de_AccountRecommendationLifecycleSummaryList = ( + output: any, + context: __SerdeContext +): AccountRecommendationLifecycleSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_AccountRecommendationLifecycleSummary(entry, context); + }); + return retVal; +}; + +// de_CheckSummary omitted. + +// de_CheckSummaryList omitted. + +/** + * deserializeAws_restJson1OrganizationRecommendation + */ +const de_OrganizationRecommendation = (output: any, context: __SerdeContext): OrganizationRecommendation => { + return take(output, { + arn: __expectString, + awsServices: _json, + checkArn: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + createdBy: __expectString, + description: __expectString, + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lifecycleStage: __expectString, + name: __expectString, + pillarSpecificAggregates: (_: any) => de_RecommendationPillarSpecificAggregates(_, context), + pillars: _json, + resolvedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + resourcesAggregates: _json, + source: __expectString, + status: __expectString, + type: __expectString, + updateReason: __expectString, + updateReasonCode: __expectString, + updatedOnBehalfOf: __expectString, + updatedOnBehalfOfJobTitle: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1OrganizationRecommendationResourceSummary + */ +const de_OrganizationRecommendationResourceSummary = ( + output: any, + context: __SerdeContext +): OrganizationRecommendationResourceSummary => { + return take(output, { + accountId: __expectString, + arn: __expectString, + awsResourceId: __expectString, + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + metadata: _json, + recommendationArn: __expectString, + regionCode: __expectString, + status: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1OrganizationRecommendationResourceSummaryList + */ +const de_OrganizationRecommendationResourceSummaryList = ( + output: any, + context: __SerdeContext +): OrganizationRecommendationResourceSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_OrganizationRecommendationResourceSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1OrganizationRecommendationSummary + */ +const de_OrganizationRecommendationSummary = ( + output: any, + context: __SerdeContext +): OrganizationRecommendationSummary => { + return take(output, { + arn: __expectString, + awsServices: _json, + checkArn: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lifecycleStage: __expectString, + name: __expectString, + pillarSpecificAggregates: (_: any) => de_RecommendationPillarSpecificAggregates(_, context), + pillars: _json, + resourcesAggregates: _json, + source: __expectString, + status: __expectString, + type: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1OrganizationRecommendationSummaryList + */ +const de_OrganizationRecommendationSummaryList = ( + output: any, + context: __SerdeContext +): OrganizationRecommendationSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_OrganizationRecommendationSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1Recommendation + */ +const de_Recommendation = (output: any, context: __SerdeContext): Recommendation => { + return take(output, { + arn: __expectString, + awsServices: _json, + checkArn: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + createdBy: __expectString, + description: __expectString, + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lifecycleStage: __expectString, + name: __expectString, + pillarSpecificAggregates: (_: any) => de_RecommendationPillarSpecificAggregates(_, context), + pillars: _json, + resolvedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + resourcesAggregates: _json, + source: __expectString, + status: __expectString, + type: __expectString, + updateReason: __expectString, + updateReasonCode: __expectString, + updatedOnBehalfOf: __expectString, + updatedOnBehalfOfJobTitle: __expectString, + }) as any; +}; + +// de_RecommendationAwsServiceList omitted. + +/** + * deserializeAws_restJson1RecommendationCostOptimizingAggregates + */ +const de_RecommendationCostOptimizingAggregates = ( + output: any, + context: __SerdeContext +): RecommendationCostOptimizingAggregates => { + return take(output, { + estimatedMonthlySavings: __limitedParseDouble, + estimatedPercentMonthlySavings: __limitedParseDouble, + }) as any; +}; + +// de_RecommendationPillarList omitted. + +/** + * deserializeAws_restJson1RecommendationPillarSpecificAggregates + */ +const de_RecommendationPillarSpecificAggregates = ( + output: any, + context: __SerdeContext +): RecommendationPillarSpecificAggregates => { + return take(output, { + costOptimizing: (_: any) => de_RecommendationCostOptimizingAggregates(_, context), + }) as any; +}; + +// de_RecommendationResourcesAggregates omitted. + +/** + * deserializeAws_restJson1RecommendationResourceSummary + */ +const de_RecommendationResourceSummary = (output: any, context: __SerdeContext): RecommendationResourceSummary => { + return take(output, { + arn: __expectString, + awsResourceId: __expectString, + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + metadata: _json, + recommendationArn: __expectString, + regionCode: __expectString, + status: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1RecommendationResourceSummaryList + */ +const de_RecommendationResourceSummaryList = ( + output: any, + context: __SerdeContext +): RecommendationResourceSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_RecommendationResourceSummary(entry, context); + }); + return retVal; +}; + +/** + * deserializeAws_restJson1RecommendationSummary + */ +const de_RecommendationSummary = (output: any, context: __SerdeContext): RecommendationSummary => { + return take(output, { + arn: __expectString, + awsServices: _json, + checkArn: __expectString, + createdAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + id: __expectString, + lastUpdatedAt: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + lifecycleStage: __expectString, + name: __expectString, + pillarSpecificAggregates: (_: any) => de_RecommendationPillarSpecificAggregates(_, context), + pillars: _json, + resourcesAggregates: _json, + source: __expectString, + status: __expectString, + type: __expectString, + }) as any; +}; + +/** + * deserializeAws_restJson1RecommendationSummaryList + */ +const de_RecommendationSummaryList = (output: any, context: __SerdeContext): RecommendationSummary[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_RecommendationSummary(entry, context); + }); + return retVal; +}; + +// de_StringMap omitted. + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + requestId: + output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"], + extendedRequestId: output.headers["x-amz-id-2"], + cfId: output.headers["x-amz-cf-id"], +}); + +// Encode Uint8Array data into string with utf-8. +const collectBodyString = (streamBody: any, context: __SerdeContext): Promise => + collectBody(streamBody, context).then((body) => context.utf8Encoder(body)); + +const isSerializableHeaderValue = (value: any): boolean => + value !== undefined && + value !== null && + value !== "" && + (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && + (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); + +const parseBody = (streamBody: any, context: __SerdeContext): any => + collectBodyString(streamBody, context).then((encoded) => { + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); + +const parseErrorBody = async (errorBody: any, context: __SerdeContext) => { + const value = await parseBody(errorBody, context); + value.message = value.message ?? value.Message; + return value; +}; + +/** + * Load an error code for the aws.rest-json-1.1 protocol. + */ +const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string | undefined => { + const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()); + + const sanitizeErrorCode = (rawValue: string | number): string => { + let cleanValue = rawValue; + if (typeof cleanValue === "number") { + cleanValue = cleanValue.toString(); + } + if (cleanValue.indexOf(",") >= 0) { + cleanValue = cleanValue.split(",")[0]; + } + if (cleanValue.indexOf(":") >= 0) { + cleanValue = cleanValue.split(":")[0]; + } + if (cleanValue.indexOf("#") >= 0) { + cleanValue = cleanValue.split("#")[1]; + } + return cleanValue; + }; + + const headerKey = findKey(output.headers, "x-amzn-errortype"); + if (headerKey !== undefined) { + return sanitizeErrorCode(output.headers[headerKey]); + } + + if (data.code !== undefined) { + return sanitizeErrorCode(data.code); + } + + if (data["__type"] !== undefined) { + return sanitizeErrorCode(data["__type"]); + } +}; diff --git a/clients/client-trustedadvisor/src/runtimeConfig.browser.ts b/clients/client-trustedadvisor/src/runtimeConfig.browser.ts new file mode 100644 index 000000000000..6789370ca51f --- /dev/null +++ b/clients/client-trustedadvisor/src/runtimeConfig.browser.ts @@ -0,0 +1,44 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver"; +import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler"; +import { invalidProvider } from "@smithy/invalid-dependency"; +import { calculateBodyLength } from "@smithy/util-body-length-browser"; +import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { TrustedAdvisorClientConfig } from "./TrustedAdvisorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + return { + ...clientSharedValues, + ...config, + runtime: "browser", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, + region: config?.region ?? invalidProvider("Region is missing"), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE), + sha256: config?.sha256 ?? Sha256, + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)), + useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)), + }; +}; diff --git a/clients/client-trustedadvisor/src/runtimeConfig.native.ts b/clients/client-trustedadvisor/src/runtimeConfig.native.ts new file mode 100644 index 000000000000..68ef24f6b601 --- /dev/null +++ b/clients/client-trustedadvisor/src/runtimeConfig.native.ts @@ -0,0 +1,18 @@ +// smithy-typescript generated code +import { Sha256 } from "@aws-crypto/sha256-js"; + +import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser"; +import { TrustedAdvisorClientConfig } from "./TrustedAdvisorClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { + const browserDefaults = getBrowserRuntimeConfig(config); + return { + ...browserDefaults, + ...config, + runtime: "react-native", + sha256: config?.sha256 ?? Sha256, + }; +}; diff --git a/clients/client-trustedadvisor/src/runtimeConfig.shared.ts b/clients/client-trustedadvisor/src/runtimeConfig.shared.ts new file mode 100644 index 000000000000..e7fda821f433 --- /dev/null +++ b/clients/client-trustedadvisor/src/runtimeConfig.shared.ts @@ -0,0 +1,27 @@ +// smithy-typescript generated code +import { NoOpLogger } from "@smithy/smithy-client"; +import { parseUrl } from "@smithy/url-parser"; +import { fromBase64, toBase64 } from "@smithy/util-base64"; +import { fromUtf8, toUtf8 } from "@smithy/util-utf8"; + +import { defaultEndpointResolver } from "./endpoint/endpointResolver"; +import { TrustedAdvisorClientConfig } from "./TrustedAdvisorClient"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { + return { + apiVersion: "2022-09-15", + base64Decoder: config?.base64Decoder ?? fromBase64, + base64Encoder: config?.base64Encoder ?? toBase64, + disableHostPrefix: config?.disableHostPrefix ?? false, + endpointProvider: config?.endpointProvider ?? defaultEndpointResolver, + extensions: config?.extensions ?? [], + logger: config?.logger ?? new NoOpLogger(), + serviceId: config?.serviceId ?? "TrustedAdvisor", + urlParser: config?.urlParser ?? parseUrl, + utf8Decoder: config?.utf8Decoder ?? fromUtf8, + utf8Encoder: config?.utf8Encoder ?? toUtf8, + }; +}; diff --git a/clients/client-trustedadvisor/src/runtimeConfig.ts b/clients/client-trustedadvisor/src/runtimeConfig.ts new file mode 100644 index 000000000000..705ec7334c9f --- /dev/null +++ b/clients/client-trustedadvisor/src/runtimeConfig.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +// @ts-ignore: package.json will be imported from dist folders +import packageInfo from "../package.json"; // eslint-disable-line + +import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; +import { emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core"; +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { + NODE_REGION_CONFIG_FILE_OPTIONS, + NODE_REGION_CONFIG_OPTIONS, + NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, + NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, +} from "@smithy/config-resolver"; +import { Hash } from "@smithy/hash-node"; +import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry"; +import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider"; +import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler"; +import { calculateBodyLength } from "@smithy/util-body-length-node"; +import { DEFAULT_RETRY_MODE } from "@smithy/util-retry"; +import { TrustedAdvisorClientConfig } from "./TrustedAdvisorClient"; +import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; +import { loadConfigsForDefaultMode } from "@smithy/smithy-client"; +import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node"; +import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client"; + +/** + * @internal + */ +export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { + emitWarningIfUnsupportedVersion(process.version); + const defaultsMode = resolveDefaultsModeConfig(config); + const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); + const clientSharedValues = getSharedRuntimeConfig(config); + awsCheckVersion(process.version); + return { + ...clientSharedValues, + ...config, + runtime: "node", + defaultsMode, + bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, + credentialDefaultProvider: + config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), + defaultUserAgentProvider: + config?.defaultUserAgentProvider ?? + defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider), + retryMode: + config?.retryMode ?? + loadNodeConfig({ + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }), + sha256: config?.sha256 ?? Hash.bind(null, "sha256"), + streamCollector: config?.streamCollector ?? streamCollector, + useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), + }; +}; diff --git a/clients/client-trustedadvisor/src/runtimeExtensions.ts b/clients/client-trustedadvisor/src/runtimeExtensions.ts new file mode 100644 index 000000000000..5e5075eec024 --- /dev/null +++ b/clients/client-trustedadvisor/src/runtimeExtensions.ts @@ -0,0 +1,45 @@ +// smithy-typescript generated code +import { + getAwsRegionExtensionConfiguration, + resolveAwsRegionExtensionConfiguration, +} from "@aws-sdk/region-config-resolver"; +import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http"; +import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client"; + +import { TrustedAdvisorExtensionConfiguration } from "./extensionConfiguration"; + +/** + * @public + */ +export interface RuntimeExtension { + configure(extensionConfiguration: TrustedAdvisorExtensionConfiguration): void; +} + +/** + * @public + */ +export interface RuntimeExtensionsConfig { + extensions: RuntimeExtension[]; +} + +const asPartial = >(t: T) => t; + +/** + * @internal + */ +export const resolveRuntimeExtensions = (runtimeConfig: any, extensions: RuntimeExtension[]) => { + const extensionConfiguration: TrustedAdvisorExtensionConfiguration = { + ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)), + ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)), + ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)), + }; + + extensions.forEach((extension) => extension.configure(extensionConfiguration)); + + return { + ...runtimeConfig, + ...resolveAwsRegionExtensionConfiguration(extensionConfiguration), + ...resolveDefaultRuntimeConfig(extensionConfiguration), + ...resolveHttpHandlerRuntimeConfig(extensionConfiguration), + }; +}; diff --git a/clients/client-trustedadvisor/tsconfig.cjs.json b/clients/client-trustedadvisor/tsconfig.cjs.json new file mode 100644 index 000000000000..3567d85ba846 --- /dev/null +++ b/clients/client-trustedadvisor/tsconfig.cjs.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "outDir": "dist-cjs" + } +} diff --git a/clients/client-trustedadvisor/tsconfig.es.json b/clients/client-trustedadvisor/tsconfig.es.json new file mode 100644 index 000000000000..809f57bde65e --- /dev/null +++ b/clients/client-trustedadvisor/tsconfig.es.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "lib": ["dom"], + "module": "esnext", + "outDir": "dist-es" + } +} diff --git a/clients/client-trustedadvisor/tsconfig.json b/clients/client-trustedadvisor/tsconfig.json new file mode 100644 index 000000000000..344909de2128 --- /dev/null +++ b/clients/client-trustedadvisor/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "downlevelIteration": true, + "importHelpers": true, + "incremental": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "useUnknownInCatchVariables": false + }, + "exclude": ["test/"] +} diff --git a/clients/client-trustedadvisor/tsconfig.types.json b/clients/client-trustedadvisor/tsconfig.types.json new file mode 100644 index 000000000000..4c3dfa7b3d25 --- /dev/null +++ b/clients/client-trustedadvisor/tsconfig.types.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "removeComments": false, + "declaration": true, + "declarationDir": "dist-types", + "emitDeclarationOnly": true + }, + "exclude": ["test/**/*", "dist-types/**/*"] +} diff --git a/clients/client-trustedadvisor/typedoc.json b/clients/client-trustedadvisor/typedoc.json new file mode 100644 index 000000000000..8a364aa93b69 --- /dev/null +++ b/clients/client-trustedadvisor/typedoc.json @@ -0,0 +1,6 @@ +{ + "extends": ["../../typedoc.client.json"], + "entryPoints": ["src/index.ts"], + "out": "docs", + "readme": "README.md" +} diff --git a/codegen/sdk-codegen/aws-models/trustedadvisor.json b/codegen/sdk-codegen/aws-models/trustedadvisor.json new file mode 100644 index 000000000000..6c761a1e2eea --- /dev/null +++ b/codegen/sdk-codegen/aws-models/trustedadvisor.json @@ -0,0 +1,3811 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.trustedadvisor#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception that access has been denied due to insufficient access

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.trustedadvisor#AccountId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 12, + "max": 12 + }, + "smithy.api#pattern": "^\\d+$" + } + }, + "com.amazonaws.trustedadvisor#AccountRecommendationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor::\\d{12}:recommendation\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#AccountRecommendationIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 200 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor::\\d{12}:recommendation\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#AccountRecommendationLifecycleSummary": { + "type": "structure", + "members": { + "accountId": { + "target": "com.amazonaws.trustedadvisor#AccountId", + "traits": { + "smithy.api#documentation": "

The AWS account ID

" + } + }, + "accountRecommendationArn": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationArn", + "traits": { + "smithy.api#documentation": "

The Recommendation ARN

" + } + }, + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#RecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The lifecycle stage from AWS Trusted Advisor Priority

" + } + }, + "updatedOnBehalfOf": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information\n is only available when a Technical Account Manager takes an action on a recommendation managed by AWS\n Trusted Advisor Priority\n

" + } + }, + "updatedOnBehalfOfJobTitle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation.\n This information is only available when a Technical Account Manager takes an action on a recommendation\n managed by AWS Trusted Advisor Priority\n

" + } + }, + "updateReason": { + "target": "com.amazonaws.trustedadvisor#RecommendationUpdateReason", + "traits": { + "smithy.api#documentation": "

Reason for the lifecycle stage change

" + } + }, + "updateReasonCode": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode", + "traits": { + "smithy.api#documentation": "

Reason code for the lifecycle state change

" + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was last updated

", + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#documentation": "

Summary of an AccountRecommendationLifecycle for an Organization Recommendation

" + } + }, + "com.amazonaws.trustedadvisor#AccountRecommendationLifecycleSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationLifecycleSummary" + } + }, + "com.amazonaws.trustedadvisor#CheckArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor:::check\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#CheckIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 64 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor:::check\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#CheckSummary": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The unique identifier of the AWS Trusted Advisor Check

", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#CheckArn", + "traits": { + "smithy.api#documentation": "

The ARN of the AWS Trusted Advisor Check

", + "smithy.api#required": {} + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the AWS Trusted Advisor Check

", + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description of what the AWS Trusted Advisor Check is monitoring

", + "smithy.api#required": {} + } + }, + "pillars": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarList", + "traits": { + "smithy.api#documentation": "

The Recommendation pillars that the AWS Trusted Advisor Check falls under

", + "smithy.api#required": {} + } + }, + "awsServices": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsServiceList", + "traits": { + "smithy.api#documentation": "

The AWS Services that the Check applies to

", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.trustedadvisor#StringMap", + "traits": { + "smithy.api#documentation": "

The column headings for the metadata returned in the resource

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A summary of an AWS Trusted Advisor Check

" + } + }, + "com.amazonaws.trustedadvisor#CheckSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#CheckSummary" + } + }, + "com.amazonaws.trustedadvisor#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception that the request was denied due to conflictions in state

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.trustedadvisor#GetOrganizationRecommendation": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#GetOrganizationRecommendationRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#GetOrganizationRecommendationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Get a specific recommendation within an AWS Organizations organization. This API supports only prioritized\n recommendations.\n

", + "smithy.api#examples": [ + { + "title": "Get an AWS Organization's Recommendation by ARN", + "input": { + "organizationRecommendationIdentifier": "arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5" + }, + "output": { + "organizationRecommendation": { + "arn": "arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "name": "Lambda Runtime Deprecation Warning", + "description": "One or more lambdas are using a deprecated runtime", + "awsServices": ["lambda"], + "checkArn": "arn:aws:trustedadvisor:::check/L4dfs2Q4C5", + "id": "9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "lifecycleStage": "resolved", + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 150, + "okCount": 500, + "warningCount": 100 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/organization-recommendations/{organizationRecommendationIdentifier}", + "code": 200 + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#GetOrganizationRecommendationRequest": { + "type": "structure", + "members": { + "organizationRecommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#GetOrganizationRecommendationResponse": { + "type": "structure", + "members": { + "organizationRecommendation": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendation", + "traits": { + "smithy.api#documentation": "

The Recommendation

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#GetRecommendation": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#GetRecommendationRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#GetRecommendationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Get a specific Recommendation

", + "smithy.api#examples": [ + { + "title": "Get a Recommendation by ARN", + "input": { + "recommendationIdentifier": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578" + }, + "output": { + "recommendation": { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "name": "MFA Recommendation", + "description": "Enable multi-factor authentication", + "awsServices": ["iam"], + "checkArn": "arn:aws:trustedadvisor:::check/7DAFEmoDos", + "id": "55fa4d2e-bbb7-491a-833b-5773e9589578", + "lastUpdatedAt": "2023-11-01T15:57:58.673Z", + "pillarSpecificAggregates": { + "costOptimizing": { + "estimatedMonthlySavings": 0.0, + "estimatedPercentMonthlySavings": 0.0 + } + }, + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 0, + "okCount": 0, + "warningCount": 0 + }, + "source": "ta_check", + "status": "error", + "type": "standard" + } + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/recommendations/{recommendationIdentifier}", + "code": 200 + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#GetRecommendationRequest": { + "type": "structure", + "members": { + "recommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#GetRecommendationResponse": { + "type": "structure", + "members": { + "recommendation": { + "target": "com.amazonaws.trustedadvisor#Recommendation", + "traits": { + "smithy.api#documentation": "

The Recommendation

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception to notify that an unexpected internal error occurred during processing of the request

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.trustedadvisor#ListChecks": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListChecksRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListChecksResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List a filterable set of Checks

", + "smithy.api#examples": [ + { + "title": "List all AWS Trusted Advisor Checks", + "input": {}, + "output": { + "checkSummaries": [ + { + "arn": "arn:aws:trustedadvisor:::check/1iG5NDGVre", + "awsServices": ["EC2"], + "description": "Checks security groups for rules that allow unrestricted access to a resource. Unrestricted access increases opportunities for malicious activity (hacking, denial-of-service attacks, loss of data).\n
\n
Note: This check only evaluates security groups that you create and their inbound rules for IPv4 addresses. Security groups created by AWS Directory Services are flagged as red or yellow, but they don’t pose a security risk and can be safely ignored or excluded. For more information, see the Trusted Advisor FAQ.\n
\n
\n

Alert Criteria

\n
\nRed: A security group rule has a source IP address with a /0 suffix for ports other than 25, 80, or 443.\n
\n
\n

Recommended Action

\n
\nRestrict access to only those IP addresses that require it. To restrict access to a specific IP address, set the suffix to /32 (for example, 192.0.2.10/32). Be sure to delete overly permissive rules after creating rules that are more restrictive.\n
\n
\n

Additional Resources

\n
Amazon EC2 Security Groups
\nClassless Inter-Domain Routing (Wikipedia)", + "id": "1iG5NDGVre", + "metadata": {}, + "name": "Security Groups - Unrestricted Access", + "pillars": ["security"], + "source": "ta_check" + }, + { + "arn": "arn:aws:trustedadvisor:::check/1qazXsw23e", + "awsServices": ["RDS"], + "description": "Checks your usage of RDS and provides recommendations on purchase of Reserved Instances to help reduce costs incurred from using RDS On-Demand. AWS generates these recommendations by analyzing your On-Demand usage for the past 30 days. We then simulate every combination of reservations in the generated category of usage in order to identify the best number of each type of Reserved Instance to purchase to maximize your savings. This check covers recommendations based on partial upfront payment option with 1-year or 3-year commitment. This check is not available to accounts linked in Consolidated Billing. Recommendations are only available for the Paying Account.

\r\n

Alert Criteria


\nYellow: Optimizing the purchase of RDS Reserved Instances can help reduce costs.

\r\n

Recommended Action


\r\nSee the Cost Explorer page for more detailed recommendations, customization options (e.g. look-back period, payment option, etc.) and to purchase RDS Reserved Instances.\n
\n
\n

Additional Resources


\nInformation on RDS Reserved Instances and how they can save you money can be found here.
\nFor more information on this recommendation, see Reserved Instance Optimization Check Questions in the Trusted Advisor FAQs.
\nFor more detailed description of fields, see Cost Explorer documentation", + "id": "1qazXsw23e", + "metadata": { + "properties.averageUtilization": "Expected Average Reserved Instance Utilization", + "properties.databaseEdition": "Database Edition", + "properties.databaseEngine": "Database Engine", + "properties.deploymentOption": "Deployment Option", + "properties.estimatedBreakEvenInMonths": "Estimated Break Even (months)", + "properties.estimatedMonthlyOnDemandCost": "Estimated On-Demand Cost Post Recommended Reserved Instance Purchase (monthly)", + "properties.estimatedMonthlySavingsAmount": "Estimated Savings with Recommendation (monthly)", + "properties.family": "Family", + "properties.instanceType": "Instance Type", + "properties.licenseModel": "License Model", + "properties.lookbackPeriodInDays": "Lookback Period (days)", + "properties.recommendedNumberOfInstancesToPurchase": "Recommended number of Reserved Instances to purchase", + "properties.recurringStandardMonthlyCost": "Estimated cost of Reserved Instances (monthly)", + "properties.region": "Region", + "properties.termInYears": "Term (years)", + "properties.upfrontCost": "Upfront Cost of Reserved Instances" + }, + "name": "Amazon Relational Database Service (RDS) Reserved Instance Optimization", + "pillars": ["cost_optimizing"], + "source": "ta_check" + }, + { + "arn": "arn:aws:trustedadvisor:::check/1qw23er45t", + "awsServices": ["Redshift"], + "description": "Checks your usage of Redshift and provides recommendations on purchase of Reserved Nodes to help reduce costs incurred from using Redshift On-Demand. AWS generates these recommendations by analyzing your On-Demand usage for the past 30 days. We then simulate every combination of reservations in the generated category of usage in order to identify the best number of each type of Reserved Nodes to purchase to maximize your savings. This check covers recommendations based on partial upfront payment option with 1-year or 3-year commitment. This check is not available to accounts linked in Consolidated Billing. Recommendations are only available for the Paying Account.

\n

Alert Criteria


Yellow: Optimizing the purchase of Redshift Reserved Nodes can help reduce costs.

\n

Recommended Action


See the Cost Explorer page for more detailed recommendations, customization options (e.g. look-back period, payment option, etc.) and to purchase Redshift Reserved Nodes.

\n

Additional Resources


Information on Redshift Reserved Nodes and how they can save you money can be found here.
\nFor more information on this recommendation, see Reserved Instance Optimization Check Questions in the Trusted Advisor FAQs.
\nFor more detailed description of fields, see Cost Explorer documentation", + "id": "1qw23er45t", + "metadata": { + "properties.averageUtilization": "Expected Average Reserved Node Utilization", + "properties.estimatedBreakEvenInMonths": "Estimated Break Even (months)", + "properties.estimatedMonthlyOnDemandCost": "Estimated On-Demand Cost Post Recommended Reserved Nodes Purchase (monthly)", + "properties.estimatedMonthlySavingsAmount": "Estimated Savings with Recommendation (monthly)", + "properties.family": "Family", + "properties.lookbackPeriodInDays": "Lookback Period (days)", + "properties.nodeType": "Node Type", + "properties.recommendedNumberOfInstancesToPurchase": "Recommended number of Reserved Nodes to purchase", + "properties.recurringStandardMonthlyCost": "Estimated cost of Reserved Nodes (monthly)", + "properties.region": "Region", + "properties.termInYears": "Term (years)", + "properties.upfrontCost": "Upfront Cost of Reserved Nodes" + }, + "name": "Amazon Redshift Reserved Node Optimization", + "pillars": ["cost_optimizing"], + "source": "ta_check" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBRVVwQzBxdDBCOFAzZDRJczV2aGN0cUFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTWxoM2N4K1JBTm9TM2tqVHNBZ0VRZ0R0U1hlNzVJNG4vZHljU0plUWN6NHJONVVHZmVEQ1FsT3pQdmx3V29lUndJMWs4QldJZ3FIRnNJMDUzSTRNSnlWQUsxeCtJN1ROM2hrcmZPUT09sJdl-7H5vLEjKO0UvvSHSUgK48BRPR5gU8d9MbO68zE_aQsbJcIiW0AAVnc6YGhUFEcdpnIszLoB6QHKZwTnEIXv5jkt7nFhorlfeT_YqCAPMrQsbJKGwCRAyTkHYPbQCHZtlE-hb9TnGmBO1I44yB9yoqE2iy9BwsdGm_GDAtBkDWng_WJP0_qWBnZlbtGnJrseVbV5UN1vNfTvxFJ1TQ8JSQpiFwgQ_JIMcj3fVyhON1K1QoWGn6fPpYyN5ZwNh4imjrIBl3O3RoKz5EXpJG3yFqA_UhXIfQa0eaNcRqNadbYkLok=" + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/checks", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "checkSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListChecksRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "pillar": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillar", + "traits": { + "smithy.api#documentation": "

The pillar of the check

", + "smithy.api#httpQuery": "pillar" + } + }, + "awsService": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsService", + "traits": { + "smithy.api#documentation": "

The aws service associated with the check

", + "smithy.api#httpQuery": "awsService" + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the check

", + "smithy.api#httpQuery": "source" + } + }, + "language": { + "target": "com.amazonaws.trustedadvisor#RecommendationLanguage", + "traits": { + "smithy.api#documentation": "

The ISO 639-1 code for the language that you want your checks to appear in.

", + "smithy.api#httpQuery": "language" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListChecksResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "checkSummaries": { + "target": "com.amazonaws.trustedadvisor#CheckSummaryList", + "traits": { + "smithy.api#documentation": "

The list of Checks

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccounts": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccountsRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccountsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the accounts that own the resources for an organization aggregate recommendation. This API only\n supports prioritized recommendations.\n

", + "smithy.api#examples": [ + { + "title": "List all Accounts for an AWS Organization's Recommendation", + "input": { + "organizationRecommendationIdentifier": "arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5" + }, + "output": { + "accountRecommendationLifecycleSummaries": [ + { + "accountId": "000000000000", + "accountRecommendationArn": "arn:aws:trustedadvisor::000000000000:recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "lifecycleStage": "resolved" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBRXh1QXZLTHlrTTFGcExuNmxVbWcxdEFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTUY2WWU5NVVZZXVBY0ZyOS9BZ0VRZ0RzZmZWdkFNYWU3akxUS0Fmc1dBUmdsTlJadWI3ZDhGWHF5eTNBOTloenpzNUJ3WUZnWjY3MzM1N3B2eGVQcDhQMHl3NGJrSFlHMTNEN0NaQT09KF3n6Ghj-Z9I8pjzwpxNB8fZMSZCS2Eh5pZdfoz5BP87e0KUXIzWLwupY-OGmK_klEh_J6lQMjVZmvR_C1BqTqZs0t3O0UNh29UPNdvfxIC2y2Wkrl4vKf8Zjs60ysx_eP9vVX01kpv1mxacIji9gp6lCRkMEAMmCfqW8a4bUKLZ93umoGVdYCPn_nKZHMHvqDtpHO-zHMeW2hXf8RQNQKR9pfWDsp_NBjWBqkaTuNyjOE3ardMrFnyK7CMvIHjBwn8_8guzGpY0UKVNldWzyUQRbgVXTxF-xkSMzxrOm6rxMXFbrAE=" + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/organization-recommendations/{organizationRecommendationIdentifier}/accounts", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "accountRecommendationLifecycleSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccountsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "organizationRecommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "affectedAccountId": { + "target": "com.amazonaws.trustedadvisor#AccountId", + "traits": { + "smithy.api#documentation": "

An account affected by this organization recommendation

", + "smithy.api#httpQuery": "affectedAccountId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccountsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "accountRecommendationLifecycleSummaries": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationLifecycleSummaryList", + "traits": { + "smithy.api#documentation": "

The account recommendations lifecycles that are applicable to the Recommendation

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResources": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResourcesRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResourcesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List Resources of a Recommendation within an Organization. This API only supports prioritized\n recommendations.\n

", + "smithy.api#examples": [ + { + "title": "List all Resources for an AWS Organization's Recommendation", + "input": { + "organizationRecommendationIdentifier": "arn:aws:trustedadvisor:::organization-recommendation/5a694939-2e54-45a2-ae72-730598fa89d0" + }, + "output": { + "organizationRecommendationResourceSummaries": [ + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/5a694939-2e54-45a2-ae72-730598fa89d0/bb38affc0ce0681d9a6cd13f30238ba03a8f63dfe7a379dc403c619119d86af", + "awsResourceId": "database-1-instance-1", + "id": "bb38affc0ce0681d9a6cd13f302383ba03a8f63dfe7a379dc403c619119d86af", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "208.79999999999998", + "instanceName": "database-1-instance-1", + "instanceType": "db.r5.large", + "multiAZ": "false", + "region": "us-west-2", + "resourceARN": "arn:aws:rds:us-west-2:000000000000:db:database-1-instance-1", + "storageSizeGB": "1" + }, + "recommendationArn": "arn:aws:trustedadvisor:::organization-recommendation/5a694939-2e54-45a2-ae72-730598fa89d0", + "regionCode": "us-west-2", + "status": "warning" + }, + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/5a694939-2e54-45a2-ae72-730598fa89d0/51fded4d7a3278818df9cfe344ff5762cec46c095a6763d1ba1ba53bd0e1b0e6", + "awsResourceId": "database-1", + "id": "51fded4d7a3278818df9cfe344ff5762cec46c095a6763d1ba1ba53bd0e1b0e6", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "31.679999999999996", + "instanceName": "database-1", + "instanceType": "db.t3.small", + "multiAZ": "false", + "region": "us-west-2", + "resourceARN": "arn:aws:rds:us-west-2:000000000000:db:database-1", + "storageSizeGB": "20" + }, + "recommendationArn": "arn:aws:trustedadvisor:::organization-recommendation/5a694939-2e54-45a2-ae72-730598fa89d0", + "regionCode": "us-west-2", + "status": "warning" + }, + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/5a694939-2e54-45a2-ae72-730598fa89d0/f4d01bd20f4cd5372062aafc8786c489e48f0ead7cdab121463bf9f89e40a36b", + "awsResourceId": "database-2-instance-1-us-west-2a", + "id": "f4d01bd20f4cd5372062aafc8786c489e48f0ead7cdab121463bf9f89e40a36b", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "187.20000000000002", + "instanceName": "database-2-instance-1-us-west-2a", + "instanceType": "db.r6g.large", + "multiAZ": "true", + "region": "us-west-2", + "resourceARN": "arn:aws:rds:us-west-2:000000000000:db:database-2-instance-1-us-west-2a", + "storageSizeGB": "1" + }, + "recommendationArn": "arn:aws:trustedadvisor:::organization-recommendation/5a694939-2e54-45a2-ae72-730598fa89d0", + "regionCode": "us-west-2", + "status": "warning" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBRkh6azN0L1pnN1RldmE4L0N2TjRBOUFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTTF2dEdvL0hyYjgrekZxL3FBZ0VRZ0Rzem5HWHZiV2NhOG5TdEE5ZmFoWHpSRm1xU0dUcVAvOFBteW5OWFFkZjNKT3NMUXNDblVsMTlCUnZHS3BKQnFZTlNwbXl2VEllaGFEU1gvUT09W0JMIfQ6puz70ZdK2v6sV1XDCgBIh_e6D-jVUuQQjUaIoy0uLO9QfGrlcSiJ-WvNfhbg8zO0JLcNl6s6bXqZZPZYtnMXiZ_-ygAQhajX_ObCAOedCjpcfikGf6d6KwrjVUplGOaO_NA0Xp6LJExCnViusJCzmKbLOHoBSsdEknb4kY88-iZ1lebblumsWBxsZ8ADcguSLon5IXlejoDf6UukwoM3Z7EjIue3O_OR0gT9DST52shjyNObOzPizO-auI2ZoNKE1y4bzIKtWHzqRfAHHMT4VspFBm58564FqedKqF-D71k=" + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/organization-recommendations/{organizationRecommendationIdentifier}/resources", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "organizationRecommendationResourceSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResourcesRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#ResourceStatus", + "traits": { + "smithy.api#documentation": "

The status of the resource

", + "smithy.api#httpQuery": "status" + } + }, + "regionCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Region code of the resource

", + "smithy.api#httpQuery": "regionCode" + } + }, + "organizationRecommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The AWS Organization organization's Recommendation identifier

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "affectedAccountId": { + "target": "com.amazonaws.trustedadvisor#AccountId", + "traits": { + "smithy.api#documentation": "

An account affected by this organization recommendation

", + "smithy.api#httpQuery": "affectedAccountId" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResourcesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "organizationRecommendationResourceSummaries": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationResourceSummaryList", + "traits": { + "smithy.api#documentation": "

A list of Recommendation Resources

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendations": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationsRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List a filterable set of Recommendations within an Organization. This API only supports prioritized\n recommendations.\n

", + "smithy.api#examples": [ + { + "title": "List all of an AWS Organization's Recommendations", + "input": {}, + "output": { + "organizationRecommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "name": "Lambda Runtime Deprecation Warning", + "awsServices": ["lambda"], + "checkArn": "arn:aws:trustedadvisor:::check/L4dfs2Q4C5", + "id": "9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "lifecycleStage": "resolved", + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 150, + "okCount": 500, + "warningCount": 100 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + }, + { + "arn": "arn:aws:trustedadvisor:::organization-recommendation/4ecff4d4-1bc1-4c99-a5b8-0fff9ee500d6", + "name": "Lambda Runtime Deprecation Warning", + "awsServices": ["lambda"], + "checkArn": "arn:aws:trustedadvisor:::check/L4dfs2Q4C5", + "id": "4ecff4d4-1bc1-4c99-a5b8-0fff9ee500d6", + "lifecycleStage": "resolved", + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 150, + "okCount": 500, + "warningCount": 100 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBCmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBSEwveUo0WGtzUERDZUEweDdjVXNJUkFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTVA1Q0tvVHlvaVBMMXBheFJBZ0VRZ0R0M3NSQXhJNVNoNVJGdFpXN2tjc3JRenlDSDFqaHRkbXp6VTYxZkw0V2lKbkhWeTFqZllaY2prNERPd1hUM2lZVjdZdnJpblRjRFNIVHExZz09wONgOWmSmHcQa82lL7tfrIIiz5kwiP348ZRHDFnNtRRBmuyjwEy8nWAjw_ldisYaifLWtlT31JCln5EAe7tt9c5D_pn2gh-m6EIakcQKX61DY-wuxYIKfeu1ibferY2wq_dTEbqXY6OVN-0N84GKe2azBRV9N80PLouIpG-bt9VjsqdTviEFs3eQnEDJnxRGQmgXrJQFTZIqSLDSsC2-niOVkY7HNvWtLT3fHvXUfFDfD5XlMeWL3DBbnD9beij553VbvnbuKj50BcoV2zWqgc8_eFM4xM0Gsc16OajX0Xio6ZdmwOM=" + } + }, + { + "title": "Filter and return a max of one AWS Organization Recommendation that is a part of the \"security\" pillar", + "input": { + "pillar": "security", + "maxResults": 1 + }, + "output": { + "organizationRecommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor:::organization-recommendation/9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "name": "Lambda Runtime Deprecation Warning", + "awsServices": ["lambda"], + "checkArn": "arn:aws:trustedadvisor:::check/L4dfs2Q4C5", + "id": "9534ec9b-bf3a-44e8-8213-2ed68b39d9d5", + "lifecycleStage": "resolved", + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 150, + "okCount": 500, + "warningCount": 100 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBSG15cmpVYXd3bUtUM0J2dzhleUsyakFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTUFadFFiRTl2VmlCZWN4WHNBZ0VRZ0RzdWRPMTFVWDNjUW9MNStEeTU0QktWQlNMeDBSa3RoeG9UZVJONjRFQzJBUDdvMTdvRTMxTWlJL1FvdE9neGtYWk1aZmx1dFpybHBwRjRTUT093orMKsmELla57p7di2_DnzTGQJxzgjD9HBZApR3831zITqaZo5aTHJ8q59gon_DhD0s2sm3dY8f3SmZxI7IevqI6Vz1UTY0C3IIsyA6XrQiXwfNo36mumo_W7eSf9xNk1CD_to2qwxq-b6m1-88SfNzfvzoA4x52DBczJZNYERmdQRkh-CRs3CSnTdFdXvb8fuyONmJnJuSB5x06IIBpMhLIQqNYLkofnsWRxDUAppOE0aRNfzC4iajmWq9JiYytfc9yGsbU4bqplPYerEtSIRau0QfBrnfifJL7VilfaIwrEs_j_ekqLQ==" + } + }, + { + "title": "Use the \"nextToken\" returned from a previous request to fetch the next page of filtered AWS Organization Recommendations that are a part of the \"security\" pillar", + "input": { + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBSG15cmpVYXd3bUtUM0J2dzhleUsyakFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTUFadFFiRTl2VmlCZWN4WHNBZ0VRZ0RzdWRPMTFVWDNjUW9MNStEeTU0QktWQlNMeDBSa3RoeG9UZVJONjRFQzJBUDdvMTdvRTMxTWlJL1FvdE9neGtYWk1aZmx1dFpybHBwRjRTUT093orMKsmELla57p7di2_DnzTGQJxzgjD9HBZApR3831zITqaZo5aTHJ8q59gon_DhD0s2sm3dY8f3SmZxI7IevqI6Vz1UTY0C3IIsyA6XrQiXwfNo36mumo_W7eSf9xNk1CD_to2qwxq-b6m1-88SfNzfvzoA4x52DBczJZNYERmdQRkh-CRs3CSnTdFdXvb8fuyONmJnJuSB5x06IIBpMhLIQqNYLkofnsWRxDUAppOE0aRNfzC4iajmWq9JiYytfc9yGsbU4bqplPYerEtSIRau0QfBrnfifJL7VilfaIwrEs_j_ekqLQ==", + "pillar": "security", + "maxResults": 1 + }, + "output": { + "organizationRecommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor:::organization-recommendation/4ecff4d4-1bc1-4c99-a5b8-0fff9ee500d6", + "name": "Lambda Runtime Deprecation Warning", + "awsServices": ["lambda"], + "checkArn": "arn:aws:trustedadvisor:::check/L4dfs2Q4C5", + "id": "4ecff4d4-1bc1-4c99-a5b8-0fff9ee500d6", + "lifecycleStage": "resolved", + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 150, + "okCount": 500, + "warningCount": 100 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + ] + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/organization-recommendations", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "organizationRecommendationSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

The type of the Recommendation

", + "smithy.api#httpQuery": "type" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#httpQuery": "status" + } + }, + "pillar": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillar", + "traits": { + "smithy.api#documentation": "

The pillar of the Recommendation

", + "smithy.api#httpQuery": "pillar" + } + }, + "awsService": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsService", + "traits": { + "smithy.api#documentation": "

The aws service associated with the Recommendation

", + "smithy.api#httpQuery": "awsService" + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#httpQuery": "source" + } + }, + "checkIdentifier": { + "target": "com.amazonaws.trustedadvisor#CheckIdentifier", + "traits": { + "smithy.api#documentation": "

The check identifier of the Recommendation

", + "smithy.api#httpQuery": "checkIdentifier" + } + }, + "afterLastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

After the last update of the Recommendation

", + "smithy.api#httpQuery": "afterLastUpdatedAt" + } + }, + "beforeLastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

Before the last update of the Recommendation

", + "smithy.api#httpQuery": "beforeLastUpdatedAt" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListOrganizationRecommendationsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "organizationRecommendationSummaries": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationSummaryList", + "traits": { + "smithy.api#documentation": "

The list of Recommendations

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#ListRecommendationResources": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListRecommendationResourcesRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListRecommendationResourcesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List Resources of a Recommendation

", + "smithy.api#examples": [ + { + "title": "List all Resources for a Recommendation", + "input": { + "recommendationIdentifier": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578" + }, + "output": { + "recommendationResourceSummaries": [ + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/55fa4d2e-bbb7-491a-833b-5773e9589578/18959a1f1973cff8e706e9d9bde28bba36cd602a6b2cb86c8b61252835236010", + "id": "18959a1f1973cff8e706e9d9bde28bba36cd602a6b2cb86c8b61252835236010", + "awsResourceId": "webcms-dev-01", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "123.12000000000002", + "instanceName": "webcms-dev-01", + "instanceType": "db.m6i.large", + "multiAZ": "false", + "region": "us-east-1", + "resourceARN": "arn:aws:rds:us-east-1:000000000000:db:webcms-dev-01", + "storageSizeGB": "20" + }, + "recommendationArn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "regionCode": "us-east-1", + "status": "warning" + }, + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/55fa4d2e-bbb7-491a-833b-5773e9589578/e6367ff500ac90db8e4adeb4892e39ee9c36bbf812dcbce4b9e4fefcec9eb63e", + "id": "e6367ff500ac90db8e4adeb4892e39ee9c36bbf812dcbce4b9e4fefcec9eb63e", + "awsResourceId": "aws-dev-db-stack-instance-1", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "29.52", + "instanceName": "aws-dev-db-stack-instance-1", + "instanceType": "db.t2.small", + "multiAZ": "false", + "region": "us-east-1", + "resourceARN": "arn:aws:rds:us-east-1:000000000000:db:aws-dev-db-stack-instance-1", + "storageSizeGB": "1" + }, + "recommendationArn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "regionCode": "us-east-1", + "status": "warning" + }, + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation-resource/55fa4d2e-bbb7-491a-833b-5773e9589578/31aa78ba050a5015d2d38cca7f5f1ce88f70857c4e1c3ad03f8f9fd95dad7459", + "id": "31aa78ba050a5015d2d38cca7f5f1ce88f70857c4e1c3ad03f8f9fd95dad7459", + "awsResourceId": "aws-awesome-apps-stack-db", + "lastUpdatedAt": "2023-11-01T15:09:51.891Z", + "metadata": { + "daysSinceLastConnection": "14", + "estimatedMonthlySavings": "114.48000000000002", + "instanceName": "aws-awesome-apps-stack-db", + "instanceType": "db.m6g.large", + "multiAZ": "false", + "region": "us-east-1", + "resourceARN": "arn:aws:rds:us-east-1:000000000000:db:aws-awesome-apps-stack-db", + "storageSizeGB": "100" + }, + "recommendationArn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "regionCode": "us-east-1", + "status": "warning" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmJTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBRmZpZ2taY09rdSt5VXhocEdLR0k3TUFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTWZoU3BQNUxtMkt3THpCTG5BZ0VRZ0R2WjBHdzljc3RsV2ZiSkg0QkcvUkJQZDhIc0dGTHNLOXhLc1p5bU8vVlBtYy90dThSYmVKVUhxM3RTS1JwUDB4bWp2dU1jSGQxV3BOTU40UT09pyOzpADaUjX5i75XDGEpw6TEkHoxZsepcoWjQtXjvAYrKILVkdI0lpSZqghK4mPnFGgecInr0_-BJ4ud9TPCZmnNxr7MuYTYJVFWArAaddEw3oJFOY8YLQHjJ37LsY_dEpMN6oDwdAdcdyEZBUBeK71f6XPQa0S1sw5Si_NYuJEvQ3bPZiS8V07IUkUUhe_gE1_xjGK2mA3eTW0wiylW0l8jfz3u8lC6md_5GmvVrtphEkWoc4A9DIfR9CsX_bmvOa4P3NI9rZ9-gezuhkd3k3nXqH52hZPI1fl5iyd4vSFXlvaeawI=" + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/recommendations/{recommendationIdentifier}/resources", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "recommendationResourceSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListRecommendationResourcesRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#ResourceStatus", + "traits": { + "smithy.api#documentation": "

The status of the resource

", + "smithy.api#httpQuery": "status" + } + }, + "regionCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Region code of the resource

", + "smithy.api#httpQuery": "regionCode" + } + }, + "recommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListRecommendationResourcesResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "recommendationResourceSummaries": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourceSummaryList", + "traits": { + "smithy.api#documentation": "

A list of Recommendation Resources

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#ListRecommendations": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#ListRecommendationsRequest" + }, + "output": { + "target": "com.amazonaws.trustedadvisor#ListRecommendationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

List a filterable set of Recommendations

", + "smithy.api#examples": [ + { + "title": "List all Recommendations", + "input": {}, + "output": { + "recommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "name": "MFA Recommendation", + "awsServices": ["iam"], + "checkArn": "arn:aws:trustedadvisor:::check/7DAFEmoDos", + "id": "55fa4d2e-bbb7-491a-833b-5773e9589578", + "lastUpdatedAt": "2023-11-01T15:57:58.673Z", + "pillarSpecificAggregates": { + "costOptimizing": { + "estimatedMonthlySavings": 0.0, + "estimatedPercentMonthlySavings": 0.0 + } + }, + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 0, + "okCount": 0, + "warningCount": 0 + }, + "source": "ta_check", + "status": "error", + "type": "standard" + }, + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation/8b602b6f-452d-4cb2-8a9e-c7650955d9cd", + "name": "RDS clusters quota warning", + "awsServices": ["rds"], + "checkArn": "arn:aws:trustedadvisor:::check/gjqMBn6pjz", + "id": "8b602b6f-452d-4cb2-8a9e-c7650955d9cd", + "lastUpdatedAt": "2023-11-01T15:58:17.397Z", + "pillarSpecificAggregates": { + "costOptimizing": { + "estimatedMonthlySavings": 0.0, + "estimatedPercentMonthlySavings": 0.0 + } + }, + "pillars": ["service_limits"], + "resourcesAggregates": { + "errorCount": 0, + "okCount": 0, + "warningCount": 0 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBR3RUWW1ma3MwY0plS0llWENTZHV0SkFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTUVSUDNkclhLblpkd3h4MW5BZ0VRZ0RzTFBpOTlzZmppYXJxMjJoMHlRWDV6bkFuRGZna3FOZEpKaWtuUGloUWpFRzFrSnR6eWV2UGVjWFZudEw1RHQ0dkdvQ1RXL2hGeERFNG44QT09NZONpU850LXJxneOHiAMVmAkpDmCUH5-ob34VBXNqkq9y3s54mW4se3VGv6Ds85WwEaW9uEAM3HpLWMLJjw6u3rLFdwzvNsmicgmGvBd_kZVXJ_bo3Oqgo9koXDg5ltCZt8nxhp-6FnU8dyBDdSENAlQ3ldIb6QIyyRCH5185coh7UYIjbtd7Ne-TMgHk2HsLongKnbz1Lq6dfOm3mqHyJHAmrU8Qnbm10X2Ph9ZsolloEw4HiGMdEKL5-DnGRgXp3gZLuOTrAuukHwqpd1-cRZYHxmjaIUFiSuVuSC4QlWDeeiqlPo=" + } + }, + { + "title": "Filter and return a max of one Recommendation that is a part of AWS IAM", + "input": { + "awsService": "iam", + "maxResults": 1 + }, + "output": { + "recommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation/55fa4d2e-bbb7-491a-833b-5773e9589578", + "name": "MFA Recommendation", + "awsServices": ["iam"], + "checkArn": "arn:aws:trustedadvisor:::check/7DAFEmoDos", + "id": "55fa4d2e-bbb7-491a-833b-5773e9589578", + "lastUpdatedAt": "2023-11-01T15:57:58.673Z", + "pillarSpecificAggregates": { + "costOptimizing": { + "estimatedMonthlySavings": 0.0, + "estimatedPercentMonthlySavings": 0.0 + } + }, + "pillars": ["security"], + "resourcesAggregates": { + "errorCount": 0, + "okCount": 0, + "warningCount": 0 + }, + "source": "ta_check", + "status": "error", + "type": "standard" + } + ], + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBR01zYktEMDlmSm5nSkM1TGYzaWtTNkFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTVlwVDdDRk01cTdzV0JnRmhBZ0VRZ0R1dVg4dkVOYjZYTHJ6WVhvUlBWQVg1YU5KZkkraElsNk5lTjh3TXpzWkhHUEVzWXNkbXI2bTZzNTl1TEhKWUN2dGpqOENpTzVzM0FDT3BqZz09S35zPCUsSxxYFtdXw7z8BaSuDmz9P1Toit_MFrXsfpnPmDd6Q1f1NaJhi3O8NoZvzinXknKoKxTeqSumUaHe7W3n6Xa3661LF979aPdhifpKw3-MQpb5oGdXGgU7UMlXHzwISkND7sLlh_s0V-jkRvWPZjLHwLg4dUCQnIqMEwo5G3IG6Ffn-SKHhqPimTnzgOrxK2i9LA0EEj6msvH00h4YXuG9M3hFP9X52T19ZGZfdDPhVKCtSshXtQ8zcCUB8ykgw8ROJvAwzQk8I1PMIS4dirHySKOgoowu4Um3bZE6hHex-zXsjA==" + } + }, + { + "title": "Use the \"nextToken\" returned from a previous request to fetch the next page of filtered Recommendations that are a part of AWS IAM", + "input": { + "nextToken": "AAMA-EFRSURBSGhRVGVBMmRTaGNReVg2WmJuREtyc2QxUDBYdktFVDg3dXVCMkM2UHVseVBBR01zYktEMDlmSm5nSkM1TGYzaWtTNkFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTVlwVDdDRk01cTdzV0JnRmhBZ0VRZ0R1dVg4dkVOYjZYTHJ6WVhvUlBWQVg1YU5KZkkraElsNk5lTjh3TXpzWkhHUEVzWXNkbXI2bTZzNTl1TEhKWUN2dGpqOENpTzVzM0FDT3BqZz09S35zPCUsSxxYFtdXw7z8BaSuDmz9P1Toit_MFrXsfpnPmDd6Q1f1NaJhi3O8NoZvzinXknKoKxTeqSumUaHe7W3n6Xa3661LF979aPdhifpKw3-MQpb5oGdXGgU7UMlXHzwISkND7sLlh_s0V-jkRvWPZjLHwLg4dUCQnIqMEwo5G3IG6Ffn-SKHhqPimTnzgOrxK2i9LA0EEj6msvH00h4YXuG9M3hFP9X52T19ZGZfdDPhVKCtSshXtQ8zcCUB8ykgw8ROJvAwzQk8I1PMIS4dirHySKOgoowu4Um3bZE6hHex-zXsjA==", + "awsService": "iam", + "maxResults": 1 + }, + "output": { + "recommendationSummaries": [ + { + "arn": "arn:aws:trustedadvisor::000000000000:recommendation/8b602b6f-452d-4cb2-8a9e-c7650955d9cd", + "name": "RDS clusters quota warning", + "awsServices": ["rds"], + "checkArn": "arn:aws:trustedadvisor:::check/gjqMBn6pjz", + "id": "8b602b6f-452d-4cb2-8a9e-c7650955d9cd", + "lastUpdatedAt": "2023-11-01T15:58:17.397Z", + "pillarSpecificAggregates": { + "costOptimizing": { + "estimatedMonthlySavings": 0.0, + "estimatedPercentMonthlySavings": 0.0 + } + }, + "pillars": ["service_limits"], + "resourcesAggregates": { + "errorCount": 0, + "okCount": 0, + "warningCount": 0 + }, + "source": "ta_check", + "status": "ok", + "type": "standard" + } + ] + } + } + ], + "smithy.api#http": { + "method": "GET", + "uri": "/v1/recommendations", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "recommendationSummaries" + }, + "smithy.api#readonly": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#ListRecommendationsRequest": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#httpQuery": "nextToken", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "maxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return per page.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 200 + } + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

The type of the Recommendation

", + "smithy.api#httpQuery": "type" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#httpQuery": "status" + } + }, + "pillar": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillar", + "traits": { + "smithy.api#documentation": "

The pillar of the Recommendation

", + "smithy.api#httpQuery": "pillar" + } + }, + "awsService": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsService", + "traits": { + "smithy.api#documentation": "

The aws service associated with the Recommendation

", + "smithy.api#httpQuery": "awsService" + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#httpQuery": "source" + } + }, + "checkIdentifier": { + "target": "com.amazonaws.trustedadvisor#CheckIdentifier", + "traits": { + "smithy.api#documentation": "

The check identifier of the Recommendation

", + "smithy.api#httpQuery": "checkIdentifier" + } + }, + "afterLastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

After the last update of the Recommendation

", + "smithy.api#httpQuery": "afterLastUpdatedAt" + } + }, + "beforeLastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

Before the last update of the Recommendation

", + "smithy.api#httpQuery": "beforeLastUpdatedAt" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#ListRecommendationsResponse": { + "type": "structure", + "members": { + "nextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The token for the next set of results. Use the value returned in the previous response in the next request\n to retrieve the next set of results.\n

", + "smithy.api#length": { + "min": 4, + "max": 10000 + } + } + }, + "recommendationSummaries": { + "target": "com.amazonaws.trustedadvisor#RecommendationSummaryList", + "traits": { + "smithy.api#documentation": "

The list of Recommendations

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendation": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID which identifies where the Recommendation was produced

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

", + "smithy.api#required": {} + } + }, + "checkArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Trusted Advisor Check ARN that relates to the Recommendation

" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#required": {} + } + }, + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#RecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The lifecycle stage from AWS Trusted Advisor Priority

" + } + }, + "pillars": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarList", + "traits": { + "smithy.api#documentation": "

The Pillars that the Recommendation is optimizing

", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#required": {} + } + }, + "awsServices": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsServiceList", + "traits": { + "smithy.api#documentation": "

The AWS Services that the Recommendation applies to

" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the AWS Trusted Advisor Recommendation

", + "smithy.api#required": {} + } + }, + "resourcesAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourcesAggregates", + "traits": { + "smithy.api#documentation": "

An aggregation of all resources

", + "smithy.api#required": {} + } + }, + "pillarSpecificAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarSpecificAggregates", + "traits": { + "smithy.api#documentation": "

The pillar aggregations for cost savings

" + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was created, if created by AWS Trusted Advisor Priority

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was last updated

", + "smithy.api#timestampFormat": "date-time" + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation

", + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description for AWS Trusted Advisor recommendations

", + "smithy.api#required": {} + } + }, + "createdBy": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The creator, if created by AWS Trusted Advisor Priority

" + } + }, + "updatedOnBehalfOf": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information\n is only available when a Technical Account Manager takes an action on a recommendation managed by AWS\n Trusted Advisor Priority\n

" + } + }, + "updatedOnBehalfOfJobTitle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation.\n This information is only available when a Technical Account Manager takes an action on a recommendation\n managed by AWS Trusted Advisor Priority\n

" + } + }, + "updateReason": { + "target": "com.amazonaws.trustedadvisor#RecommendationUpdateReason", + "traits": { + "smithy.api#documentation": "

Reason for the lifecycle stage change

" + } + }, + "updateReasonCode": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode", + "traits": { + "smithy.api#documentation": "

Reason code for the lifecycle state change

" + } + }, + "resolvedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was resolved

", + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#documentation": "

A Recommendation for accounts within an Organization

" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor:::organization-recommendation\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationIdentifier": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 200 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor:::organization-recommendation\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationResourceSummary": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourceArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "awsResourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS resource identifier

", + "smithy.api#required": {} + } + }, + "regionCode": { + "target": "com.amazonaws.trustedadvisor#RecommendationRegionCode", + "traits": { + "smithy.api#documentation": "

The AWS Region code that the Recommendation Resource is in

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#ResourceStatus", + "traits": { + "smithy.api#documentation": "

The current status of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.trustedadvisor#StringMap", + "traits": { + "smithy.api#documentation": "

Metadata associated with the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation Resource was last updated

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "accountId": { + "target": "com.amazonaws.trustedadvisor#AccountId", + "traits": { + "smithy.api#documentation": "

The AWS account ID

" + } + }, + "recommendationArn": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationArn", + "traits": { + "smithy.api#documentation": "

The Recommendation ARN

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Organization Recommendation Resource Summary

" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationResourceSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationResourceSummary" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationSummary": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID which identifies where the Recommendation was produced

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

", + "smithy.api#required": {} + } + }, + "checkArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Trusted Advisor Check ARN that relates to the Recommendation

" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#required": {} + } + }, + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#RecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The lifecycle stage from AWS Trusted Advisor Priority

" + } + }, + "pillars": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarList", + "traits": { + "smithy.api#documentation": "

The Pillars that the Recommendation is optimizing

", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#required": {} + } + }, + "awsServices": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsServiceList", + "traits": { + "smithy.api#documentation": "

The AWS Services that the Recommendation applies to

" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the AWS Trusted Advisor Recommendation

", + "smithy.api#required": {} + } + }, + "resourcesAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourcesAggregates", + "traits": { + "smithy.api#documentation": "

An aggregation of all resources

", + "smithy.api#required": {} + } + }, + "pillarSpecificAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarSpecificAggregates", + "traits": { + "smithy.api#documentation": "

The pillar aggregations for cost savings

" + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was created, if created by AWS Trusted Advisor Priority

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was last updated

", + "smithy.api#timestampFormat": "date-time" + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Summary of recommendation for accounts within an Organization

" + } + }, + "com.amazonaws.trustedadvisor#OrganizationRecommendationSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationSummary" + } + }, + "com.amazonaws.trustedadvisor#Recommendation": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID which identifies where the Recommendation was produced

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

", + "smithy.api#required": {} + } + }, + "checkArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Trusted Advisor Check ARN that relates to the Recommendation

" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#required": {} + } + }, + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#RecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The lifecycle stage from AWS Trusted Advisor Priority

" + } + }, + "pillars": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarList", + "traits": { + "smithy.api#documentation": "

The Pillars that the Recommendation is optimizing

", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#required": {} + } + }, + "awsServices": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsServiceList", + "traits": { + "smithy.api#documentation": "

The AWS Services that the Recommendation applies to

" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the AWS Trusted Advisor Recommendation

", + "smithy.api#required": {} + } + }, + "resourcesAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourcesAggregates", + "traits": { + "smithy.api#documentation": "

An aggregation of all resources

", + "smithy.api#required": {} + } + }, + "pillarSpecificAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarSpecificAggregates", + "traits": { + "smithy.api#documentation": "

The pillar aggregations for cost savings

" + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was created, if created by AWS Trusted Advisor Priority

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was last updated

", + "smithy.api#timestampFormat": "date-time" + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation

", + "smithy.api#required": {} + } + }, + "description": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A description for AWS Trusted Advisor recommendations

", + "smithy.api#required": {} + } + }, + "createdBy": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The creator, if created by AWS Trusted Advisor Priority

" + } + }, + "updatedOnBehalfOf": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The person on whose behalf a Technical Account Manager (TAM) updated the recommendation. This information\n is only available when a Technical Account Manager takes an action on a recommendation managed by AWS\n Trusted Advisor Priority\n

" + } + }, + "updatedOnBehalfOfJobTitle": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The job title of the person on whose behalf a Technical Account Manager (TAM) updated the recommendation.\n This information is only available when a Technical Account Manager takes an action on a recommendation\n managed by AWS Trusted Advisor Priority\n

" + } + }, + "updateReason": { + "target": "com.amazonaws.trustedadvisor#RecommendationUpdateReason", + "traits": { + "smithy.api#documentation": "

Reason for the lifecycle stage change

" + } + }, + "updateReasonCode": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode", + "traits": { + "smithy.api#documentation": "

Reason code for the lifecycle state change

" + } + }, + "resolvedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was resolved

", + "smithy.api#timestampFormat": "date-time" + } + } + }, + "traits": { + "smithy.api#documentation": "

A Recommendation for an Account

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationAwsService": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 2, + "max": 30 + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationAwsServiceList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsService" + }, + "traits": { + "smithy.api#uniqueItems": {} + } + }, + "com.amazonaws.trustedadvisor#RecommendationCostOptimizingAggregates": { + "type": "structure", + "members": { + "estimatedMonthlySavings": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

The estimated monthly savings

", + "smithy.api#required": {} + } + }, + "estimatedPercentMonthlySavings": { + "target": "smithy.api#Double", + "traits": { + "smithy.api#documentation": "

The estimated percently monthly savings

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Cost optimizing aggregates for a Recommendation

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationLanguage": { + "type": "enum", + "members": { + "ENGLISH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "en" + } + }, + "JAPANESE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ja" + } + }, + "CHINESE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "zh" + } + }, + "FRENCH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "fr" + } + }, + "GERMAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "de" + } + }, + "KOREAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ko" + } + }, + "TRADITIONAL_CHINESE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "zh_TW" + } + }, + "ITALIAN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "it" + } + }, + "SPANISH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "es" + } + }, + "BRAZILIAN_PORTUGUESE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pt_BR" + } + }, + "BAHASA_INDONESIA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "id" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationLifecycleStage": { + "type": "enum", + "members": { + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "in_progress" + } + }, + "PENDING_RESPONSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pending_response" + } + }, + "DISMISSED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "dismissed" + } + }, + "RESOLVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "resolved" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationPillar": { + "type": "enum", + "members": { + "COST_OPTIMIZING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cost_optimizing" + } + }, + "PERFORMANCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "performance" + } + }, + "SECURITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "security" + } + }, + "SERVICE_LIMITS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "service_limits" + } + }, + "FAULT_TOLERANCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "fault_tolerance" + } + }, + "OPERATIONAL_EXCELLENCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "operational_excellence" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationPillarList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillar" + }, + "traits": { + "smithy.api#uniqueItems": {} + } + }, + "com.amazonaws.trustedadvisor#RecommendationPillarSpecificAggregates": { + "type": "structure", + "members": { + "costOptimizing": { + "target": "com.amazonaws.trustedadvisor#RecommendationCostOptimizingAggregates", + "traits": { + "smithy.api#documentation": "

Cost optimizing aggregates

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Recommendation pillar aggregates

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationRegionCode": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 9, + "max": 20 + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationResourceArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:[\\w-]+:trustedadvisor::\\d{12}:recommendation-resource\\/[\\w-]+\\/[\\w-]+$" + } + }, + "com.amazonaws.trustedadvisor#RecommendationResourceSummary": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourceArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "awsResourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS resource identifier

", + "smithy.api#required": {} + } + }, + "regionCode": { + "target": "com.amazonaws.trustedadvisor#RecommendationRegionCode", + "traits": { + "smithy.api#documentation": "

The AWS Region code that the Recommendation Resource is in

", + "smithy.api#required": {} + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#ResourceStatus", + "traits": { + "smithy.api#documentation": "

The current status of the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "metadata": { + "target": "com.amazonaws.trustedadvisor#StringMap", + "traits": { + "smithy.api#documentation": "

Metadata associated with the Recommendation Resource

", + "smithy.api#required": {} + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation Resource was last updated

", + "smithy.api#required": {}, + "smithy.api#timestampFormat": "date-time" + } + }, + "recommendationArn": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationArn", + "traits": { + "smithy.api#documentation": "

The Recommendation ARN

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Summary of a Recommendation Resource

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationResourceSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourceSummary" + } + }, + "com.amazonaws.trustedadvisor#RecommendationResourcesAggregates": { + "type": "structure", + "members": { + "okCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The number of AWS resources that were flagged to be OK according to the Trusted Advisor check

", + "smithy.api#required": {} + } + }, + "warningCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The number of AWS resources that were flagged to have warning according to the Trusted Advisor check\n

", + "smithy.api#required": {} + } + }, + "errorCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The number of AWS resources that were flagged to have errors according to the Trusted Advisor check

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Aggregation of Recommendation Resources

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationSource": { + "type": "enum", + "members": { + "AWS_CONFIG": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "aws_config" + } + }, + "COMPUTE_OPTIMIZER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "compute_optimizer" + } + }, + "COST_EXPLORER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "cost_explorer" + } + }, + "LSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "lse" + } + }, + "MANUAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "manual" + } + }, + "PSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pse" + } + }, + "RDS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "rds" + } + }, + "RESILIENCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "resilience" + } + }, + "RESILIENCE_HUB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "resilience_hub" + } + }, + "SECURITY_HUB": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "security_hub" + } + }, + "STIR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "stir" + } + }, + "TA_CHECK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ta_check" + } + }, + "WELL_ARCHITECTED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "well_architected" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationStatus": { + "type": "enum", + "members": { + "OK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ok" + } + }, + "WARNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "warning" + } + }, + "ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "error" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationSummary": { + "type": "structure", + "members": { + "id": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The ID which identifies where the Recommendation was produced

", + "smithy.api#required": {} + } + }, + "type": { + "target": "com.amazonaws.trustedadvisor#RecommendationType", + "traits": { + "smithy.api#documentation": "

Whether the Recommendation was automated or generated by AWS Trusted Advisor Priority

", + "smithy.api#required": {} + } + }, + "checkArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The AWS Trusted Advisor Check ARN that relates to the Recommendation

" + } + }, + "status": { + "target": "com.amazonaws.trustedadvisor#RecommendationStatus", + "traits": { + "smithy.api#documentation": "

The status of the Recommendation

", + "smithy.api#required": {} + } + }, + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#RecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The lifecycle stage from AWS Trusted Advisor Priority

" + } + }, + "pillars": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarList", + "traits": { + "smithy.api#documentation": "

The Pillars that the Recommendation is optimizing

", + "smithy.api#required": {} + } + }, + "source": { + "target": "com.amazonaws.trustedadvisor#RecommendationSource", + "traits": { + "smithy.api#documentation": "

The source of the Recommendation

", + "smithy.api#required": {} + } + }, + "awsServices": { + "target": "com.amazonaws.trustedadvisor#RecommendationAwsServiceList", + "traits": { + "smithy.api#documentation": "

The AWS Services that the Recommendation applies to

" + } + }, + "name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the AWS Trusted Advisor Recommendation

", + "smithy.api#required": {} + } + }, + "resourcesAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationResourcesAggregates", + "traits": { + "smithy.api#documentation": "

An aggregation of all resources

", + "smithy.api#required": {} + } + }, + "pillarSpecificAggregates": { + "target": "com.amazonaws.trustedadvisor#RecommendationPillarSpecificAggregates", + "traits": { + "smithy.api#documentation": "

The pillar aggregations for cost savings

" + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was created, if created by AWS Trusted Advisor Priority

", + "smithy.api#timestampFormat": "date-time" + } + }, + "lastUpdatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

When the Recommendation was last updated

", + "smithy.api#timestampFormat": "date-time" + } + }, + "arn": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationArn", + "traits": { + "smithy.api#documentation": "

The ARN of the Recommendation

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Summary of Recommendation for an Account

" + } + }, + "com.amazonaws.trustedadvisor#RecommendationSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.trustedadvisor#RecommendationSummary" + } + }, + "com.amazonaws.trustedadvisor#RecommendationType": { + "type": "enum", + "members": { + "STANDARD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "standard" + } + }, + "PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "priority" + } + } + } + }, + "com.amazonaws.trustedadvisor#RecommendationUpdateReason": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 10, + "max": 4096 + }, + "smithy.api#pattern": "^[\\s\\S]*$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.trustedadvisor#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception that the requested resource has not been found

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.trustedadvisor#ResourceStatus": { + "type": "enum", + "members": { + "OK": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ok" + } + }, + "WARNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "warning" + } + }, + "ERROR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "error" + } + } + } + }, + "com.amazonaws.trustedadvisor#StringMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.trustedadvisor#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception to notify that requests are being throttled

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.trustedadvisor#TrustedAdvisor": { + "type": "service", + "version": "2022-09-15", + "operations": [ + { + "target": "com.amazonaws.trustedadvisor#GetOrganizationRecommendation" + }, + { + "target": "com.amazonaws.trustedadvisor#GetRecommendation" + }, + { + "target": "com.amazonaws.trustedadvisor#ListChecks" + }, + { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationAccounts" + }, + { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendationResources" + }, + { + "target": "com.amazonaws.trustedadvisor#ListOrganizationRecommendations" + }, + { + "target": "com.amazonaws.trustedadvisor#ListRecommendationResources" + }, + { + "target": "com.amazonaws.trustedadvisor#ListRecommendations" + }, + { + "target": "com.amazonaws.trustedadvisor#UpdateOrganizationRecommendationLifecycle" + }, + { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycle" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "TrustedAdvisor", + "arnNamespace": "trustedadvisor", + "cloudTrailEventSource": "trustedadvisor.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "trustedadvisor" + }, + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "additionalAllowedHeaders": [ + "amz-sdk-invocation-id", + "amz-sdk-request", + "authorization", + "content-length", + "content-type", + "date", + "retry-after", + "x-amz-apigw-id", + "x-amz-cf-id", + "x-amz-content-sha256", + "x-amz-date", + "x-amz-security-token", + "x-amz-target", + "x-amz-user-agent", + "x-amzn-errormessage", + "x-amzn-errortype", + "x-amzn-platform-id", + "x-amzn-requestid", + "x-amzn-trace-id", + "x-amzn-waf-action", + "x-api-key" + ], + "additionalExposedHeaders": [ + "date", + "retry-after", + "x-amz-apigw-id", + "x-amz-cf-id", + "x-amzn-errormessage", + "x-amzn-errortype", + "x-amzn-requestid", + "x-amzn-trace-id", + "x-amzn-waf-action" + ] + }, + "smithy.api#documentation": "

TrustedAdvisor Public API

", + "smithy.api#title": "TrustedAdvisor Public API", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://trustedadvisor-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://trustedadvisor-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://trustedadvisor.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://trustedadvisor.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://trustedadvisor.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.trustedadvisor#UpdateOrganizationRecommendationLifecycle": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#UpdateOrganizationRecommendationLifecycleRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#ConflictException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Update the lifecyle of a Recommendation within an Organization. This API only supports prioritized\n recommendations.\n

", + "smithy.api#examples": [ + { + "title": "Update the lifecycle stage of an AWS Organization's Recommendation that is managed by AWS Trusted Advisor Priority", + "input": { + "organizationRecommendationIdentifier": "arn:aws:trustedadvisor:::organization-recommendation/96b5e5ca-7930-444c-90c6-06d386128100", + "lifecycleStage": "dismissed", + "updateReasonCode": "not_applicable", + "updateReason": "Does not apply to this resource" + }, + "output": {} + } + ], + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/organization-recommendations/{organizationRecommendationIdentifier}/lifecycle", + "code": 200 + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#UpdateOrganizationRecommendationLifecycleRequest": { + "type": "structure", + "members": { + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The new lifecycle stage

", + "smithy.api#required": {} + } + }, + "updateReason": { + "target": "com.amazonaws.trustedadvisor#RecommendationUpdateReason", + "traits": { + "smithy.api#documentation": "

Reason for the lifecycle stage change

" + } + }, + "updateReasonCode": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode", + "traits": { + "smithy.api#documentation": "

Reason code for the lifecycle state change

" + } + }, + "organizationRecommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#OrganizationRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier for AWS Trusted Advisor Priority recommendations

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycle": { + "type": "operation", + "input": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.trustedadvisor#AccessDeniedException" + }, + { + "target": "com.amazonaws.trustedadvisor#ConflictException" + }, + { + "target": "com.amazonaws.trustedadvisor#InternalServerException" + }, + { + "target": "com.amazonaws.trustedadvisor#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.trustedadvisor#ThrottlingException" + }, + { + "target": "com.amazonaws.trustedadvisor#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Update the lifecyle of a Recommendation. This API only supports prioritized recommendations.

", + "smithy.api#examples": [ + { + "title": "Update the lifecycle stage of a Recommendation managed by AWS Trusted Advisor Priority", + "input": { + "recommendationIdentifier": "arn:aws:trustedadvisor::000000000000:recommendation/861c9c6e-f169-405a-8b59-537a8caccd7a", + "lifecycleStage": "resolved", + "updateReasonCode": "valid_business_case", + "updateReason": "Resolved the recommendation" + }, + "output": {} + } + ], + "smithy.api#http": { + "method": "PUT", + "uri": "/v1/recommendations/{recommendationIdentifier}/lifecycle", + "code": 200 + }, + "smithy.api#idempotent": {}, + "smithy.api#tags": [] + } + }, + "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleRequest": { + "type": "structure", + "members": { + "lifecycleStage": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStage", + "traits": { + "smithy.api#documentation": "

The new lifecycle stage

", + "smithy.api#required": {} + } + }, + "updateReason": { + "target": "com.amazonaws.trustedadvisor#RecommendationUpdateReason", + "traits": { + "smithy.api#documentation": "

Reason for the lifecycle stage change

" + } + }, + "updateReasonCode": { + "target": "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode", + "traits": { + "smithy.api#documentation": "

Reason code for the lifecycle state change

" + } + }, + "recommendationIdentifier": { + "target": "com.amazonaws.trustedadvisor#AccountRecommendationIdentifier", + "traits": { + "smithy.api#documentation": "

The Recommendation identifier for AWS Trusted Advisor Priority recommendations

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStage": { + "type": "enum", + "members": { + "PENDING_RESPONSE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pending_response" + } + }, + "IN_PROGRESS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "in_progress" + } + }, + "DISMISSED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "dismissed" + } + }, + "RESOLVED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "resolved" + } + } + } + }, + "com.amazonaws.trustedadvisor#UpdateRecommendationLifecycleStageReasonCode": { + "type": "enum", + "members": { + "NON_CRITICAL_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "non_critical_account" + } + }, + "TEMPORARY_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "temporary_account" + } + }, + "VALID_BUSINESS_CASE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "valid_business_case" + } + }, + "OTHER_METHODS_AVAILABLE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "other_methods_available" + } + }, + "LOW_PRIORITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "low_priority" + } + }, + "NOT_APPLICABLE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "not_applicable" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "other" + } + } + } + }, + "com.amazonaws.trustedadvisor#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Exception that the request failed to satisfy service constraints

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +}