Skip to content

Commit

Permalink
feat(client-trustedadvisor): This release adds the BatchUpdateRecomme…
Browse files Browse the repository at this point in the history
…ndationResourceExclusion API to support batch updates of Recommendation Resource exclusion statuses and introduces a new exclusion status filter to the ListRecommendationResources and ListOrganizationRecommendationResources APIs.
  • Loading branch information
awstools committed Apr 29, 2024
1 parent 4f7a643 commit 5fb127b
Show file tree
Hide file tree
Showing 11 changed files with 763 additions and 222 deletions.
8 changes: 8 additions & 0 deletions clients/client-trustedadvisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
BatchUpdateRecommendationResourceExclusion
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/trustedadvisor/command/BatchUpdateRecommendationResourceExclusionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-trustedadvisor/Interface/BatchUpdateRecommendationResourceExclusionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-trustedadvisor/Interface/BatchUpdateRecommendationResourceExclusionCommandOutput/)

</details>
<details>
<summary>
GetOrganizationRecommendation
Expand Down
23 changes: 23 additions & 0 deletions clients/client-trustedadvisor/src/TrustedAdvisor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
BatchUpdateRecommendationResourceExclusionCommand,
BatchUpdateRecommendationResourceExclusionCommandInput,
BatchUpdateRecommendationResourceExclusionCommandOutput,
} from "./commands/BatchUpdateRecommendationResourceExclusionCommand";
import {
GetOrganizationRecommendationCommand,
GetOrganizationRecommendationCommandInput,
Expand Down Expand Up @@ -51,6 +56,7 @@ import {
import { TrustedAdvisorClient, TrustedAdvisorClientConfig } from "./TrustedAdvisorClient";

const commands = {
BatchUpdateRecommendationResourceExclusionCommand,
GetOrganizationRecommendationCommand,
GetRecommendationCommand,
ListChecksCommand,
Expand All @@ -64,6 +70,23 @@ const commands = {
};

export interface TrustedAdvisor {
/**
* @see {@link BatchUpdateRecommendationResourceExclusionCommand}
*/
batchUpdateRecommendationResourceExclusion(
args: BatchUpdateRecommendationResourceExclusionCommandInput,
options?: __HttpHandlerOptions
): Promise<BatchUpdateRecommendationResourceExclusionCommandOutput>;
batchUpdateRecommendationResourceExclusion(
args: BatchUpdateRecommendationResourceExclusionCommandInput,
cb: (err: any, data?: BatchUpdateRecommendationResourceExclusionCommandOutput) => void
): void;
batchUpdateRecommendationResourceExclusion(
args: BatchUpdateRecommendationResourceExclusionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: BatchUpdateRecommendationResourceExclusionCommandOutput) => void
): void;

/**
* @see {@link GetOrganizationRecommendationCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-trustedadvisor/src/TrustedAdvisorClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import {
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import {
BatchUpdateRecommendationResourceExclusionCommandInput,
BatchUpdateRecommendationResourceExclusionCommandOutput,
} from "./commands/BatchUpdateRecommendationResourceExclusionCommand";
import {
GetOrganizationRecommendationCommandInput,
GetOrganizationRecommendationCommandOutput,
Expand Down Expand Up @@ -102,6 +106,7 @@ export { __Client };
* @public
*/
export type ServiceInputTypes =
| BatchUpdateRecommendationResourceExclusionCommandInput
| GetOrganizationRecommendationCommandInput
| GetRecommendationCommandInput
| ListChecksCommandInput
Expand All @@ -117,6 +122,7 @@ export type ServiceInputTypes =
* @public
*/
export type ServiceOutputTypes =
| BatchUpdateRecommendationResourceExclusionCommandOutput
| GetOrganizationRecommendationCommandOutput
| GetRecommendationCommandOutput
| ListChecksCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import {
BatchUpdateRecommendationResourceExclusionRequest,
BatchUpdateRecommendationResourceExclusionResponse,
} from "../models/models_0";
import {
de_BatchUpdateRecommendationResourceExclusionCommand,
se_BatchUpdateRecommendationResourceExclusionCommand,
} from "../protocols/Aws_restJson1";
import { ServiceInputTypes, ServiceOutputTypes, TrustedAdvisorClientResolvedConfig } from "../TrustedAdvisorClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link BatchUpdateRecommendationResourceExclusionCommand}.
*/
export interface BatchUpdateRecommendationResourceExclusionCommandInput
extends BatchUpdateRecommendationResourceExclusionRequest {}
/**
* @public
*
* The output of {@link BatchUpdateRecommendationResourceExclusionCommand}.
*/
export interface BatchUpdateRecommendationResourceExclusionCommandOutput
extends BatchUpdateRecommendationResourceExclusionResponse,
__MetadataBearer {}

/**
* <p>Update one or more exclusion status for a list of recommendation resources</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { TrustedAdvisorClient, BatchUpdateRecommendationResourceExclusionCommand } from "@aws-sdk/client-trustedadvisor"; // ES Modules import
* // const { TrustedAdvisorClient, BatchUpdateRecommendationResourceExclusionCommand } = require("@aws-sdk/client-trustedadvisor"); // CommonJS import
* const client = new TrustedAdvisorClient(config);
* const input = { // BatchUpdateRecommendationResourceExclusionRequest
* recommendationResourceExclusions: [ // RecommendationResourceExclusionList // required
* { // RecommendationResourceExclusion
* arn: "STRING_VALUE", // required
* isExcluded: true || false, // required
* },
* ],
* };
* const command = new BatchUpdateRecommendationResourceExclusionCommand(input);
* const response = await client.send(command);
* // { // BatchUpdateRecommendationResourceExclusionResponse
* // batchUpdateRecommendationResourceExclusionErrors: [ // UpdateRecommendationResourceExclusionErrorList // required
* // { // UpdateRecommendationResourceExclusionError
* // arn: "STRING_VALUE",
* // errorCode: "STRING_VALUE",
* // errorMessage: "STRING_VALUE",
* // },
* // ],
* // };
*
* ```
*
* @param BatchUpdateRecommendationResourceExclusionCommandInput - {@link BatchUpdateRecommendationResourceExclusionCommandInput}
* @returns {@link BatchUpdateRecommendationResourceExclusionCommandOutput}
* @see {@link BatchUpdateRecommendationResourceExclusionCommandInput} for command's `input` shape.
* @see {@link BatchUpdateRecommendationResourceExclusionCommandOutput} for command's `response` shape.
* @see {@link TrustedAdvisorClientResolvedConfig | config} for TrustedAdvisorClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>Exception that access has been denied due to insufficient access</p>
*
* @throws {@link ConflictException} (client fault)
* <p>Exception that the request was denied due to conflictions in state</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>Exception to notify that an unexpected internal error occurred during processing of the request</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Exception to notify that requests are being throttled</p>
*
* @throws {@link ValidationException} (client fault)
* <p>Exception that the request failed to satisfy service constraints</p>
*
* @throws {@link TrustedAdvisorServiceException}
* <p>Base exception class for all service exceptions from TrustedAdvisor service.</p>
*
* @public
*/
export class BatchUpdateRecommendationResourceExclusionCommand extends $Command
.classBuilder<
BatchUpdateRecommendationResourceExclusionCommandInput,
BatchUpdateRecommendationResourceExclusionCommandOutput,
TrustedAdvisorClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: TrustedAdvisorClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("TrustedAdvisor", "BatchUpdateRecommendationResourceExclusion", {})
.n("TrustedAdvisorClient", "BatchUpdateRecommendationResourceExclusionCommand")
.f(void 0, void 0)
.ser(se_BatchUpdateRecommendationResourceExclusionCommand)
.de(de_BatchUpdateRecommendationResourceExclusionCommand)
.build() {}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface ListOrganizationRecommendationResourcesCommandOutput
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* status: "ok" || "warning" || "error",
* exclusionStatus: "excluded" || "included",
* regionCode: "STRING_VALUE",
* organizationRecommendationIdentifier: "STRING_VALUE", // required
* affectedAccountId: "STRING_VALUE",
Expand All @@ -68,6 +69,7 @@ export interface ListOrganizationRecommendationResourcesCommandOutput
* // "<keys>": "STRING_VALUE",
* // },
* // lastUpdatedAt: new Date("TIMESTAMP"), // required
* // exclusionStatus: "excluded" || "included",
* // accountId: "STRING_VALUE",
* // recommendationArn: "STRING_VALUE", // required
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface ListRecommendationResourcesCommandOutput
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* status: "ok" || "warning" || "error",
* exclusionStatus: "excluded" || "included",
* regionCode: "STRING_VALUE",
* recommendationIdentifier: "STRING_VALUE", // required
* };
Expand All @@ -61,6 +62,7 @@ export interface ListRecommendationResourcesCommandOutput
* // "<keys>": "STRING_VALUE",
* // },
* // lastUpdatedAt: new Date("TIMESTAMP"), // required
* // exclusionStatus: "excluded" || "included",
* // recommendationArn: "STRING_VALUE", // required
* // },
* // ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface UpdateOrganizationRecommendationLifecycleCommandInput
export interface UpdateOrganizationRecommendationLifecycleCommandOutput extends __MetadataBearer {}

/**
* <p>Update the lifecyle of a Recommendation within an Organization. This API only supports prioritized
* <p>Update the lifecycle of a Recommendation within an Organization. This API only supports prioritized
* recommendations.
* </p>
* @example
Expand Down
1 change: 1 addition & 0 deletions clients/client-trustedadvisor/src/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// smithy-typescript generated code
export * from "./BatchUpdateRecommendationResourceExclusionCommand";
export * from "./GetOrganizationRecommendationCommand";
export * from "./GetRecommendationCommand";
export * from "./ListChecksCommand";
Expand Down
Loading

0 comments on commit 5fb127b

Please sign in to comment.