|
| 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 { HealthClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../HealthClient"; |
| 17 | +import { |
| 18 | + DescribeEntityAggregatesForOrganizationRequest, |
| 19 | + DescribeEntityAggregatesForOrganizationResponse, |
| 20 | +} from "../models/models_0"; |
| 21 | +import { |
| 22 | + de_DescribeEntityAggregatesForOrganizationCommand, |
| 23 | + se_DescribeEntityAggregatesForOrganizationCommand, |
| 24 | +} from "../protocols/Aws_json1_1"; |
| 25 | + |
| 26 | +/** |
| 27 | + * @public |
| 28 | + */ |
| 29 | +export { __MetadataBearer, $Command }; |
| 30 | +/** |
| 31 | + * @public |
| 32 | + * |
| 33 | + * The input for {@link DescribeEntityAggregatesForOrganizationCommand}. |
| 34 | + */ |
| 35 | +export interface DescribeEntityAggregatesForOrganizationCommandInput |
| 36 | + extends DescribeEntityAggregatesForOrganizationRequest {} |
| 37 | +/** |
| 38 | + * @public |
| 39 | + * |
| 40 | + * The output of {@link DescribeEntityAggregatesForOrganizationCommand}. |
| 41 | + */ |
| 42 | +export interface DescribeEntityAggregatesForOrganizationCommandOutput |
| 43 | + extends DescribeEntityAggregatesForOrganizationResponse, |
| 44 | + __MetadataBearer {} |
| 45 | + |
| 46 | +/** |
| 47 | + * @public |
| 48 | + * <p>Returns a list of entity aggregates for your Organizations that are affected by each of the specified events.</p> |
| 49 | + * @example |
| 50 | + * Use a bare-bones client and the command you need to make an API call. |
| 51 | + * ```javascript |
| 52 | + * import { HealthClient, DescribeEntityAggregatesForOrganizationCommand } from "@aws-sdk/client-health"; // ES Modules import |
| 53 | + * // const { HealthClient, DescribeEntityAggregatesForOrganizationCommand } = require("@aws-sdk/client-health"); // CommonJS import |
| 54 | + * const client = new HealthClient(config); |
| 55 | + * const input = { // DescribeEntityAggregatesForOrganizationRequest |
| 56 | + * eventArns: [ // OrganizationEventArnsList // required |
| 57 | + * "STRING_VALUE", |
| 58 | + * ], |
| 59 | + * awsAccountIds: [ // OrganizationAccountIdsList |
| 60 | + * "STRING_VALUE", |
| 61 | + * ], |
| 62 | + * }; |
| 63 | + * const command = new DescribeEntityAggregatesForOrganizationCommand(input); |
| 64 | + * const response = await client.send(command); |
| 65 | + * // { // DescribeEntityAggregatesForOrganizationResponse |
| 66 | + * // organizationEntityAggregates: [ // OrganizationEntityAggregatesList |
| 67 | + * // { // OrganizationEntityAggregate |
| 68 | + * // eventArn: "STRING_VALUE", |
| 69 | + * // count: Number("int"), |
| 70 | + * // statuses: { // entityStatuses |
| 71 | + * // "<keys>": Number("int"), |
| 72 | + * // }, |
| 73 | + * // accounts: [ // AccountEntityAggregatesList |
| 74 | + * // { // AccountEntityAggregate |
| 75 | + * // accountId: "STRING_VALUE", |
| 76 | + * // count: Number("int"), |
| 77 | + * // statuses: { |
| 78 | + * // "<keys>": Number("int"), |
| 79 | + * // }, |
| 80 | + * // }, |
| 81 | + * // ], |
| 82 | + * // }, |
| 83 | + * // ], |
| 84 | + * // }; |
| 85 | + * |
| 86 | + * ``` |
| 87 | + * |
| 88 | + * @param DescribeEntityAggregatesForOrganizationCommandInput - {@link DescribeEntityAggregatesForOrganizationCommandInput} |
| 89 | + * @returns {@link DescribeEntityAggregatesForOrganizationCommandOutput} |
| 90 | + * @see {@link DescribeEntityAggregatesForOrganizationCommandInput} for command's `input` shape. |
| 91 | + * @see {@link DescribeEntityAggregatesForOrganizationCommandOutput} for command's `response` shape. |
| 92 | + * @see {@link HealthClientResolvedConfig | config} for HealthClient's `config` shape. |
| 93 | + * |
| 94 | + * @throws {@link HealthServiceException} |
| 95 | + * <p>Base exception class for all service exceptions from Health service.</p> |
| 96 | + * |
| 97 | + */ |
| 98 | +export class DescribeEntityAggregatesForOrganizationCommand extends $Command< |
| 99 | + DescribeEntityAggregatesForOrganizationCommandInput, |
| 100 | + DescribeEntityAggregatesForOrganizationCommandOutput, |
| 101 | + HealthClientResolvedConfig |
| 102 | +> { |
| 103 | + // Start section: command_properties |
| 104 | + // End section: command_properties |
| 105 | + |
| 106 | + public static getEndpointParameterInstructions(): EndpointParameterInstructions { |
| 107 | + return { |
| 108 | + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, |
| 109 | + Endpoint: { type: "builtInParams", name: "endpoint" }, |
| 110 | + Region: { type: "builtInParams", name: "region" }, |
| 111 | + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, |
| 112 | + }; |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * @public |
| 117 | + */ |
| 118 | + constructor(readonly input: DescribeEntityAggregatesForOrganizationCommandInput) { |
| 119 | + // Start section: command_constructor |
| 120 | + super(); |
| 121 | + // End section: command_constructor |
| 122 | + } |
| 123 | + |
| 124 | + /** |
| 125 | + * @internal |
| 126 | + */ |
| 127 | + resolveMiddleware( |
| 128 | + clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, |
| 129 | + configuration: HealthClientResolvedConfig, |
| 130 | + options?: __HttpHandlerOptions |
| 131 | + ): Handler< |
| 132 | + DescribeEntityAggregatesForOrganizationCommandInput, |
| 133 | + DescribeEntityAggregatesForOrganizationCommandOutput |
| 134 | + > { |
| 135 | + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); |
| 136 | + this.middlewareStack.use( |
| 137 | + getEndpointPlugin( |
| 138 | + configuration, |
| 139 | + DescribeEntityAggregatesForOrganizationCommand.getEndpointParameterInstructions() |
| 140 | + ) |
| 141 | + ); |
| 142 | + |
| 143 | + const stack = clientStack.concat(this.middlewareStack); |
| 144 | + |
| 145 | + const { logger } = configuration; |
| 146 | + const clientName = "HealthClient"; |
| 147 | + const commandName = "DescribeEntityAggregatesForOrganizationCommand"; |
| 148 | + const handlerExecutionContext: HandlerExecutionContext = { |
| 149 | + logger, |
| 150 | + clientName, |
| 151 | + commandName, |
| 152 | + inputFilterSensitiveLog: (_: any) => _, |
| 153 | + outputFilterSensitiveLog: (_: any) => _, |
| 154 | + }; |
| 155 | + const { requestHandler } = configuration; |
| 156 | + return stack.resolve( |
| 157 | + (request: FinalizeHandlerArguments<any>) => |
| 158 | + requestHandler.handle(request.request as __HttpRequest, options || {}), |
| 159 | + handlerExecutionContext |
| 160 | + ); |
| 161 | + } |
| 162 | + |
| 163 | + /** |
| 164 | + * @internal |
| 165 | + */ |
| 166 | + private serialize( |
| 167 | + input: DescribeEntityAggregatesForOrganizationCommandInput, |
| 168 | + context: __SerdeContext |
| 169 | + ): Promise<__HttpRequest> { |
| 170 | + return se_DescribeEntityAggregatesForOrganizationCommand(input, context); |
| 171 | + } |
| 172 | + |
| 173 | + /** |
| 174 | + * @internal |
| 175 | + */ |
| 176 | + private deserialize( |
| 177 | + output: __HttpResponse, |
| 178 | + context: __SerdeContext |
| 179 | + ): Promise<DescribeEntityAggregatesForOrganizationCommandOutput> { |
| 180 | + return de_DescribeEntityAggregatesForOrganizationCommand(output, context); |
| 181 | + } |
| 182 | + |
| 183 | + // Start section: command_body_extra |
| 184 | + // End section: command_body_extra |
| 185 | +} |
0 commit comments