|
| 1 | +// smithy-typescript generated code |
| 2 | +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; |
| 5 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 6 | +import { |
| 7 | + FinalizeHandlerArguments, |
| 8 | + Handler, |
| 9 | + HandlerExecutionContext, |
| 10 | + HttpHandlerOptions as __HttpHandlerOptions, |
| 11 | + MetadataBearer as __MetadataBearer, |
| 12 | + MiddlewareStack, |
| 13 | + SerdeContext as __SerdeContext, |
| 14 | +} from "@smithy/types"; |
| 15 | + |
| 16 | +import { BatchUpdateRecommendationStatusRequest, BatchUpdateRecommendationStatusResponse } from "../models/models_0"; |
| 17 | +import { |
| 18 | + de_BatchUpdateRecommendationStatusCommand, |
| 19 | + se_BatchUpdateRecommendationStatusCommand, |
| 20 | +} from "../protocols/Aws_restJson1"; |
| 21 | +import { ResiliencehubClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ResiliencehubClient"; |
| 22 | + |
| 23 | +/** |
| 24 | + * @public |
| 25 | + */ |
| 26 | +export { __MetadataBearer, $Command }; |
| 27 | +/** |
| 28 | + * @public |
| 29 | + * |
| 30 | + * The input for {@link BatchUpdateRecommendationStatusCommand}. |
| 31 | + */ |
| 32 | +export interface BatchUpdateRecommendationStatusCommandInput extends BatchUpdateRecommendationStatusRequest {} |
| 33 | +/** |
| 34 | + * @public |
| 35 | + * |
| 36 | + * The output of {@link BatchUpdateRecommendationStatusCommand}. |
| 37 | + */ |
| 38 | +export interface BatchUpdateRecommendationStatusCommandOutput |
| 39 | + extends BatchUpdateRecommendationStatusResponse, |
| 40 | + __MetadataBearer {} |
| 41 | + |
| 42 | +/** |
| 43 | + * @public |
| 44 | + * <p>Enables you to include or exclude one or more operational recommendations.</p> |
| 45 | + * @example |
| 46 | + * Use a bare-bones client and the command you need to make an API call. |
| 47 | + * ```javascript |
| 48 | + * import { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } from "@aws-sdk/client-resiliencehub"; // ES Modules import |
| 49 | + * // const { ResiliencehubClient, BatchUpdateRecommendationStatusCommand } = require("@aws-sdk/client-resiliencehub"); // CommonJS import |
| 50 | + * const client = new ResiliencehubClient(config); |
| 51 | + * const input = { // BatchUpdateRecommendationStatusRequest |
| 52 | + * appArn: "STRING_VALUE", // required |
| 53 | + * requestEntries: [ // UpdateRecommendationStatusRequestEntries // required |
| 54 | + * { // UpdateRecommendationStatusRequestEntry |
| 55 | + * entryId: "STRING_VALUE", // required |
| 56 | + * referenceId: "STRING_VALUE", // required |
| 57 | + * item: { // UpdateRecommendationStatusItem |
| 58 | + * resourceId: "STRING_VALUE", |
| 59 | + * targetAccountId: "STRING_VALUE", |
| 60 | + * targetRegion: "STRING_VALUE", |
| 61 | + * }, |
| 62 | + * excluded: true || false, // required |
| 63 | + * excludeReason: "STRING_VALUE", |
| 64 | + * }, |
| 65 | + * ], |
| 66 | + * }; |
| 67 | + * const command = new BatchUpdateRecommendationStatusCommand(input); |
| 68 | + * const response = await client.send(command); |
| 69 | + * // { // BatchUpdateRecommendationStatusResponse |
| 70 | + * // appArn: "STRING_VALUE", // required |
| 71 | + * // successfulEntries: [ // BatchUpdateRecommendationStatusSuccessfulEntries // required |
| 72 | + * // { // BatchUpdateRecommendationStatusSuccessfulEntry |
| 73 | + * // entryId: "STRING_VALUE", // required |
| 74 | + * // referenceId: "STRING_VALUE", // required |
| 75 | + * // item: { // UpdateRecommendationStatusItem |
| 76 | + * // resourceId: "STRING_VALUE", |
| 77 | + * // targetAccountId: "STRING_VALUE", |
| 78 | + * // targetRegion: "STRING_VALUE", |
| 79 | + * // }, |
| 80 | + * // excluded: true || false, // required |
| 81 | + * // excludeReason: "STRING_VALUE", |
| 82 | + * // }, |
| 83 | + * // ], |
| 84 | + * // failedEntries: [ // BatchUpdateRecommendationStatusFailedEntries // required |
| 85 | + * // { // BatchUpdateRecommendationStatusFailedEntry |
| 86 | + * // entryId: "STRING_VALUE", // required |
| 87 | + * // errorMessage: "STRING_VALUE", // required |
| 88 | + * // }, |
| 89 | + * // ], |
| 90 | + * // }; |
| 91 | + * |
| 92 | + * ``` |
| 93 | + * |
| 94 | + * @param BatchUpdateRecommendationStatusCommandInput - {@link BatchUpdateRecommendationStatusCommandInput} |
| 95 | + * @returns {@link BatchUpdateRecommendationStatusCommandOutput} |
| 96 | + * @see {@link BatchUpdateRecommendationStatusCommandInput} for command's `input` shape. |
| 97 | + * @see {@link BatchUpdateRecommendationStatusCommandOutput} for command's `response` shape. |
| 98 | + * @see {@link ResiliencehubClientResolvedConfig | config} for ResiliencehubClient's `config` shape. |
| 99 | + * |
| 100 | + * @throws {@link AccessDeniedException} (client fault) |
| 101 | + * <p>You don't have permissions to perform the requested operation. The user or role that is |
| 102 | + * making the request must have at least one IAM permissions policy attached that grants the |
| 103 | + * required permissions.</p> |
| 104 | + * |
| 105 | + * @throws {@link InternalServerException} (server fault) |
| 106 | + * <p>This exception occurs when there is an internal failure in the Resilience Hub |
| 107 | + * service.</p> |
| 108 | + * |
| 109 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 110 | + * <p>This exception occurs when the specified resource could not be found.</p> |
| 111 | + * |
| 112 | + * @throws {@link ThrottlingException} (client fault) |
| 113 | + * <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p> |
| 114 | + * |
| 115 | + * @throws {@link ValidationException} (client fault) |
| 116 | + * <p>This exception occurs when a request is not valid.</p> |
| 117 | + * |
| 118 | + * @throws {@link ResiliencehubServiceException} |
| 119 | + * <p>Base exception class for all service exceptions from Resiliencehub service.</p> |
| 120 | + * |
| 121 | + */ |
| 122 | +export class BatchUpdateRecommendationStatusCommand extends $Command< |
| 123 | + BatchUpdateRecommendationStatusCommandInput, |
| 124 | + BatchUpdateRecommendationStatusCommandOutput, |
| 125 | + ResiliencehubClientResolvedConfig |
| 126 | +> { |
| 127 | + // Start section: command_properties |
| 128 | + // End section: command_properties |
| 129 | + |
| 130 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 131 | + return { |
| 132 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 133 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 134 | + Region: { type: "builtInParams", name: "region" }, |
| 135 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 136 | + }; |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * @public |
| 141 | + */ |
| 142 | + constructor(readonly input: BatchUpdateRecommendationStatusCommandInput) { |
| 143 | + // Start section: command_constructor |
| 144 | + super(); |
| 145 | + // End section: command_constructor |
| 146 | + } |
| 147 | + |
| 148 | + /** |
| 149 | + * @internal |
| 150 | + */ |
| 151 | + resolveMiddleware( |
| 152 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 153 | + configuration: ResiliencehubClientResolvedConfig, |
| 154 | + options?: __HttpHandlerOptions |
| 155 | + ): Handler<BatchUpdateRecommendationStatusCommandInput, BatchUpdateRecommendationStatusCommandOutput> { |
| 156 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 157 | + this.middlewareStack.use( |
| 158 | + getEndpointPlugin(configuration, BatchUpdateRecommendationStatusCommand.getEndpointParameterInstructions()) |
| 159 | + ); |
| 160 | + |
| 161 | + const stack = clientStack.concat(this.middlewareStack); |
| 162 | + |
| 163 | + const { logger } = configuration; |
| 164 | + const clientName = "ResiliencehubClient"; |
| 165 | + const commandName = "BatchUpdateRecommendationStatusCommand"; |
| 166 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 167 | + logger, |
| 168 | + clientName, |
| 169 | + commandName, |
| 170 | + inputFilterSensitiveLog: (_: any) => _, |
| 171 | + outputFilterSensitiveLog: (_: any) => _, |
| 172 | + }; |
| 173 | + const { requestHandler } = configuration; |
| 174 | + return stack.resolve( |
| 175 | + (request: FinalizeHandlerArguments<any>) => |
| 176 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 177 | + handlerExecutionContext |
| 178 | + ); |
| 179 | + } |
| 180 | + |
| 181 | + /** |
| 182 | + * @internal |
| 183 | + */ |
| 184 | + private serialize( |
| 185 | + input: BatchUpdateRecommendationStatusCommandInput, |
| 186 | + context: __SerdeContext |
| 187 | + ): Promise<__HttpRequest> { |
| 188 | + return se_BatchUpdateRecommendationStatusCommand(input, context); |
| 189 | + } |
| 190 | + |
| 191 | + /** |
| 192 | + * @internal |
| 193 | + */ |
| 194 | + private deserialize( |
| 195 | + output: __HttpResponse, |
| 196 | + context: __SerdeContext |
| 197 | + ): Promise<BatchUpdateRecommendationStatusCommandOutput> { |
| 198 | + return de_BatchUpdateRecommendationStatusCommand(output, context); |
| 199 | + } |
| 200 | + |
| 201 | + // Start section: command_body_extra |
| 202 | + // End section: command_body_extra |
| 203 | +} |
0 commit comments