From 7b94e36f5716b89d732ba1f2f9e3b02d75c682ea Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Mon, 6 Jan 2020 16:48:15 -0800 Subject: [PATCH] feat: add client-auto-scaling-plans (#656) --- clients/client-auto-scaling-plans/.gitignore | 14 + clients/client-auto-scaling-plans/.npmignore | 4 + .../AutoScalingPlans.ts | 291 +++ .../AutoScalingPlansClient.ts | 225 ++ clients/client-auto-scaling-plans/LICENSE | 201 ++ clients/client-auto-scaling-plans/README.md | 6 + .../commands/CreateScalingPlanCommand.ts | 84 + .../commands/DeleteScalingPlanCommand.ts | 84 + .../DescribeScalingPlanResourcesCommand.ts | 93 + .../commands/DescribeScalingPlansCommand.ts | 87 + ...tScalingPlanResourceForecastDataCommand.ts | 93 + .../commands/UpdateScalingPlanCommand.ts | 84 + .../client-auto-scaling-plans/endpoints.ts | 143 ++ clients/client-auto-scaling-plans/index.ts | 8 + .../client-auto-scaling-plans/models/index.ts | 1576 ++++++++++++++ .../client-auto-scaling-plans/package.json | 75 + .../protocols/Aws_json1_1.ts | 1907 +++++++++++++++++ .../runtimeConfig.browser.ts | 30 + .../runtimeConfig.shared.ts | 7 + .../runtimeConfig.ts | 31 + .../tsconfig.es.json | 19 + .../client-auto-scaling-plans/tsconfig.json | 27 + 22 files changed, 5089 insertions(+) create mode 100644 clients/client-auto-scaling-plans/.gitignore create mode 100644 clients/client-auto-scaling-plans/.npmignore create mode 100644 clients/client-auto-scaling-plans/AutoScalingPlans.ts create mode 100644 clients/client-auto-scaling-plans/AutoScalingPlansClient.ts create mode 100644 clients/client-auto-scaling-plans/LICENSE create mode 100644 clients/client-auto-scaling-plans/README.md create mode 100644 clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts create mode 100644 clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts create mode 100644 clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts create mode 100644 clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts create mode 100644 clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts create mode 100644 clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts create mode 100644 clients/client-auto-scaling-plans/endpoints.ts create mode 100644 clients/client-auto-scaling-plans/index.ts create mode 100644 clients/client-auto-scaling-plans/models/index.ts create mode 100644 clients/client-auto-scaling-plans/package.json create mode 100644 clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.browser.ts create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.shared.ts create mode 100644 clients/client-auto-scaling-plans/runtimeConfig.ts create mode 100644 clients/client-auto-scaling-plans/tsconfig.es.json create mode 100644 clients/client-auto-scaling-plans/tsconfig.json diff --git a/clients/client-auto-scaling-plans/.gitignore b/clients/client-auto-scaling-plans/.gitignore new file mode 100644 index 000000000000..b41c05b597c4 --- /dev/null +++ b/clients/client-auto-scaling-plans/.gitignore @@ -0,0 +1,14 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/types/ +/dist/ +*.tsbuildinfo +*.tgz +*.log +package-lock.json + +*.d.ts +*.js +*.js.map diff --git a/clients/client-auto-scaling-plans/.npmignore b/clients/client-auto-scaling-plans/.npmignore new file mode 100644 index 000000000000..b7ff81137c4a --- /dev/null +++ b/clients/client-auto-scaling-plans/.npmignore @@ -0,0 +1,4 @@ +/coverage/ +/docs/ +tsconfig.test.json +*.tsbuildinfo diff --git a/clients/client-auto-scaling-plans/AutoScalingPlans.ts b/clients/client-auto-scaling-plans/AutoScalingPlans.ts new file mode 100644 index 000000000000..1bf08e42cc5f --- /dev/null +++ b/clients/client-auto-scaling-plans/AutoScalingPlans.ts @@ -0,0 +1,291 @@ +import { AutoScalingPlansClient } from "./AutoScalingPlansClient"; +import { + CreateScalingPlanCommand, + CreateScalingPlanCommandInput, + CreateScalingPlanCommandOutput +} from "./commands/CreateScalingPlanCommand"; +import { + DeleteScalingPlanCommand, + DeleteScalingPlanCommandInput, + DeleteScalingPlanCommandOutput +} from "./commands/DeleteScalingPlanCommand"; +import { + DescribeScalingPlanResourcesCommand, + DescribeScalingPlanResourcesCommandInput, + DescribeScalingPlanResourcesCommandOutput +} from "./commands/DescribeScalingPlanResourcesCommand"; +import { + DescribeScalingPlansCommand, + DescribeScalingPlansCommandInput, + DescribeScalingPlansCommandOutput +} from "./commands/DescribeScalingPlansCommand"; +import { + GetScalingPlanResourceForecastDataCommand, + GetScalingPlanResourceForecastDataCommandInput, + GetScalingPlanResourceForecastDataCommandOutput +} from "./commands/GetScalingPlanResourceForecastDataCommand"; +import { + UpdateScalingPlanCommand, + UpdateScalingPlanCommandInput, + UpdateScalingPlanCommandOutput +} from "./commands/UpdateScalingPlanCommand"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +/** + * + * AWS Auto Scaling + *

Use AWS Auto Scaling to quickly discover all the scalable AWS resources for your application and + * configure dynamic scaling and predictive scaling for your resources using scaling plans. + * Use this service in conjunction with the Amazon EC2 Auto Scaling, Application Auto Scaling, Amazon CloudWatch, and AWS + * CloudFormation services.

+ *

Currently, predictive scaling is only available for Amazon EC2 Auto Scaling groups.

+ *

For more information about AWS Auto Scaling, including information about granting IAM users + * required permissions for AWS Auto Scaling actions, see the AWS Auto Scaling User Guide.

+ * + */ +export class AutoScalingPlans extends AutoScalingPlansClient { + /** + * + *

Creates a scaling plan.

+ * + */ + public createScalingPlan( + args: CreateScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createScalingPlan( + args: CreateScalingPlanCommandInput, + cb: (err: any, data?: CreateScalingPlanCommandOutput) => void + ): void; + public createScalingPlan( + args: CreateScalingPlanCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateScalingPlanCommandOutput) => void + ): void; + public createScalingPlan( + args: CreateScalingPlanCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateScalingPlanCommandOutput) => void), + cb?: (err: any, data?: CreateScalingPlanCommandOutput) => void + ): Promise | void { + const command = new CreateScalingPlanCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Deletes the specified scaling plan.

+ *

Deleting a scaling plan deletes the underlying ScalingInstruction for + * all of the scalable resources that are covered by the plan.

+ *

If the plan has launched resources or has scaling activities in progress, you must + * delete those resources separately.

+ * + */ + public deleteScalingPlan( + args: DeleteScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteScalingPlan( + args: DeleteScalingPlanCommandInput, + cb: (err: any, data?: DeleteScalingPlanCommandOutput) => void + ): void; + public deleteScalingPlan( + args: DeleteScalingPlanCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteScalingPlanCommandOutput) => void + ): void; + public deleteScalingPlan( + args: DeleteScalingPlanCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteScalingPlanCommandOutput) => void), + cb?: (err: any, data?: DeleteScalingPlanCommandOutput) => void + ): Promise | void { + const command = new DeleteScalingPlanCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Describes the scalable resources in the specified scaling plan.

+ * + */ + public describeScalingPlanResources( + args: DescribeScalingPlanResourcesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeScalingPlanResources( + args: DescribeScalingPlanResourcesCommandInput, + cb: (err: any, data?: DescribeScalingPlanResourcesCommandOutput) => void + ): void; + public describeScalingPlanResources( + args: DescribeScalingPlanResourcesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeScalingPlanResourcesCommandOutput) => void + ): void; + public describeScalingPlanResources( + args: DescribeScalingPlanResourcesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeScalingPlanResourcesCommandOutput) => void), + cb?: (err: any, data?: DescribeScalingPlanResourcesCommandOutput) => void + ): Promise | void { + const command = new DescribeScalingPlanResourcesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Describes one or more of your scaling plans.

+ * + */ + public describeScalingPlans( + args: DescribeScalingPlansCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeScalingPlans( + args: DescribeScalingPlansCommandInput, + cb: (err: any, data?: DescribeScalingPlansCommandOutput) => void + ): void; + public describeScalingPlans( + args: DescribeScalingPlansCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeScalingPlansCommandOutput) => void + ): void; + public describeScalingPlans( + args: DescribeScalingPlansCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeScalingPlansCommandOutput) => void), + cb?: (err: any, data?: DescribeScalingPlansCommandOutput) => void + ): Promise | void { + const command = new DescribeScalingPlansCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Retrieves the forecast data for a scalable resource.

+ *

Capacity forecasts are represented as predicted values, or data points, that are + * calculated using historical data points from a specified CloudWatch load metric. Data points are + * available for up to 56 days. + * + *

+ * + */ + public getScalingPlanResourceForecastData( + args: GetScalingPlanResourceForecastDataCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public getScalingPlanResourceForecastData( + args: GetScalingPlanResourceForecastDataCommandInput, + cb: ( + err: any, + data?: GetScalingPlanResourceForecastDataCommandOutput + ) => void + ): void; + public getScalingPlanResourceForecastData( + args: GetScalingPlanResourceForecastDataCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: GetScalingPlanResourceForecastDataCommandOutput + ) => void + ): void; + public getScalingPlanResourceForecastData( + args: GetScalingPlanResourceForecastDataCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: GetScalingPlanResourceForecastDataCommandOutput + ) => void), + cb?: ( + err: any, + data?: GetScalingPlanResourceForecastDataCommandOutput + ) => void + ): Promise | void { + const command = new GetScalingPlanResourceForecastDataCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Updates the specified scaling plan.

+ *

You cannot update a scaling plan if it is in the process of being created, updated, or + * deleted.

+ * + */ + public updateScalingPlan( + args: UpdateScalingPlanCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateScalingPlan( + args: UpdateScalingPlanCommandInput, + cb: (err: any, data?: UpdateScalingPlanCommandOutput) => void + ): void; + public updateScalingPlan( + args: UpdateScalingPlanCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateScalingPlanCommandOutput) => void + ): void; + public updateScalingPlan( + args: UpdateScalingPlanCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateScalingPlanCommandOutput) => void), + cb?: (err: any, data?: UpdateScalingPlanCommandOutput) => void + ): Promise | void { + const command = new UpdateScalingPlanCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts new file mode 100644 index 000000000000..6237f3196bf8 --- /dev/null +++ b/clients/client-auto-scaling-plans/AutoScalingPlansClient.ts @@ -0,0 +1,225 @@ +import { + CreateScalingPlanRequest, + CreateScalingPlanResponse, + DeleteScalingPlanRequest, + DeleteScalingPlanResponse, + DescribeScalingPlanResourcesRequest, + DescribeScalingPlanResourcesResponse, + DescribeScalingPlansRequest, + DescribeScalingPlansResponse, + GetScalingPlanResourceForecastDataRequest, + GetScalingPlanResourceForecastDataResponse, + UpdateScalingPlanRequest, + UpdateScalingPlanResponse +} from "./models/index"; +import { ClientDefaultValues as __ClientDefaultValues } from "./runtimeConfig"; +import { + EndpointsInputConfig, + EndpointsResolvedConfig, + RegionInputConfig, + RegionResolvedConfig, + resolveEndpointsConfig, + resolveRegionConfig +} from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, + getHostHeaderPlugin, + resolveHostHeaderConfig +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, + getRetryPlugin, + resolveRetryConfig +} from "@aws-sdk/middleware-retry"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig +} from "@aws-sdk/middleware-signing"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, + getUserAgentPlugin, + resolveUserAgentConfig +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration +} from "@aws-sdk/smithy-client"; +import { + RegionInfoProvider, + Credentials as __Credentials, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Provider as __Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser +} from "@aws-sdk/types"; + +export type ServiceInputTypes = + | CreateScalingPlanRequest + | DeleteScalingPlanRequest + | DescribeScalingPlanResourcesRequest + | DescribeScalingPlansRequest + | GetScalingPlanResourceForecastDataRequest + | UpdateScalingPlanRequest; + +export type ServiceOutputTypes = + | CreateScalingPlanResponse + | DeleteScalingPlanResponse + | DescribeScalingPlanResourcesResponse + | DescribeScalingPlansResponse + | GetScalingPlanResourceForecastDataResponse + | UpdateScalingPlanResponse; + +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 @aws-sdk/types.Hash interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + */ + sha256?: __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + */ + bodyLengthChecker?: (body: any) => number | undefined; + + /** + * A function that converts a stream into an array of bytes. + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string + */ + utf8Encoder?: __Encoder; + + /** + * The string that will be used to populate default value in 'User-Agent' header + */ + defaultUserAgent?: string; + + /** + * The runtime environment + */ + runtime?: string; + + /** + * The service name with which to sign requests. + */ + signingName?: string; + + /** + * Default credentials provider; Not available in browser runtime + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * Provider function that return promise of a region string + */ + regionDefaultProvider?: (input: any) => __Provider; + + /** + * Fetch related hostname, signing name or signing region with given region. + */ + regionInfoProvider?: RegionInfoProvider; +} + +export type AutoScalingPlansClientConfig = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointsInputConfig & + AwsAuthInputConfig & + RetryInputConfig & + UserAgentInputConfig & + HostHeaderInputConfig; + +export type AutoScalingPlansClientResolvedConfig = __SmithyResolvedConfiguration< + __HttpHandlerOptions +> & + Required & + RegionResolvedConfig & + EndpointsResolvedConfig & + AwsAuthResolvedConfig & + RetryResolvedConfig & + UserAgentResolvedConfig & + HostHeaderResolvedConfig; + +/** + * + * AWS Auto Scaling + *

Use AWS Auto Scaling to quickly discover all the scalable AWS resources for your application and + * configure dynamic scaling and predictive scaling for your resources using scaling plans. + * Use this service in conjunction with the Amazon EC2 Auto Scaling, Application Auto Scaling, Amazon CloudWatch, and AWS + * CloudFormation services.

+ *

Currently, predictive scaling is only available for Amazon EC2 Auto Scaling groups.

+ *

For more information about AWS Auto Scaling, including information about granting IAM users + * required permissions for AWS Auto Scaling actions, see the AWS Auto Scaling User Guide.

+ * + */ +export class AutoScalingPlansClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + AutoScalingPlansClientResolvedConfig +> { + readonly config: AutoScalingPlansClientResolvedConfig; + + constructor(configuration: AutoScalingPlansClientConfig) { + let _config_0 = { + ...__ClientDefaultValues, + ...configuration + }; + let _config_1 = resolveRegionConfig(_config_0); + let _config_2 = resolveEndpointsConfig(_config_1); + let _config_3 = resolveAwsAuthConfig(_config_2); + let _config_4 = resolveRetryConfig(_config_3); + let _config_5 = resolveUserAgentConfig(_config_4); + let _config_6 = resolveHostHeaderConfig(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + } + + destroy(): void {} +} diff --git a/clients/client-auto-scaling-plans/LICENSE b/clients/client-auto-scaling-plans/LICENSE new file mode 100644 index 000000000000..b7d2463d8cc0 --- /dev/null +++ b/clients/client-auto-scaling-plans/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 2020 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-auto-scaling-plans/README.md b/clients/client-auto-scaling-plans/README.md new file mode 100644 index 000000000000..cbafbaded0d9 --- /dev/null +++ b/clients/client-auto-scaling-plans/README.md @@ -0,0 +1,6 @@ +@aws-sdk/client-auto-scaling-plans + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-auto-scaling-plans/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-auto-scaling-plans.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) + +For SDK usage, please step to [SDK reademe](https://github.com/aws/aws-sdk-js-v3). diff --git a/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts b/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts new file mode 100644 index 000000000000..a43bb5f111ad --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/CreateScalingPlanCommand.ts @@ -0,0 +1,84 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + CreateScalingPlanRequest, + CreateScalingPlanResponse +} from "../models/index"; +import { + deserializeAws_json1_1CreateScalingPlanCommand, + serializeAws_json1_1CreateScalingPlanCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type CreateScalingPlanCommandInput = CreateScalingPlanRequest; +export type CreateScalingPlanCommandOutput = CreateScalingPlanResponse; + +export class CreateScalingPlanCommand extends $Command< + CreateScalingPlanCommandInput, + CreateScalingPlanCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateScalingPlanCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: CreateScalingPlanCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1CreateScalingPlanCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1CreateScalingPlanCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts b/clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts new file mode 100644 index 000000000000..4b809f952b48 --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/DeleteScalingPlanCommand.ts @@ -0,0 +1,84 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + DeleteScalingPlanRequest, + DeleteScalingPlanResponse +} from "../models/index"; +import { + deserializeAws_json1_1DeleteScalingPlanCommand, + serializeAws_json1_1DeleteScalingPlanCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DeleteScalingPlanCommandInput = DeleteScalingPlanRequest; +export type DeleteScalingPlanCommandOutput = DeleteScalingPlanResponse; + +export class DeleteScalingPlanCommand extends $Command< + DeleteScalingPlanCommandInput, + DeleteScalingPlanCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteScalingPlanCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DeleteScalingPlanCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DeleteScalingPlanCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DeleteScalingPlanCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts b/clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts new file mode 100644 index 000000000000..1e90d16cb282 --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/DescribeScalingPlanResourcesCommand.ts @@ -0,0 +1,93 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + DescribeScalingPlanResourcesRequest, + DescribeScalingPlanResourcesResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeScalingPlanResourcesCommand, + serializeAws_json1_1DescribeScalingPlanResourcesCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeScalingPlanResourcesCommandInput = DescribeScalingPlanResourcesRequest; +export type DescribeScalingPlanResourcesCommandOutput = DescribeScalingPlanResourcesResponse; + +export class DescribeScalingPlanResourcesCommand extends $Command< + DescribeScalingPlanResourcesCommandInput, + DescribeScalingPlanResourcesCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeScalingPlanResourcesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeScalingPlanResourcesCommandInput, + DescribeScalingPlanResourcesCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeScalingPlanResourcesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeScalingPlanResourcesCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeScalingPlanResourcesCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts b/clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts new file mode 100644 index 000000000000..10c6d3daefe6 --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/DescribeScalingPlansCommand.ts @@ -0,0 +1,87 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + DescribeScalingPlansRequest, + DescribeScalingPlansResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeScalingPlansCommand, + serializeAws_json1_1DescribeScalingPlansCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeScalingPlansCommandInput = DescribeScalingPlansRequest; +export type DescribeScalingPlansCommandOutput = DescribeScalingPlansResponse; + +export class DescribeScalingPlansCommand extends $Command< + DescribeScalingPlansCommandInput, + DescribeScalingPlansCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeScalingPlansCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeScalingPlansCommandInput, + DescribeScalingPlansCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeScalingPlansCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeScalingPlansCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeScalingPlansCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts b/clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts new file mode 100644 index 000000000000..3e96272c9b96 --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/GetScalingPlanResourceForecastDataCommand.ts @@ -0,0 +1,93 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + GetScalingPlanResourceForecastDataRequest, + GetScalingPlanResourceForecastDataResponse +} from "../models/index"; +import { + deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand, + serializeAws_json1_1GetScalingPlanResourceForecastDataCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type GetScalingPlanResourceForecastDataCommandInput = GetScalingPlanResourceForecastDataRequest; +export type GetScalingPlanResourceForecastDataCommandOutput = GetScalingPlanResourceForecastDataResponse; + +export class GetScalingPlanResourceForecastDataCommand extends $Command< + GetScalingPlanResourceForecastDataCommandInput, + GetScalingPlanResourceForecastDataCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: GetScalingPlanResourceForecastDataCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + GetScalingPlanResourceForecastDataCommandInput, + GetScalingPlanResourceForecastDataCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: GetScalingPlanResourceForecastDataCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1GetScalingPlanResourceForecastDataCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts b/clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts new file mode 100644 index 000000000000..b44d309bb5d0 --- /dev/null +++ b/clients/client-auto-scaling-plans/commands/UpdateScalingPlanCommand.ts @@ -0,0 +1,84 @@ +import { + AutoScalingPlansClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../AutoScalingPlansClient"; +import { + UpdateScalingPlanRequest, + UpdateScalingPlanResponse +} from "../models/index"; +import { + deserializeAws_json1_1UpdateScalingPlanCommand, + serializeAws_json1_1UpdateScalingPlanCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type UpdateScalingPlanCommandInput = UpdateScalingPlanRequest; +export type UpdateScalingPlanCommandOutput = UpdateScalingPlanResponse; + +export class UpdateScalingPlanCommand extends $Command< + UpdateScalingPlanCommandInput, + UpdateScalingPlanCommandOutput, + AutoScalingPlansClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateScalingPlanCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: AutoScalingPlansClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: UpdateScalingPlanCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1UpdateScalingPlanCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1UpdateScalingPlanCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-auto-scaling-plans/endpoints.ts b/clients/client-auto-scaling-plans/endpoints.ts new file mode 100644 index 000000000000..49760ceec3e9 --- /dev/null +++ b/clients/client-auto-scaling-plans/endpoints.ts @@ -0,0 +1,143 @@ +import { RegionInfo, RegionInfoProvider } from "@aws-sdk/types"; + +// Partition default templates +const AWS_TEMPLATE = "autoscaling-plans.{region}.amazonaws.com"; +const AWS_CN_TEMPLATE = "autoscaling-plans.{region}.amazonaws.com.cn"; +const AWS_ISO_TEMPLATE = "autoscaling-plans.{region}.c2s.ic.gov"; +const AWS_ISO_B_TEMPLATE = "autoscaling-plans.{region}.sc2s.sgov.gov"; +const AWS_US_GOV_TEMPLATE = "autoscaling-plans.{region}.amazonaws.com"; + +// Partition regions +const AWS_REGIONS = new Set([ + "ap-south-1", + "eu-north-1", + "eu-west-3", + "eu-west-2", + "eu-west-1", + "ap-northeast-2", + "ap-northeast-1", + "me-south-1", + "ca-central-1", + "sa-east-1", + "ap-east-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "us-east-1", + "us-east-2", + "us-west-1", + "us-west-2" +]); +const AWS_CN_REGIONS = new Set(["cn-north-1", "cn-northwest-1"]); +const AWS_ISO_REGIONS = new Set(["us-iso-east-1"]); +const AWS_ISO_B_REGIONS = new Set(["us-isob-east-1"]); +const AWS_US_GOV_REGIONS = new Set(["us-gov-west-1", "us-gov-east-1"]); + +export const defaultRegionInfoProvider: RegionInfoProvider = ( + region: string, + options?: any +) => { + let regionInfo: RegionInfo | undefined = undefined; + switch (region) { + // First, try to match exact region names. + case "ap-northeast-1": + regionInfo = { + hostname: "autoscaling-plans.ap-northeast-1.amazonaws.com" + }; + break; + case "ap-northeast-2": + regionInfo = { + hostname: "autoscaling-plans.ap-northeast-2.amazonaws.com" + }; + break; + case "ap-south-1": + regionInfo = { + hostname: "autoscaling-plans.ap-south-1.amazonaws.com" + }; + break; + case "ap-southeast-1": + regionInfo = { + hostname: "autoscaling-plans.ap-southeast-1.amazonaws.com" + }; + break; + case "ap-southeast-2": + regionInfo = { + hostname: "autoscaling-plans.ap-southeast-2.amazonaws.com" + }; + break; + case "ca-central-1": + regionInfo = { + hostname: "autoscaling-plans.ca-central-1.amazonaws.com" + }; + break; + case "eu-central-1": + regionInfo = { + hostname: "autoscaling-plans.eu-central-1.amazonaws.com" + }; + break; + case "eu-west-1": + regionInfo = { + hostname: "autoscaling-plans.eu-west-1.amazonaws.com" + }; + break; + case "eu-west-2": + regionInfo = { + hostname: "autoscaling-plans.eu-west-2.amazonaws.com" + }; + break; + case "us-east-1": + regionInfo = { + hostname: "autoscaling-plans.us-east-1.amazonaws.com" + }; + break; + case "us-east-2": + regionInfo = { + hostname: "autoscaling-plans.us-east-2.amazonaws.com" + }; + break; + case "us-west-1": + regionInfo = { + hostname: "autoscaling-plans.us-west-1.amazonaws.com" + }; + break; + case "us-west-2": + regionInfo = { + hostname: "autoscaling-plans.us-west-2.amazonaws.com" + }; + break; + // Next, try to match partition endpoints. + default: + if (AWS_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_CN_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_CN_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_B_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_B_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_US_GOV_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_US_GOV_TEMPLATE.replace("{region}", region) + }; + } + // Finally, assume it's an AWS partition endpoint. + if (regionInfo === undefined) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + } + return Promise.resolve(regionInfo); +}; diff --git a/clients/client-auto-scaling-plans/index.ts b/clients/client-auto-scaling-plans/index.ts new file mode 100644 index 000000000000..15d3e3f1e594 --- /dev/null +++ b/clients/client-auto-scaling-plans/index.ts @@ -0,0 +1,8 @@ +export * from "./AutoScalingPlansClient"; +export * from "./AutoScalingPlans"; +export * from "./commands/CreateScalingPlanCommand"; +export * from "./commands/DeleteScalingPlanCommand"; +export * from "./commands/DescribeScalingPlanResourcesCommand"; +export * from "./commands/DescribeScalingPlansCommand"; +export * from "./commands/GetScalingPlanResourceForecastDataCommand"; +export * from "./commands/UpdateScalingPlanCommand"; diff --git a/clients/client-auto-scaling-plans/models/index.ts b/clients/client-auto-scaling-plans/models/index.ts new file mode 100644 index 000000000000..92f6f23c3a91 --- /dev/null +++ b/clients/client-auto-scaling-plans/models/index.ts @@ -0,0 +1,1576 @@ +import * as _smithy from "@aws-sdk/smithy-client"; +import { MetadataBearer as $MetadataBearer } from "@aws-sdk/types"; + +/** + * + *

Represents an application source.

+ * + */ +export interface ApplicationSource { + __type?: "ApplicationSource"; + /** + * + *

The Amazon Resource Name (ARN) of a AWS CloudFormation stack.

+ * + */ + CloudFormationStackARN?: string; + + /** + * + *

A set of tags (up to 50).

+ * + */ + TagFilters?: Array; +} + +export namespace ApplicationSource { + export function isa(o: any): o is ApplicationSource { + return _smithy.isa(o, "ApplicationSource"); + } +} + +/** + * + *

Concurrent updates caused an exception, for example, if you request an update to a + * scaling plan that already has a pending update.

+ * + */ +export interface ConcurrentUpdateException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ConcurrentUpdateException"; + $fault: "server"; + Message?: string; +} + +export namespace ConcurrentUpdateException { + export function isa(o: any): o is ConcurrentUpdateException { + return _smithy.isa(o, "ConcurrentUpdateException"); + } +} + +export interface CreateScalingPlanRequest { + __type?: "CreateScalingPlanRequest"; + /** + * + *

A CloudFormation stack or set of tags. You can create one scaling plan per application + * source.

+ * + */ + ApplicationSource: ApplicationSource | undefined; + + /** + * + *

The scaling instructions.

+ * + */ + ScalingInstructions: Array | undefined; + + /** + * + *

The name of the scaling plan. Names cannot contain vertical bars, colons, or forward + * slashes.

+ * + */ + ScalingPlanName: string | undefined; +} + +export namespace CreateScalingPlanRequest { + export function isa(o: any): o is CreateScalingPlanRequest { + return _smithy.isa(o, "CreateScalingPlanRequest"); + } +} + +export interface CreateScalingPlanResponse extends $MetadataBearer { + __type?: "CreateScalingPlanResponse"; + /** + * + *

The version number of the scaling plan. This value is always 1.

+ *

Currently, you cannot specify multiple scaling plan versions.

+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace CreateScalingPlanResponse { + export function isa(o: any): o is CreateScalingPlanResponse { + return _smithy.isa(o, "CreateScalingPlanResponse"); + } +} + +/** + * + *

Represents a CloudWatch metric of your choosing that can be used for predictive scaling.

+ *

For predictive scaling to work with a customized load metric specification, AWS Auto Scaling + * needs access to the Sum and Average statistics that CloudWatch computes + * from metric data. Statistics are calculations used to aggregate data over specified time + * periods.

+ *

When you choose a load metric, make sure that the required Sum and + * Average statistics for your metric are available in CloudWatch and that they + * provide relevant data for predictive scaling. The Sum statistic must represent + * the total load on the resource, and the Average statistic must represent the + * average load per capacity unit of the resource. For example, there is a metric that counts + * the number of requests processed by your Auto Scaling group. If the Sum statistic + * represents the total request count processed by the group, then the Average + * statistic for the specified metric must represent the average request count processed by + * each instance of the group.

+ *

For information about terminology, available metrics, or how to publish new metrics, see + * Amazon CloudWatch + * Concepts in the Amazon CloudWatch User Guide.

+ * + */ +export interface CustomizedLoadMetricSpecification { + __type?: "CustomizedLoadMetricSpecification"; + /** + * + *

The dimensions of the metric.

+ *

Conditional: If you published your metric with dimensions, you must specify the same + * dimensions in your customized load metric specification.

+ * + */ + Dimensions?: Array; + + /** + * + *

The name of the metric.

+ * + */ + MetricName: string | undefined; + + /** + * + *

The namespace of the metric.

+ * + */ + Namespace: string | undefined; + + /** + * + *

The statistic of the metric. Currently, the value must always be Sum. + *

+ * + */ + Statistic: MetricStatistic | string | undefined; + + /** + * + *

The unit of the metric.

+ * + */ + Unit?: string; +} + +export namespace CustomizedLoadMetricSpecification { + export function isa(o: any): o is CustomizedLoadMetricSpecification { + return _smithy.isa(o, "CustomizedLoadMetricSpecification"); + } +} + +/** + * + *

Represents a CloudWatch metric of your choosing that can be used for dynamic scaling as part + * of a target tracking scaling policy.

+ *

To create your customized scaling metric specification:

+ *
    + *
  • + *

    Add values for each required parameter from CloudWatch. You can use an existing metric, + * or a new metric that you create. To use your own metric, you must first publish the + * metric to CloudWatch. For more information, see Publish Custom + * Metrics in the Amazon CloudWatch User Guide.

    + *
  • + *
  • + *

    Choose a metric that changes proportionally with capacity. The value of the metric + * should increase or decrease in inverse proportion to the number of capacity units. + * That is, the value of the metric should decrease when capacity increases.

    + *
  • + *
+ *

For more information about CloudWatch, see Amazon CloudWatch + * Concepts.

+ * + */ +export interface CustomizedScalingMetricSpecification { + __type?: "CustomizedScalingMetricSpecification"; + /** + * + *

The dimensions of the metric.

+ *

Conditional: If you published your metric with dimensions, you must specify the same + * dimensions in your customized scaling metric specification.

+ * + */ + Dimensions?: Array; + + /** + * + *

The name of the metric.

+ * + */ + MetricName: string | undefined; + + /** + * + *

The namespace of the metric.

+ * + */ + Namespace: string | undefined; + + /** + * + *

The statistic of the metric.

+ * + */ + Statistic: MetricStatistic | string | undefined; + + /** + * + *

The unit of the metric.

+ * + */ + Unit?: string; +} + +export namespace CustomizedScalingMetricSpecification { + export function isa(o: any): o is CustomizedScalingMetricSpecification { + return _smithy.isa(o, "CustomizedScalingMetricSpecification"); + } +} + +/** + * + *

Represents a single value in the forecast data used for predictive scaling.

+ * + */ +export interface Datapoint { + __type?: "Datapoint"; + /** + * + *

The time stamp for the data point in UTC format.

+ * + */ + Timestamp?: Date; + + /** + * + *

The value of the data point.

+ * + */ + Value?: number; +} + +export namespace Datapoint { + export function isa(o: any): o is Datapoint { + return _smithy.isa(o, "Datapoint"); + } +} + +export interface DeleteScalingPlanRequest { + __type?: "DeleteScalingPlanRequest"; + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace DeleteScalingPlanRequest { + export function isa(o: any): o is DeleteScalingPlanRequest { + return _smithy.isa(o, "DeleteScalingPlanRequest"); + } +} + +export interface DeleteScalingPlanResponse extends $MetadataBearer { + __type?: "DeleteScalingPlanResponse"; +} + +export namespace DeleteScalingPlanResponse { + export function isa(o: any): o is DeleteScalingPlanResponse { + return _smithy.isa(o, "DeleteScalingPlanResponse"); + } +} + +export interface DescribeScalingPlanResourcesRequest { + __type?: "DescribeScalingPlanResourcesRequest"; + /** + * + *

The maximum number of scalable resources to return. The value must be between + * 1 and 50. The default value is 50.

+ * + */ + MaxResults?: number; + + /** + * + *

The token for the next set of results.

+ * + */ + NextToken?: string; + + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace DescribeScalingPlanResourcesRequest { + export function isa(o: any): o is DescribeScalingPlanResourcesRequest { + return _smithy.isa(o, "DescribeScalingPlanResourcesRequest"); + } +} + +export interface DescribeScalingPlanResourcesResponse extends $MetadataBearer { + __type?: "DescribeScalingPlanResourcesResponse"; + /** + * + *

The token required to get the next set of results. This value is null if + * there are no more results to return.

+ * + */ + NextToken?: string; + + /** + * + *

Information about the scalable resources.

+ * + */ + ScalingPlanResources?: Array; +} + +export namespace DescribeScalingPlanResourcesResponse { + export function isa(o: any): o is DescribeScalingPlanResourcesResponse { + return _smithy.isa(o, "DescribeScalingPlanResourcesResponse"); + } +} + +export interface DescribeScalingPlansRequest { + __type?: "DescribeScalingPlansRequest"; + /** + * + *

The sources for the applications (up to 10). If you specify scaling plan names, you + * cannot specify application sources.

+ * + */ + ApplicationSources?: Array; + + /** + * + *

The maximum number of scalable resources to return. This value can be between + * 1 and 50. The default value is 50.

+ * + */ + MaxResults?: number; + + /** + * + *

The token for the next set of results.

+ * + */ + NextToken?: string; + + /** + * + *

The names of the scaling plans (up to 10). If you specify application sources, you + * cannot specify scaling plan names.

+ * + */ + ScalingPlanNames?: Array; + + /** + * + *

The version number of the scaling plan. If you specify a scaling plan version, you must + * also specify a scaling plan name.

+ * + */ + ScalingPlanVersion?: number; +} + +export namespace DescribeScalingPlansRequest { + export function isa(o: any): o is DescribeScalingPlansRequest { + return _smithy.isa(o, "DescribeScalingPlansRequest"); + } +} + +export interface DescribeScalingPlansResponse extends $MetadataBearer { + __type?: "DescribeScalingPlansResponse"; + /** + * + *

The token required to get the next set of results. This value is null if + * there are no more results to return.

+ * + */ + NextToken?: string; + + /** + * + *

Information about the scaling plans.

+ * + */ + ScalingPlans?: Array; +} + +export namespace DescribeScalingPlansResponse { + export function isa(o: any): o is DescribeScalingPlansResponse { + return _smithy.isa(o, "DescribeScalingPlansResponse"); + } +} + +export enum ForecastDataType { + CapacityForecast = "CapacityForecast", + LoadForecast = "LoadForecast", + ScheduledActionMaxCapacity = "ScheduledActionMaxCapacity", + ScheduledActionMinCapacity = "ScheduledActionMinCapacity" +} + +export interface GetScalingPlanResourceForecastDataRequest { + __type?: "GetScalingPlanResourceForecastDataRequest"; + /** + * + *

The exclusive end time of the time range for the forecast data to get. The maximum time + * duration between the start and end time is seven days.

+ *

Although this parameter can accept a date and time that is more than two days in the + * future, the availability of forecast data has limits. AWS Auto Scaling only issues forecasts for + * periods of two days in advance.

+ * + */ + EndTime: Date | undefined; + + /** + * + *

The type of forecast data to get.

+ *
    + *
  • + *

    + * LoadForecast: The load metric forecast.

    + *
  • + *
  • + *

    + * CapacityForecast: The capacity forecast.

    + *
  • + *
  • + *

    + * ScheduledActionMinCapacity: The minimum capacity for each scheduled + * scaling action. This data is calculated as the larger of two values: the capacity + * forecast or the minimum capacity in the scaling instruction.

    + *
  • + *
  • + *

    + * ScheduledActionMaxCapacity: The maximum capacity for each scheduled + * scaling action. The calculation used is determined by the predictive scaling maximum + * capacity behavior setting in the scaling instruction.

    + *
  • + *
+ * + */ + ForecastDataType: ForecastDataType | string | undefined; + + /** + * + *

The ID of the resource. This string consists of the resource type and unique identifier. + *

+ *
    + *
  • + *

    Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the + * name of the Auto Scaling group. Example: autoScalingGroup/my-asg.

    + *
  • + *
  • + *

    ECS service - The resource type is service and the unique identifier is the cluster name + * and service name. Example: service/default/sample-webapp.

    + *
  • + *
  • + *

    Spot Fleet request - The resource type is spot-fleet-request and the unique identifier is the + * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.

    + *
  • + *
  • + *

    DynamoDB table - The resource type is table and the unique identifier is the resource ID. + * Example: table/my-table.

    + *
  • + *
  • + *

    DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. + * Example: table/my-table/index/my-table-index.

    + *
  • + *
  • + *

    Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. + * Example: cluster:my-db-cluster.

    + *
  • + *
+ * + */ + ResourceId: string | undefined; + + /** + * + *

The scalable dimension for the resource.

+ * + */ + ScalableDimension: ScalableDimension | string | undefined; + + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *

The namespace of the AWS service.

+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; + + /** + * + *

The inclusive start time of the time range for the forecast data to get. The date and + * time can be at most 56 days before the current date and time.

+ * + */ + StartTime: Date | undefined; +} + +export namespace GetScalingPlanResourceForecastDataRequest { + export function isa(o: any): o is GetScalingPlanResourceForecastDataRequest { + return _smithy.isa(o, "GetScalingPlanResourceForecastDataRequest"); + } +} + +export interface GetScalingPlanResourceForecastDataResponse + extends $MetadataBearer { + __type?: "GetScalingPlanResourceForecastDataResponse"; + /** + * + *

The data points to return.

+ * + */ + Datapoints: Array | undefined; +} + +export namespace GetScalingPlanResourceForecastDataResponse { + export function isa(o: any): o is GetScalingPlanResourceForecastDataResponse { + return _smithy.isa(o, "GetScalingPlanResourceForecastDataResponse"); + } +} + +/** + * + *

The service encountered an internal error.

+ * + */ +export interface InternalServiceException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InternalServiceException"; + $fault: "server"; + Message?: string; +} + +export namespace InternalServiceException { + export function isa(o: any): o is InternalServiceException { + return _smithy.isa(o, "InternalServiceException"); + } +} + +/** + * + *

The token provided is not valid.

+ * + */ +export interface InvalidNextTokenException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InvalidNextTokenException"; + $fault: "client"; + Message?: string; +} + +export namespace InvalidNextTokenException { + export function isa(o: any): o is InvalidNextTokenException { + return _smithy.isa(o, "InvalidNextTokenException"); + } +} + +/** + * + *

Your account exceeded a limit. This exception is thrown when a per-account resource + * limit is exceeded.

+ * + */ +export interface LimitExceededException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "LimitExceededException"; + $fault: "client"; + Message?: string; +} + +export namespace LimitExceededException { + export function isa(o: any): o is LimitExceededException { + return _smithy.isa(o, "LimitExceededException"); + } +} + +export enum LoadMetricType { + ALBTargetGroupRequestCount = "ALBTargetGroupRequestCount", + ASGTotalCPUUtilization = "ASGTotalCPUUtilization", + ASGTotalNetworkIn = "ASGTotalNetworkIn", + ASGTotalNetworkOut = "ASGTotalNetworkOut" +} + +/** + * + *

Represents a dimension for a customized metric.

+ * + */ +export interface MetricDimension { + __type?: "MetricDimension"; + /** + * + *

The name of the dimension.

+ * + */ + Name: string | undefined; + + /** + * + *

The value of the dimension.

+ * + */ + Value: string | undefined; +} + +export namespace MetricDimension { + export function isa(o: any): o is MetricDimension { + return _smithy.isa(o, "MetricDimension"); + } +} + +export enum MetricStatistic { + Average = "Average", + Maximum = "Maximum", + Minimum = "Minimum", + SampleCount = "SampleCount", + Sum = "Sum" +} + +/** + * + *

The specified object could not be found.

+ * + */ +export interface ObjectNotFoundException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ObjectNotFoundException"; + $fault: "client"; + Message?: string; +} + +export namespace ObjectNotFoundException { + export function isa(o: any): o is ObjectNotFoundException { + return _smithy.isa(o, "ObjectNotFoundException"); + } +} + +export enum PolicyType { + TargetTrackingScaling = "TargetTrackingScaling" +} + +/** + * + *

Represents a predefined metric that can be used for predictive scaling.

+ * + */ +export interface PredefinedLoadMetricSpecification { + __type?: "PredefinedLoadMetricSpecification"; + /** + * + *

The metric type.

+ * + */ + PredefinedLoadMetricType: LoadMetricType | string | undefined; + + /** + * + *

Identifies the resource associated with the metric type. You can't specify a resource + * label unless the metric type is ALBRequestCountPerTarget and there is a target + * group for an Application Load Balancer attached to the Auto Scaling group.

+ *

The format is + * app///targetgroup//, + * where:

+ *
    + *
  • + *

    app// is the final portion of + * the load balancer ARN.

    + *
  • + *
  • + *

    targetgroup// is the final portion + * of the target group ARN.

    + *
  • + *
+ * + */ + ResourceLabel?: string; +} + +export namespace PredefinedLoadMetricSpecification { + export function isa(o: any): o is PredefinedLoadMetricSpecification { + return _smithy.isa(o, "PredefinedLoadMetricSpecification"); + } +} + +/** + * + *

Represents a predefined metric that can be used for dynamic scaling as part of a target + * tracking scaling policy.

+ * + */ +export interface PredefinedScalingMetricSpecification { + __type?: "PredefinedScalingMetricSpecification"; + /** + * + *

The metric type. The ALBRequestCountPerTarget metric type applies only to + * Auto Scaling groups, Spot Fleet requests, and ECS services.

+ * + */ + PredefinedScalingMetricType: ScalingMetricType | string | undefined; + + /** + * + *

Identifies the resource associated with the metric type. You can't specify a resource + * label unless the metric type is ALBRequestCountPerTarget and there is a target + * group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or + * ECS service.

+ *

The format is + * app///targetgroup//, + * where:

+ *
    + *
  • + *

    app// is the final portion of + * the load balancer ARN.

    + *
  • + *
  • + *

    targetgroup// is the final portion + * of the target group ARN.

    + *
  • + *
+ * + */ + ResourceLabel?: string; +} + +export namespace PredefinedScalingMetricSpecification { + export function isa(o: any): o is PredefinedScalingMetricSpecification { + return _smithy.isa(o, "PredefinedScalingMetricSpecification"); + } +} + +export enum PredictiveScalingMaxCapacityBehavior { + SetForecastCapacityToMaxCapacity = "SetForecastCapacityToMaxCapacity", + SetMaxCapacityAboveForecastCapacity = "SetMaxCapacityAboveForecastCapacity", + SetMaxCapacityToForecastCapacity = "SetMaxCapacityToForecastCapacity" +} + +export enum PredictiveScalingMode { + ForecastAndScale = "ForecastAndScale", + ForecastOnly = "ForecastOnly" +} + +export enum ScalableDimension { + AutoScalingGroupDesiredCapacity = "autoscaling:autoScalingGroup:DesiredCapacity", + DynamoDBIndexReadCapacityUnits = "dynamodb:index:ReadCapacityUnits", + DynamoDBIndexWriteCapacityUnits = "dynamodb:index:WriteCapacityUnits", + DynamoDBTableReadCapacityUnits = "dynamodb:table:ReadCapacityUnits", + DynamoDBTableWriteCapacityUnits = "dynamodb:table:WriteCapacityUnits", + EC2SpotFleetRequestTargetCapacity = "ec2:spot-fleet-request:TargetCapacity", + ECSServiceDesiredCount = "ecs:service:DesiredCount", + RDSClusterReadReplicaCount = "rds:cluster:ReadReplicaCount" +} + +/** + * + *

Describes a scaling instruction for a scalable resource.

+ *

The scaling instruction is used in combination with a scaling plan, which is a set of + * instructions for configuring dynamic scaling and predictive scaling for the scalable + * resources in your application. Each scaling instruction applies to one resource.

+ *

AWS Auto Scaling creates target tracking scaling policies based on the scaling instructions. + * Target tracking scaling policies adjust the capacity of your scalable resource as required + * to maintain resource utilization at the target value that you specified.

+ *

AWS Auto Scaling also configures predictive scaling for your Amazon EC2 Auto Scaling groups using a subset of + * parameters, including the load metric, the scaling metric, the target value for the scaling + * metric, the predictive scaling mode (forecast and scale or forecast only), and the desired + * behavior when the forecast capacity exceeds the maximum capacity of the resource. With + * predictive scaling, AWS Auto Scaling generates forecasts with traffic predictions for the two days + * ahead and schedules scaling actions that proactively add and remove resource capacity to + * match the forecast.

+ *

We recommend waiting a minimum of 24 hours after creating an Auto Scaling group to configure + * predictive scaling. At minimum, there must be 24 hours of historical data to generate a + * forecast.

+ *

For more information, see Getting Started with + * AWS Auto Scaling.

+ * + */ +export interface ScalingInstruction { + __type?: "ScalingInstruction"; + /** + * + *

The customized load metric to use for predictive scaling. This parameter or a PredefinedLoadMetricSpecification is required when configuring + * predictive scaling, and cannot be used otherwise.

+ * + */ + CustomizedLoadMetricSpecification?: CustomizedLoadMetricSpecification; + + /** + * + *

Controls whether dynamic scaling by AWS Auto Scaling is disabled. When dynamic scaling is + * enabled, AWS Auto Scaling creates target tracking scaling policies based on the specified target + * tracking configurations.

+ *

The default is enabled (false).

+ * + */ + DisableDynamicScaling?: boolean; + + /** + * + *

The maximum capacity of the resource. The exception to this upper limit is if you + * specify a non-default setting for PredictiveScalingMaxCapacityBehavior.

+ * + */ + MaxCapacity: number | undefined; + + /** + * + *

The minimum capacity of the resource.

+ * + */ + MinCapacity: number | undefined; + + /** + * + *

The predefined load metric to use for predictive scaling. This parameter or a CustomizedLoadMetricSpecification is required when configuring + * predictive scaling, and cannot be used otherwise.

+ * + */ + PredefinedLoadMetricSpecification?: PredefinedLoadMetricSpecification; + + /** + * + *

Defines the behavior that should be applied if the forecast capacity approaches or + * exceeds the maximum capacity specified for the resource. The default value is + * SetForecastCapacityToMaxCapacity.

+ *

The following are possible values:

+ *
    + *
  • + *

    + * SetForecastCapacityToMaxCapacity - AWS Auto Scaling cannot scale resource + * capacity higher than the maximum capacity. The maximum capacity is enforced as a hard + * limit.

    + *
  • + *
  • + *

    + * SetMaxCapacityToForecastCapacity - AWS Auto Scaling may scale resource + * capacity higher than the maximum capacity to equal but not exceed forecast + * capacity.

    + *
  • + *
  • + *

    + * SetMaxCapacityAboveForecastCapacity - AWS Auto Scaling may scale resource + * capacity higher than the maximum capacity by a specified buffer value. The intention + * is to give the target tracking scaling policy extra capacity if unexpected traffic + * occurs.

    + *
  • + *
+ *

Only valid when configuring predictive scaling.

+ * + */ + PredictiveScalingMaxCapacityBehavior?: + | PredictiveScalingMaxCapacityBehavior + | string; + + /** + * + *

The size of the capacity buffer to use when the forecast capacity is close to or exceeds + * the maximum capacity. The value is specified as a percentage relative to the forecast + * capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if + * the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum + * capacity is 55.

+ *

Only valid when configuring predictive scaling. Required if the PredictiveScalingMaxCapacityBehavior is set to + * SetMaxCapacityAboveForecastCapacity, and cannot be used otherwise.

+ *

The range is 1-100.

+ * + */ + PredictiveScalingMaxCapacityBuffer?: number; + + /** + * + *

The predictive scaling mode. The default value is ForecastAndScale. + * Otherwise, AWS Auto Scaling forecasts capacity but does not create any scheduled scaling actions + * based on the capacity forecast.

+ * + */ + PredictiveScalingMode?: PredictiveScalingMode | string; + + /** + * + *

The ID of the resource. This string consists of the resource type and unique + * identifier.

+ *
    + *
  • + *

    Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the + * name of the Auto Scaling group. Example: autoScalingGroup/my-asg.

    + *
  • + *
  • + *

    ECS service - The resource type is service and the unique identifier is the cluster name + * and service name. Example: service/default/sample-webapp.

    + *
  • + *
  • + *

    Spot Fleet request - The resource type is spot-fleet-request and the unique identifier is the + * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.

    + *
  • + *
  • + *

    DynamoDB table - The resource type is table and the unique identifier is the resource ID. + * Example: table/my-table.

    + *
  • + *
  • + *

    DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. + * Example: table/my-table/index/my-table-index.

    + *
  • + *
  • + *

    Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. + * Example: cluster:my-db-cluster.

    + *
  • + *
+ * + */ + ResourceId: string | undefined; + + /** + * + *

The scalable dimension associated with the resource.

+ *
    + *
  • + *

    + * autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity of an Auto Scaling group.

    + *
  • + *
  • + *

    + * ecs:service:DesiredCount - The desired task count of an ECS service.

    + *
  • + *
  • + *

    + * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot Fleet request.

    + *
  • + *
  • + *

    + * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table.

    + *
  • + *
  • + *

    + * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table.

    + *
  • + *
  • + *

    + * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index.

    + *
  • + *
  • + *

    + * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index.

    + *
  • + *
  • + *

    + * rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.

    + *
  • + *
+ * + */ + ScalableDimension: ScalableDimension | string | undefined; + + /** + * + *

Controls whether a resource's externally created scaling policies are kept or replaced.

+ *

The default value is KeepExternalPolicies. If the parameter is set to + * ReplaceExternalPolicies, any scaling policies that are external to AWS Auto Scaling + * are deleted and new target tracking scaling policies created.

+ *

Only valid when configuring dynamic scaling.

+ *

Condition: The number of existing policies to be replaced must be less than or equal to + * 50. If there are more than 50 policies to be replaced, AWS Auto Scaling keeps all existing policies + * and does not create new ones.

+ * + */ + ScalingPolicyUpdateBehavior?: ScalingPolicyUpdateBehavior | string; + + /** + * + *

The amount of time, in seconds, to buffer the run time of scheduled scaling actions when + * scaling out. For example, if the forecast says to add capacity at 10:00 AM, and the buffer + * time is 5 minutes, then the run time of the corresponding scheduled scaling action will be + * 9:55 AM. The intention is to give resources time to be provisioned. For example, it can + * take a few minutes to launch an EC2 instance. The actual amount of time required depends on + * several factors, such as the size of the instance and whether there are startup scripts to + * complete.

+ *

The value must be less than the forecast interval duration of 3600 seconds (60 minutes). + * The default is 300 seconds.

+ *

Only valid when configuring predictive scaling.

+ * + */ + ScheduledActionBufferTime?: number; + + /** + * + *

The namespace of the AWS service.

+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; + + /** + * + *

The structure that defines new target tracking configurations (up to 10). Each of these + * structures includes a specific scaling metric and a target value for the metric, along with + * various parameters to use with dynamic scaling.

+ *

With predictive scaling and dynamic scaling, the resource scales based on the target + * tracking configuration that provides the largest capacity for both scale in and scale out.

+ *

Condition: The scaling metric must be unique across target tracking + * configurations.

+ * + */ + TargetTrackingConfigurations: Array | undefined; +} + +export namespace ScalingInstruction { + export function isa(o: any): o is ScalingInstruction { + return _smithy.isa(o, "ScalingInstruction"); + } +} + +export enum ScalingMetricType { + ALBRequestCountPerTarget = "ALBRequestCountPerTarget", + ASGAverageCPUUtilization = "ASGAverageCPUUtilization", + ASGAverageNetworkIn = "ASGAverageNetworkIn", + ASGAverageNetworkOut = "ASGAverageNetworkOut", + DynamoDBReadCapacityUtilization = "DynamoDBReadCapacityUtilization", + DynamoDBWriteCapacityUtilization = "DynamoDBWriteCapacityUtilization", + EC2SpotFleetRequestAverageCPUUtilization = "EC2SpotFleetRequestAverageCPUUtilization", + EC2SpotFleetRequestAverageNetworkIn = "EC2SpotFleetRequestAverageNetworkIn", + EC2SpotFleetRequestAverageNetworkOut = "EC2SpotFleetRequestAverageNetworkOut", + ECSServiceAverageCPUUtilization = "ECSServiceAverageCPUUtilization", + ECSServiceAverageMemoryUtilization = "ECSServiceAverageMemoryUtilization", + RDSReaderAverageCPUUtilization = "RDSReaderAverageCPUUtilization", + RDSReaderAverageDatabaseConnections = "RDSReaderAverageDatabaseConnections" +} + +/** + * + *

Represents a scaling plan.

+ * + */ +export interface ScalingPlan { + __type?: "ScalingPlan"; + /** + * + *

The application source.

+ * + */ + ApplicationSource: ApplicationSource | undefined; + + /** + * + *

The Unix time stamp when the scaling plan was created.

+ * + */ + CreationTime?: Date; + + /** + * + *

The scaling instructions.

+ * + */ + ScalingInstructions: Array | undefined; + + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *

The status of the scaling plan.

+ *
    + *
  • + *

    + * Active - The scaling plan is active.

    + *
  • + *
  • + *

    + * ActiveWithProblems - The scaling plan is active, but the scaling + * configuration for one or more resources could not be applied.

    + *
  • + *
  • + *

    + * CreationInProgress - The scaling plan is being created.

    + *
  • + *
  • + *

    + * CreationFailed - The scaling plan could not be created.

    + *
  • + *
  • + *

    + * DeletionInProgress - The scaling plan is being deleted.

    + *
  • + *
  • + *

    + * DeletionFailed - The scaling plan could not be deleted.

    + *
  • + *
  • + *

    + * UpdateInProgress - The scaling plan is being updated.

    + *
  • + *
  • + *

    + * UpdateFailed - The scaling plan could not be updated.

    + *
  • + *
+ * + */ + StatusCode: ScalingPlanStatusCode | string | undefined; + + /** + * + *

A simple message about the current status of the scaling plan.

+ * + */ + StatusMessage?: string; + + /** + * + *

The Unix time stamp when the scaling plan entered the current status.

+ * + */ + StatusStartTime?: Date; +} + +export namespace ScalingPlan { + export function isa(o: any): o is ScalingPlan { + return _smithy.isa(o, "ScalingPlan"); + } +} + +/** + * + *

Represents a scalable resource.

+ * + */ +export interface ScalingPlanResource { + __type?: "ScalingPlanResource"; + /** + * + *

The ID of the resource. This string consists of the resource type and unique + * identifier.

+ *
    + *
  • + *

    Auto Scaling group - The resource type is autoScalingGroup and the unique identifier is the + * name of the Auto Scaling group. Example: autoScalingGroup/my-asg.

    + *
  • + *
  • + *

    ECS service - The resource type is service and the unique identifier is the cluster name + * and service name. Example: service/default/sample-webapp.

    + *
  • + *
  • + *

    Spot Fleet request - The resource type is spot-fleet-request and the unique identifier is the + * Spot Fleet request ID. Example: spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE.

    + *
  • + *
  • + *

    DynamoDB table - The resource type is table and the unique identifier is the resource ID. + * Example: table/my-table.

    + *
  • + *
  • + *

    DynamoDB global secondary index - The resource type is index and the unique identifier is the resource ID. + * Example: table/my-table/index/my-table-index.

    + *
  • + *
  • + *

    Aurora DB cluster - The resource type is cluster and the unique identifier is the cluster name. + * Example: cluster:my-db-cluster.

    + *
  • + *
+ * + */ + ResourceId: string | undefined; + + /** + * + *

The scalable dimension for the resource.

+ *
    + *
  • + *

    + * autoscaling:autoScalingGroup:DesiredCapacity - The desired capacity of an Auto Scaling group.

    + *
  • + *
  • + *

    + * ecs:service:DesiredCount - The desired task count of an ECS service.

    + *
  • + *
  • + *

    + * ec2:spot-fleet-request:TargetCapacity - The target capacity of a Spot Fleet request.

    + *
  • + *
  • + *

    + * dynamodb:table:ReadCapacityUnits - The provisioned read capacity for a DynamoDB table.

    + *
  • + *
  • + *

    + * dynamodb:table:WriteCapacityUnits - The provisioned write capacity for a DynamoDB table.

    + *
  • + *
  • + *

    + * dynamodb:index:ReadCapacityUnits - The provisioned read capacity for a DynamoDB global secondary index.

    + *
  • + *
  • + *

    + * dynamodb:index:WriteCapacityUnits - The provisioned write capacity for a DynamoDB global secondary index.

    + *
  • + *
  • + *

    + * rds:cluster:ReadReplicaCount - The count of Aurora Replicas in an Aurora DB cluster. Available for Aurora MySQL-compatible edition and Aurora PostgreSQL-compatible edition.

    + *
  • + *
+ * + */ + ScalableDimension: ScalableDimension | string | undefined; + + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; + + /** + * + *

The scaling policies.

+ * + */ + ScalingPolicies?: Array; + + /** + * + *

The scaling status of the resource.

+ *
    + *
  • + *

    + * Active - The scaling configuration is active.

    + *
  • + *
  • + *

    + * Inactive - The scaling configuration is not active because the + * scaling plan is being created or the scaling configuration could not be applied. + * Check the status message for more information.

    + *
  • + *
  • + *

    + * PartiallyActive - The scaling configuration is partially active + * because the scaling plan is being created or deleted or the scaling configuration + * could not be fully applied. Check the status message for more information.

    + *
  • + *
+ * + */ + ScalingStatusCode: ScalingStatusCode | string | undefined; + + /** + * + *

A simple message about the current scaling status of the resource.

+ * + */ + ScalingStatusMessage?: string; + + /** + * + *

The namespace of the AWS service.

+ * + */ + ServiceNamespace: ServiceNamespace | string | undefined; +} + +export namespace ScalingPlanResource { + export function isa(o: any): o is ScalingPlanResource { + return _smithy.isa(o, "ScalingPlanResource"); + } +} + +export enum ScalingPlanStatusCode { + Active = "Active", + ActiveWithProblems = "ActiveWithProblems", + CreationFailed = "CreationFailed", + CreationInProgress = "CreationInProgress", + DeletionFailed = "DeletionFailed", + DeletionInProgress = "DeletionInProgress", + UpdateFailed = "UpdateFailed", + UpdateInProgress = "UpdateInProgress" +} + +/** + * + *

Represents a scaling policy.

+ * + */ +export interface ScalingPolicy { + __type?: "ScalingPolicy"; + /** + * + *

The name of the scaling policy.

+ * + */ + PolicyName: string | undefined; + + /** + * + *

The type of scaling policy.

+ * + */ + PolicyType: PolicyType | string | undefined; + + /** + * + *

The target tracking scaling policy. Includes support for predefined or customized + * metrics.

+ * + */ + TargetTrackingConfiguration?: TargetTrackingConfiguration; +} + +export namespace ScalingPolicy { + export function isa(o: any): o is ScalingPolicy { + return _smithy.isa(o, "ScalingPolicy"); + } +} + +export enum ScalingPolicyUpdateBehavior { + KeepExternalPolicies = "KeepExternalPolicies", + ReplaceExternalPolicies = "ReplaceExternalPolicies" +} + +export enum ScalingStatusCode { + Active = "Active", + Inactive = "Inactive", + PartiallyActive = "PartiallyActive" +} + +export enum ServiceNamespace { + AUTOSCALING = "autoscaling", + DYNAMODB = "dynamodb", + EC2 = "ec2", + ECS = "ecs", + RDS = "rds" +} + +/** + * + *

Represents a tag.

+ * + */ +export interface TagFilter { + __type?: "TagFilter"; + /** + * + *

The tag key.

+ * + */ + Key?: string; + + /** + * + *

The tag values (0 to 20).

+ * + */ + Values?: Array; +} + +export namespace TagFilter { + export function isa(o: any): o is TagFilter { + return _smithy.isa(o, "TagFilter"); + } +} + +/** + * + *

Describes a target tracking configuration to use with AWS Auto Scaling. Used with ScalingInstruction and ScalingPolicy.

+ * + */ +export interface TargetTrackingConfiguration { + __type?: "TargetTrackingConfiguration"; + /** + * + *

A customized metric. You can specify either a predefined metric or a customized metric. + *

+ * + */ + CustomizedScalingMetricSpecification?: CustomizedScalingMetricSpecification; + + /** + * + *

Indicates whether scale in by the target tracking scaling policy is disabled. If the + * value is true, scale in is disabled and the target tracking scaling policy + * doesn't remove capacity from the scalable resource. Otherwise, scale in is enabled and the + * target tracking scaling policy can remove capacity from the scalable resource.

+ *

The default value is false.

+ * + */ + DisableScaleIn?: boolean; + + /** + * + *

The estimated time, in seconds, until a newly launched instance can contribute to the + * CloudWatch metrics. This value is used only if the resource is an Auto Scaling group.

+ * + */ + EstimatedInstanceWarmup?: number; + + /** + * + *

A predefined metric. You can specify either a predefined metric or a customized + * metric.

+ * + */ + PredefinedScalingMetricSpecification?: PredefinedScalingMetricSpecification; + + /** + * + *

The amount of time, in seconds, after a scale in activity completes before another scale + * in activity can start. This value is not used if the scalable resource is an Auto Scaling + * group.

+ *

The cooldown period is used to block subsequent scale in requests until it has expired. + * The intention is to scale in conservatively to protect your application's availability. + * However, if another alarm triggers a scale-out policy during the cooldown period after a + * scale-in, AWS Auto Scaling scales out your scalable target immediately.

+ * + */ + ScaleInCooldown?: number; + + /** + * + *

The amount of time, in seconds, after a scale-out activity completes before another + * scale-out activity can start. This value is not used if the scalable resource is an Auto + * Scaling group.

+ *

While the cooldown period is in effect, the capacity that has been added by the previous + * scale-out event that initiated the cooldown is calculated as part of the desired capacity + * for the next scale out. The intention is to continuously (but not excessively) scale + * out.

+ * + */ + ScaleOutCooldown?: number; + + /** + * + *

The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) + * or 2e-360 to 2e360 (Base 2).

+ * + */ + TargetValue: number | undefined; +} + +export namespace TargetTrackingConfiguration { + export function isa(o: any): o is TargetTrackingConfiguration { + return _smithy.isa(o, "TargetTrackingConfiguration"); + } +} + +export interface UpdateScalingPlanRequest { + __type?: "UpdateScalingPlanRequest"; + /** + * + *

A CloudFormation stack or set of tags.

+ * + */ + ApplicationSource?: ApplicationSource; + + /** + * + *

The scaling instructions.

+ * + */ + ScalingInstructions?: Array; + + /** + * + *

The name of the scaling plan.

+ * + */ + ScalingPlanName: string | undefined; + + /** + * + *

The version number of the scaling plan.

+ * + */ + ScalingPlanVersion: number | undefined; +} + +export namespace UpdateScalingPlanRequest { + export function isa(o: any): o is UpdateScalingPlanRequest { + return _smithy.isa(o, "UpdateScalingPlanRequest"); + } +} + +export interface UpdateScalingPlanResponse extends $MetadataBearer { + __type?: "UpdateScalingPlanResponse"; +} + +export namespace UpdateScalingPlanResponse { + export function isa(o: any): o is UpdateScalingPlanResponse { + return _smithy.isa(o, "UpdateScalingPlanResponse"); + } +} + +/** + * + *

An exception was thrown for a validation issue. Review the parameters provided.

+ * + */ +export interface ValidationException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ValidationException"; + $fault: "client"; + Message?: string; +} + +export namespace ValidationException { + export function isa(o: any): o is ValidationException { + return _smithy.isa(o, "ValidationException"); + } +} diff --git a/clients/client-auto-scaling-plans/package.json b/clients/client-auto-scaling-plans/package.json new file mode 100644 index 000000000000..fb02043882b0 --- /dev/null +++ b/clients/client-auto-scaling-plans/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aws-sdk/client-auto-scaling-plans", + "description": "@aws-sdk/client-auto-scaling-plans client", + "version": "1.0.0", + "scripts": { + "clean": "npm run remove-definitions && npm run remove-dist && npm run remove-js && npm run remove-maps", + "build-documentation": "npm run clean && typedoc ./", + "prepublishOnly": "yarn build", + "pretest": "tsc", + "remove-definitions": "rimraf ./types", + "remove-dist": "rimraf ./dist", + "remove-documentation": "rimraf ./docs", + "remove-js": "rimraf *.js && rimraf ./commands/*.js && rimraf ./models/*.js && rimraf ./protocols/*.js", + "remove-maps": "rimraf *.js.map && rimraf ./commands/*.js.map && rimraf ./models/*.js.map && rimraf ./protocols/*.js.map", + "test": "exit 0", + "smoke-test": "npm run pretest && node ./test/smoke/index.spec.js", + "build:es": "tsc -p tsconfig.es.json", + "build": "yarn pretest && yarn build:es" + }, + "main": "./dist/cjs/index.js", + "types": "./types/index.d.ts", + "module": "./dist/es/index.js", + "browser": { + "./runtimeConfig": "./runtimeConfig.browser" + }, + "sideEffects": false, + "dependencies": { + "tslib": "^1.8.0", + "@aws-crypto/sha256-browser": "^0.1.0-preview.1", + "@aws-sdk/config-resolver": "^0.1.0-preview.5", + "@aws-sdk/credential-provider-node": "^0.1.0-preview.7", + "@aws-sdk/fetch-http-handler": "^0.1.0-preview.5", + "@aws-sdk/hash-node": "^0.1.0-preview.5", + "@aws-sdk/invalid-dependency": "^0.1.0-preview.1", + "@aws-sdk/middleware-content-length": "^0.1.0-preview.5", + "@aws-sdk/middleware-host-header": "^0.1.0-preview.1", + "@aws-sdk/middleware-retry": "^0.1.0-preview.5", + "@aws-sdk/middleware-serde": "^0.1.0-preview.1", + "@aws-sdk/middleware-signing": "^0.1.0-preview.7", + "@aws-sdk/middleware-stack": "^0.1.0-preview.6", + "@aws-sdk/middleware-user-agent": "^0.1.0-preview.1", + "@aws-sdk/node-http-handler": "^0.1.0-preview.6", + "@aws-sdk/protocol-http": "^0.1.0-preview.1", + "@aws-sdk/region-provider": "^0.1.0-preview.5", + "@aws-sdk/smithy-client": "^0.1.0-preview.1", + "@aws-sdk/stream-collector-browser": "^0.1.0-preview.5", + "@aws-sdk/stream-collector-node": "^0.1.0-preview.6", + "@aws-sdk/types": "^0.1.0-preview.5", + "@aws-sdk/url-parser-browser": "^0.1.0-preview.5", + "@aws-sdk/url-parser-node": "^0.1.0-preview.5", + "@aws-sdk/util-base64-browser": "^0.1.0-preview.3", + "@aws-sdk/util-base64-node": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-browser": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-node": "^0.1.0-preview.4", + "@aws-sdk/util-user-agent-browser": "^0.1.0-preview.6", + "@aws-sdk/util-user-agent-node": "^0.1.0-preview.6", + "@aws-sdk/util-utf8-browser": "^0.1.0-preview.3", + "@aws-sdk/util-utf8-node": "^0.1.0-preview.3" + }, + "devDependencies": { + "rimraf": "^3.0.0", + "typedoc": "^0.15.0", + "typescript": "^3.6.3", + "@types/node": "^12.7.5", + "tslib": "^1.8.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" +} diff --git a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts new file mode 100644 index 000000000000..dff920182be3 --- /dev/null +++ b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts @@ -0,0 +1,1907 @@ +import { + CreateScalingPlanCommandInput, + CreateScalingPlanCommandOutput +} from "../commands/CreateScalingPlanCommand"; +import { + DeleteScalingPlanCommandInput, + DeleteScalingPlanCommandOutput +} from "../commands/DeleteScalingPlanCommand"; +import { + DescribeScalingPlanResourcesCommandInput, + DescribeScalingPlanResourcesCommandOutput +} from "../commands/DescribeScalingPlanResourcesCommand"; +import { + DescribeScalingPlansCommandInput, + DescribeScalingPlansCommandOutput +} from "../commands/DescribeScalingPlansCommand"; +import { + GetScalingPlanResourceForecastDataCommandInput, + GetScalingPlanResourceForecastDataCommandOutput +} from "../commands/GetScalingPlanResourceForecastDataCommand"; +import { + UpdateScalingPlanCommandInput, + UpdateScalingPlanCommandOutput +} from "../commands/UpdateScalingPlanCommand"; +import { + ApplicationSource, + ConcurrentUpdateException, + CreateScalingPlanRequest, + CreateScalingPlanResponse, + CustomizedLoadMetricSpecification, + CustomizedScalingMetricSpecification, + Datapoint, + DeleteScalingPlanRequest, + DeleteScalingPlanResponse, + DescribeScalingPlanResourcesRequest, + DescribeScalingPlanResourcesResponse, + DescribeScalingPlansRequest, + DescribeScalingPlansResponse, + GetScalingPlanResourceForecastDataRequest, + GetScalingPlanResourceForecastDataResponse, + InternalServiceException, + InvalidNextTokenException, + LimitExceededException, + MetricDimension, + ObjectNotFoundException, + PredefinedLoadMetricSpecification, + PredefinedScalingMetricSpecification, + ScalingInstruction, + ScalingPlan, + ScalingPlanResource, + ScalingPolicy, + TagFilter, + TargetTrackingConfiguration, + UpdateScalingPlanRequest, + UpdateScalingPlanResponse, + ValidationException +} from "../models/index"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { SmithyException as __SmithyException } from "@aws-sdk/smithy-client"; +import { + Endpoint as __Endpoint, + MetadataBearer as __MetadataBearer, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext +} from "@aws-sdk/types"; + +export async function serializeAws_json1_1CreateScalingPlanCommand( + input: CreateScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.CreateScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + CreateScalingPlanRequest: serializeAws_json1_1CreateScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/CreateScalingPlan", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DeleteScalingPlanCommand( + input: DeleteScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DeleteScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + DeleteScalingPlanRequest: serializeAws_json1_1DeleteScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DeleteScalingPlan", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeScalingPlanResourcesCommand( + input: DescribeScalingPlanResourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DescribeScalingPlanResources"; + let body: any = {}; + const wrappedBody: any = { + DescribeScalingPlanResourcesRequest: serializeAws_json1_1DescribeScalingPlanResourcesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeScalingPlanResources", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeScalingPlansCommand( + input: DescribeScalingPlansCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.DescribeScalingPlans"; + let body: any = {}; + const wrappedBody: any = { + DescribeScalingPlansRequest: serializeAws_json1_1DescribeScalingPlansRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeScalingPlans", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1GetScalingPlanResourceForecastDataCommand( + input: GetScalingPlanResourceForecastDataCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.GetScalingPlanResourceForecastData"; + let body: any = {}; + const wrappedBody: any = { + GetScalingPlanResourceForecastDataRequest: serializeAws_json1_1GetScalingPlanResourceForecastDataRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/GetScalingPlanResourceForecastData", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1UpdateScalingPlanCommand( + input: UpdateScalingPlanCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "AnyScaleScalingPlannerFrontendService.UpdateScalingPlan"; + let body: any = {}; + const wrappedBody: any = { + UpdateScalingPlanRequest: serializeAws_json1_1UpdateScalingPlanRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/UpdateScalingPlan", + headers: headers, + body: body + }); +} + +export async function deserializeAws_json1_1CreateScalingPlanCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1CreateScalingPlanCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1CreateScalingPlanResponse( + data.CreateScalingPlanResponse, + context + ); + const response: CreateScalingPlanCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "CreateScalingPlanResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1CreateScalingPlanCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentUpdateException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ConcurrentUpdateException": + response = await deserializeAws_json1_1ConcurrentUpdateExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "LimitExceededException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#LimitExceededException": + response = await deserializeAws_json1_1LimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DeleteScalingPlanCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DeleteScalingPlanCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DeleteScalingPlanResponse( + data.DeleteScalingPlanResponse, + context + ); + const response: DeleteScalingPlanCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeleteScalingPlanResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DeleteScalingPlanCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentUpdateException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ConcurrentUpdateException": + response = await deserializeAws_json1_1ConcurrentUpdateExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "ObjectNotFoundException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ObjectNotFoundException": + response = await deserializeAws_json1_1ObjectNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeScalingPlanResourcesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeScalingPlanResourcesCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeScalingPlanResourcesResponse( + data.DescribeScalingPlanResourcesResponse, + context + ); + const response: DescribeScalingPlanResourcesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeScalingPlanResourcesResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeScalingPlanResourcesCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentUpdateException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ConcurrentUpdateException": + response = await deserializeAws_json1_1ConcurrentUpdateExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidNextTokenException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InvalidNextTokenException": + response = await deserializeAws_json1_1InvalidNextTokenExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeScalingPlansCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeScalingPlansCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeScalingPlansResponse( + data.DescribeScalingPlansResponse, + context + ); + const response: DescribeScalingPlansCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeScalingPlansResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeScalingPlansCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentUpdateException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ConcurrentUpdateException": + response = await deserializeAws_json1_1ConcurrentUpdateExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidNextTokenException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InvalidNextTokenException": + response = await deserializeAws_json1_1InvalidNextTokenExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1GetScalingPlanResourceForecastDataCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse( + data.GetScalingPlanResourceForecastDataResponse, + context + ); + const response: GetScalingPlanResourceForecastDataCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "GetScalingPlanResourceForecastDataResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1GetScalingPlanResourceForecastDataCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1UpdateScalingPlanCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1UpdateScalingPlanCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1UpdateScalingPlanResponse( + data.UpdateScalingPlanResponse, + context + ); + const response: UpdateScalingPlanCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "UpdateScalingPlanResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1UpdateScalingPlanCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentUpdateException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ConcurrentUpdateException": + response = await deserializeAws_json1_1ConcurrentUpdateExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServiceException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#InternalServiceException": + response = await deserializeAws_json1_1InternalServiceExceptionResponse( + parsedOutput, + context + ); + break; + case "ObjectNotFoundException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ObjectNotFoundException": + response = await deserializeAws_json1_1ObjectNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ValidationException": + case "com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#ValidationException": + response = await deserializeAws_json1_1ValidationExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.autoscaling.anyscale.scaling_planner.frontend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +const deserializeAws_json1_1ConcurrentUpdateExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ConcurrentUpdateException( + output.body, + context + ); + const contents: ConcurrentUpdateException = { + __type: "ConcurrentUpdateException", + $fault: "server", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1InternalServiceExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1InternalServiceException( + output.body, + context + ); + const contents: InternalServiceException = { + __type: "InternalServiceException", + $fault: "server", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1InvalidNextTokenException( + output.body, + context + ); + const contents: InvalidNextTokenException = { + __type: "InvalidNextTokenException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1LimitExceededExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1LimitExceededException( + output.body, + context + ); + const contents: LimitExceededException = { + __type: "LimitExceededException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ObjectNotFoundExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ObjectNotFoundException( + output.body, + context + ); + const contents: ObjectNotFoundException = { + __type: "ObjectNotFoundException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ValidationExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ValidationException( + output.body, + context + ); + const contents: ValidationException = { + __type: "ValidationException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const serializeAws_json1_1ApplicationSource = ( + input: ApplicationSource, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.CloudFormationStackARN !== undefined) { + bodyParams["CloudFormationStackARN"] = input.CloudFormationStackARN; + } + if (input.TagFilters !== undefined) { + bodyParams["TagFilters"] = serializeAws_json1_1TagFilters( + input.TagFilters, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1ApplicationSources = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1ApplicationSource(entry, context) + ); +}; + +const serializeAws_json1_1CreateScalingPlanRequest = ( + input: CreateScalingPlanRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ApplicationSource !== undefined) { + bodyParams["ApplicationSource"] = serializeAws_json1_1ApplicationSource( + input.ApplicationSource, + context + ); + } + if (input.ScalingInstructions !== undefined) { + bodyParams["ScalingInstructions"] = serializeAws_json1_1ScalingInstructions( + input.ScalingInstructions, + context + ); + } + if (input.ScalingPlanName !== undefined) { + bodyParams["ScalingPlanName"] = input.ScalingPlanName; + } + return bodyParams; +}; + +const serializeAws_json1_1CustomizedLoadMetricSpecification = ( + input: CustomizedLoadMetricSpecification, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Dimensions !== undefined) { + bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensions( + input.Dimensions, + context + ); + } + if (input.MetricName !== undefined) { + bodyParams["MetricName"] = input.MetricName; + } + if (input.Namespace !== undefined) { + bodyParams["Namespace"] = input.Namespace; + } + if (input.Statistic !== undefined) { + bodyParams["Statistic"] = input.Statistic; + } + if (input.Unit !== undefined) { + bodyParams["Unit"] = input.Unit; + } + return bodyParams; +}; + +const serializeAws_json1_1CustomizedScalingMetricSpecification = ( + input: CustomizedScalingMetricSpecification, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Dimensions !== undefined) { + bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensions( + input.Dimensions, + context + ); + } + if (input.MetricName !== undefined) { + bodyParams["MetricName"] = input.MetricName; + } + if (input.Namespace !== undefined) { + bodyParams["Namespace"] = input.Namespace; + } + if (input.Statistic !== undefined) { + bodyParams["Statistic"] = input.Statistic; + } + if (input.Unit !== undefined) { + bodyParams["Unit"] = input.Unit; + } + return bodyParams; +}; + +const serializeAws_json1_1DeleteScalingPlanRequest = ( + input: DeleteScalingPlanRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ScalingPlanName !== undefined) { + bodyParams["ScalingPlanName"] = input.ScalingPlanName; + } + if (input.ScalingPlanVersion !== undefined) { + bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeScalingPlanResourcesRequest = ( + input: DescribeScalingPlanResourcesRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + if (input.ScalingPlanName !== undefined) { + bodyParams["ScalingPlanName"] = input.ScalingPlanName; + } + if (input.ScalingPlanVersion !== undefined) { + bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeScalingPlansRequest = ( + input: DescribeScalingPlansRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ApplicationSources !== undefined) { + bodyParams["ApplicationSources"] = serializeAws_json1_1ApplicationSources( + input.ApplicationSources, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + if (input.ScalingPlanNames !== undefined) { + bodyParams["ScalingPlanNames"] = serializeAws_json1_1ScalingPlanNames( + input.ScalingPlanNames, + context + ); + } + if (input.ScalingPlanVersion !== undefined) { + bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; + } + return bodyParams; +}; + +const serializeAws_json1_1GetScalingPlanResourceForecastDataRequest = ( + input: GetScalingPlanResourceForecastDataRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EndTime !== undefined) { + bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); + } + if (input.ForecastDataType !== undefined) { + bodyParams["ForecastDataType"] = input.ForecastDataType; + } + if (input.ResourceId !== undefined) { + bodyParams["ResourceId"] = input.ResourceId; + } + if (input.ScalableDimension !== undefined) { + bodyParams["ScalableDimension"] = input.ScalableDimension; + } + if (input.ScalingPlanName !== undefined) { + bodyParams["ScalingPlanName"] = input.ScalingPlanName; + } + if (input.ScalingPlanVersion !== undefined) { + bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; + } + if (input.ServiceNamespace !== undefined) { + bodyParams["ServiceNamespace"] = input.ServiceNamespace; + } + if (input.StartTime !== undefined) { + bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); + } + return bodyParams; +}; + +const serializeAws_json1_1MetricDimension = ( + input: MetricDimension, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Name !== undefined) { + bodyParams["Name"] = input.Name; + } + if (input.Value !== undefined) { + bodyParams["Value"] = input.Value; + } + return bodyParams; +}; + +const serializeAws_json1_1MetricDimensions = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1MetricDimension(entry, context) + ); +}; + +const serializeAws_json1_1PredefinedLoadMetricSpecification = ( + input: PredefinedLoadMetricSpecification, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.PredefinedLoadMetricType !== undefined) { + bodyParams["PredefinedLoadMetricType"] = input.PredefinedLoadMetricType; + } + if (input.ResourceLabel !== undefined) { + bodyParams["ResourceLabel"] = input.ResourceLabel; + } + return bodyParams; +}; + +const serializeAws_json1_1PredefinedScalingMetricSpecification = ( + input: PredefinedScalingMetricSpecification, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.PredefinedScalingMetricType !== undefined) { + bodyParams["PredefinedScalingMetricType"] = + input.PredefinedScalingMetricType; + } + if (input.ResourceLabel !== undefined) { + bodyParams["ResourceLabel"] = input.ResourceLabel; + } + return bodyParams; +}; + +const serializeAws_json1_1ScalingInstruction = ( + input: ScalingInstruction, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.CustomizedLoadMetricSpecification !== undefined) { + bodyParams[ + "CustomizedLoadMetricSpecification" + ] = serializeAws_json1_1CustomizedLoadMetricSpecification( + input.CustomizedLoadMetricSpecification, + context + ); + } + if (input.DisableDynamicScaling !== undefined) { + bodyParams["DisableDynamicScaling"] = input.DisableDynamicScaling; + } + if (input.MaxCapacity !== undefined) { + bodyParams["MaxCapacity"] = input.MaxCapacity; + } + if (input.MinCapacity !== undefined) { + bodyParams["MinCapacity"] = input.MinCapacity; + } + if (input.PredefinedLoadMetricSpecification !== undefined) { + bodyParams[ + "PredefinedLoadMetricSpecification" + ] = serializeAws_json1_1PredefinedLoadMetricSpecification( + input.PredefinedLoadMetricSpecification, + context + ); + } + if (input.PredictiveScalingMaxCapacityBehavior !== undefined) { + bodyParams["PredictiveScalingMaxCapacityBehavior"] = + input.PredictiveScalingMaxCapacityBehavior; + } + if (input.PredictiveScalingMaxCapacityBuffer !== undefined) { + bodyParams["PredictiveScalingMaxCapacityBuffer"] = + input.PredictiveScalingMaxCapacityBuffer; + } + if (input.PredictiveScalingMode !== undefined) { + bodyParams["PredictiveScalingMode"] = input.PredictiveScalingMode; + } + if (input.ResourceId !== undefined) { + bodyParams["ResourceId"] = input.ResourceId; + } + if (input.ScalableDimension !== undefined) { + bodyParams["ScalableDimension"] = input.ScalableDimension; + } + if (input.ScalingPolicyUpdateBehavior !== undefined) { + bodyParams["ScalingPolicyUpdateBehavior"] = + input.ScalingPolicyUpdateBehavior; + } + if (input.ScheduledActionBufferTime !== undefined) { + bodyParams["ScheduledActionBufferTime"] = input.ScheduledActionBufferTime; + } + if (input.ServiceNamespace !== undefined) { + bodyParams["ServiceNamespace"] = input.ServiceNamespace; + } + if (input.TargetTrackingConfigurations !== undefined) { + bodyParams[ + "TargetTrackingConfigurations" + ] = serializeAws_json1_1TargetTrackingConfigurations( + input.TargetTrackingConfigurations, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1ScalingInstructions = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1ScalingInstruction(entry, context) + ); +}; + +const serializeAws_json1_1ScalingPlanNames = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1TagFilter = ( + input: TagFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Key !== undefined) { + bodyParams["Key"] = input.Key; + } + if (input.Values !== undefined) { + bodyParams["Values"] = serializeAws_json1_1TagValues(input.Values, context); + } + return bodyParams; +}; + +const serializeAws_json1_1TagFilters = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1TagFilter(entry, context) + ); +}; + +const serializeAws_json1_1TagValues = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1TargetTrackingConfiguration = ( + input: TargetTrackingConfiguration, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.CustomizedScalingMetricSpecification !== undefined) { + bodyParams[ + "CustomizedScalingMetricSpecification" + ] = serializeAws_json1_1CustomizedScalingMetricSpecification( + input.CustomizedScalingMetricSpecification, + context + ); + } + if (input.DisableScaleIn !== undefined) { + bodyParams["DisableScaleIn"] = input.DisableScaleIn; + } + if (input.EstimatedInstanceWarmup !== undefined) { + bodyParams["EstimatedInstanceWarmup"] = input.EstimatedInstanceWarmup; + } + if (input.PredefinedScalingMetricSpecification !== undefined) { + bodyParams[ + "PredefinedScalingMetricSpecification" + ] = serializeAws_json1_1PredefinedScalingMetricSpecification( + input.PredefinedScalingMetricSpecification, + context + ); + } + if (input.ScaleInCooldown !== undefined) { + bodyParams["ScaleInCooldown"] = input.ScaleInCooldown; + } + if (input.ScaleOutCooldown !== undefined) { + bodyParams["ScaleOutCooldown"] = input.ScaleOutCooldown; + } + if (input.TargetValue !== undefined) { + bodyParams["TargetValue"] = input.TargetValue; + } + return bodyParams; +}; + +const serializeAws_json1_1TargetTrackingConfigurations = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1TargetTrackingConfiguration(entry, context) + ); +}; + +const serializeAws_json1_1UpdateScalingPlanRequest = ( + input: UpdateScalingPlanRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ApplicationSource !== undefined) { + bodyParams["ApplicationSource"] = serializeAws_json1_1ApplicationSource( + input.ApplicationSource, + context + ); + } + if (input.ScalingInstructions !== undefined) { + bodyParams["ScalingInstructions"] = serializeAws_json1_1ScalingInstructions( + input.ScalingInstructions, + context + ); + } + if (input.ScalingPlanName !== undefined) { + bodyParams["ScalingPlanName"] = input.ScalingPlanName; + } + if (input.ScalingPlanVersion !== undefined) { + bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; + } + return bodyParams; +}; + +const deserializeAws_json1_1ApplicationSource = ( + output: any, + context: __SerdeContext +): ApplicationSource => { + let contents: any = { + __type: "ApplicationSource", + CloudFormationStackARN: undefined, + TagFilters: undefined + }; + if (output.CloudFormationStackARN !== undefined) { + contents.CloudFormationStackARN = output.CloudFormationStackARN; + } + if (output.TagFilters !== undefined) { + contents.TagFilters = deserializeAws_json1_1TagFilters( + output.TagFilters, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1ConcurrentUpdateException = ( + output: any, + context: __SerdeContext +): ConcurrentUpdateException => { + let contents: any = { + __type: "ConcurrentUpdateException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1CreateScalingPlanResponse = ( + output: any, + context: __SerdeContext +): CreateScalingPlanResponse => { + let contents: any = { + __type: "CreateScalingPlanResponse", + ScalingPlanVersion: undefined + }; + if (output.ScalingPlanVersion !== undefined) { + contents.ScalingPlanVersion = output.ScalingPlanVersion; + } + return contents; +}; + +const deserializeAws_json1_1CustomizedLoadMetricSpecification = ( + output: any, + context: __SerdeContext +): CustomizedLoadMetricSpecification => { + let contents: any = { + __type: "CustomizedLoadMetricSpecification", + Dimensions: undefined, + MetricName: undefined, + Namespace: undefined, + Statistic: undefined, + Unit: undefined + }; + if (output.Dimensions !== undefined) { + contents.Dimensions = deserializeAws_json1_1MetricDimensions( + output.Dimensions, + context + ); + } + if (output.MetricName !== undefined) { + contents.MetricName = output.MetricName; + } + if (output.Namespace !== undefined) { + contents.Namespace = output.Namespace; + } + if (output.Statistic !== undefined) { + contents.Statistic = output.Statistic; + } + if (output.Unit !== undefined) { + contents.Unit = output.Unit; + } + return contents; +}; + +const deserializeAws_json1_1CustomizedScalingMetricSpecification = ( + output: any, + context: __SerdeContext +): CustomizedScalingMetricSpecification => { + let contents: any = { + __type: "CustomizedScalingMetricSpecification", + Dimensions: undefined, + MetricName: undefined, + Namespace: undefined, + Statistic: undefined, + Unit: undefined + }; + if (output.Dimensions !== undefined) { + contents.Dimensions = deserializeAws_json1_1MetricDimensions( + output.Dimensions, + context + ); + } + if (output.MetricName !== undefined) { + contents.MetricName = output.MetricName; + } + if (output.Namespace !== undefined) { + contents.Namespace = output.Namespace; + } + if (output.Statistic !== undefined) { + contents.Statistic = output.Statistic; + } + if (output.Unit !== undefined) { + contents.Unit = output.Unit; + } + return contents; +}; + +const deserializeAws_json1_1Datapoint = ( + output: any, + context: __SerdeContext +): Datapoint => { + let contents: any = { + __type: "Datapoint", + Timestamp: undefined, + Value: undefined + }; + if (output.Timestamp !== undefined) { + contents.Timestamp = new Date( + output.Timestamp % 1 != 0 + ? Math.round(output.Timestamp * 1000) + : output.Timestamp + ); + } + if (output.Value !== undefined) { + contents.Value = output.Value; + } + return contents; +}; + +const deserializeAws_json1_1Datapoints = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1Datapoint(entry, context) + ); +}; + +const deserializeAws_json1_1DeleteScalingPlanResponse = ( + output: any, + context: __SerdeContext +): DeleteScalingPlanResponse => { + let contents: any = { + __type: "DeleteScalingPlanResponse" + }; + return contents; +}; + +const deserializeAws_json1_1DescribeScalingPlanResourcesResponse = ( + output: any, + context: __SerdeContext +): DescribeScalingPlanResourcesResponse => { + let contents: any = { + __type: "DescribeScalingPlanResourcesResponse", + NextToken: undefined, + ScalingPlanResources: undefined + }; + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + if (output.ScalingPlanResources !== undefined) { + contents.ScalingPlanResources = deserializeAws_json1_1ScalingPlanResources( + output.ScalingPlanResources, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeScalingPlansResponse = ( + output: any, + context: __SerdeContext +): DescribeScalingPlansResponse => { + let contents: any = { + __type: "DescribeScalingPlansResponse", + NextToken: undefined, + ScalingPlans: undefined + }; + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + if (output.ScalingPlans !== undefined) { + contents.ScalingPlans = deserializeAws_json1_1ScalingPlans( + output.ScalingPlans, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1GetScalingPlanResourceForecastDataResponse = ( + output: any, + context: __SerdeContext +): GetScalingPlanResourceForecastDataResponse => { + let contents: any = { + __type: "GetScalingPlanResourceForecastDataResponse", + Datapoints: undefined + }; + if (output.Datapoints !== undefined) { + contents.Datapoints = deserializeAws_json1_1Datapoints( + output.Datapoints, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1InternalServiceException = ( + output: any, + context: __SerdeContext +): InternalServiceException => { + let contents: any = { + __type: "InternalServiceException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1InvalidNextTokenException = ( + output: any, + context: __SerdeContext +): InvalidNextTokenException => { + let contents: any = { + __type: "InvalidNextTokenException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1LimitExceededException = ( + output: any, + context: __SerdeContext +): LimitExceededException => { + let contents: any = { + __type: "LimitExceededException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1MetricDimension = ( + output: any, + context: __SerdeContext +): MetricDimension => { + let contents: any = { + __type: "MetricDimension", + Name: undefined, + Value: undefined + }; + if (output.Name !== undefined) { + contents.Name = output.Name; + } + if (output.Value !== undefined) { + contents.Value = output.Value; + } + return contents; +}; + +const deserializeAws_json1_1MetricDimensions = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1MetricDimension(entry, context) + ); +}; + +const deserializeAws_json1_1ObjectNotFoundException = ( + output: any, + context: __SerdeContext +): ObjectNotFoundException => { + let contents: any = { + __type: "ObjectNotFoundException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1PredefinedLoadMetricSpecification = ( + output: any, + context: __SerdeContext +): PredefinedLoadMetricSpecification => { + let contents: any = { + __type: "PredefinedLoadMetricSpecification", + PredefinedLoadMetricType: undefined, + ResourceLabel: undefined + }; + if (output.PredefinedLoadMetricType !== undefined) { + contents.PredefinedLoadMetricType = output.PredefinedLoadMetricType; + } + if (output.ResourceLabel !== undefined) { + contents.ResourceLabel = output.ResourceLabel; + } + return contents; +}; + +const deserializeAws_json1_1PredefinedScalingMetricSpecification = ( + output: any, + context: __SerdeContext +): PredefinedScalingMetricSpecification => { + let contents: any = { + __type: "PredefinedScalingMetricSpecification", + PredefinedScalingMetricType: undefined, + ResourceLabel: undefined + }; + if (output.PredefinedScalingMetricType !== undefined) { + contents.PredefinedScalingMetricType = output.PredefinedScalingMetricType; + } + if (output.ResourceLabel !== undefined) { + contents.ResourceLabel = output.ResourceLabel; + } + return contents; +}; + +const deserializeAws_json1_1ScalingInstruction = ( + output: any, + context: __SerdeContext +): ScalingInstruction => { + let contents: any = { + __type: "ScalingInstruction", + CustomizedLoadMetricSpecification: undefined, + DisableDynamicScaling: undefined, + MaxCapacity: undefined, + MinCapacity: undefined, + PredefinedLoadMetricSpecification: undefined, + PredictiveScalingMaxCapacityBehavior: undefined, + PredictiveScalingMaxCapacityBuffer: undefined, + PredictiveScalingMode: undefined, + ResourceId: undefined, + ScalableDimension: undefined, + ScalingPolicyUpdateBehavior: undefined, + ScheduledActionBufferTime: undefined, + ServiceNamespace: undefined, + TargetTrackingConfigurations: undefined + }; + if (output.CustomizedLoadMetricSpecification !== undefined) { + contents.CustomizedLoadMetricSpecification = deserializeAws_json1_1CustomizedLoadMetricSpecification( + output.CustomizedLoadMetricSpecification, + context + ); + } + if (output.DisableDynamicScaling !== undefined) { + contents.DisableDynamicScaling = output.DisableDynamicScaling; + } + if (output.MaxCapacity !== undefined) { + contents.MaxCapacity = output.MaxCapacity; + } + if (output.MinCapacity !== undefined) { + contents.MinCapacity = output.MinCapacity; + } + if (output.PredefinedLoadMetricSpecification !== undefined) { + contents.PredefinedLoadMetricSpecification = deserializeAws_json1_1PredefinedLoadMetricSpecification( + output.PredefinedLoadMetricSpecification, + context + ); + } + if (output.PredictiveScalingMaxCapacityBehavior !== undefined) { + contents.PredictiveScalingMaxCapacityBehavior = + output.PredictiveScalingMaxCapacityBehavior; + } + if (output.PredictiveScalingMaxCapacityBuffer !== undefined) { + contents.PredictiveScalingMaxCapacityBuffer = + output.PredictiveScalingMaxCapacityBuffer; + } + if (output.PredictiveScalingMode !== undefined) { + contents.PredictiveScalingMode = output.PredictiveScalingMode; + } + if (output.ResourceId !== undefined) { + contents.ResourceId = output.ResourceId; + } + if (output.ScalableDimension !== undefined) { + contents.ScalableDimension = output.ScalableDimension; + } + if (output.ScalingPolicyUpdateBehavior !== undefined) { + contents.ScalingPolicyUpdateBehavior = output.ScalingPolicyUpdateBehavior; + } + if (output.ScheduledActionBufferTime !== undefined) { + contents.ScheduledActionBufferTime = output.ScheduledActionBufferTime; + } + if (output.ServiceNamespace !== undefined) { + contents.ServiceNamespace = output.ServiceNamespace; + } + if (output.TargetTrackingConfigurations !== undefined) { + contents.TargetTrackingConfigurations = deserializeAws_json1_1TargetTrackingConfigurations( + output.TargetTrackingConfigurations, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1ScalingInstructions = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1ScalingInstruction(entry, context) + ); +}; + +const deserializeAws_json1_1ScalingPlan = ( + output: any, + context: __SerdeContext +): ScalingPlan => { + let contents: any = { + __type: "ScalingPlan", + ApplicationSource: undefined, + CreationTime: undefined, + ScalingInstructions: undefined, + ScalingPlanName: undefined, + ScalingPlanVersion: undefined, + StatusCode: undefined, + StatusMessage: undefined, + StatusStartTime: undefined + }; + if (output.ApplicationSource !== undefined) { + contents.ApplicationSource = deserializeAws_json1_1ApplicationSource( + output.ApplicationSource, + context + ); + } + if (output.CreationTime !== undefined) { + contents.CreationTime = new Date( + output.CreationTime % 1 != 0 + ? Math.round(output.CreationTime * 1000) + : output.CreationTime + ); + } + if (output.ScalingInstructions !== undefined) { + contents.ScalingInstructions = deserializeAws_json1_1ScalingInstructions( + output.ScalingInstructions, + context + ); + } + if (output.ScalingPlanName !== undefined) { + contents.ScalingPlanName = output.ScalingPlanName; + } + if (output.ScalingPlanVersion !== undefined) { + contents.ScalingPlanVersion = output.ScalingPlanVersion; + } + if (output.StatusCode !== undefined) { + contents.StatusCode = output.StatusCode; + } + if (output.StatusMessage !== undefined) { + contents.StatusMessage = output.StatusMessage; + } + if (output.StatusStartTime !== undefined) { + contents.StatusStartTime = new Date( + output.StatusStartTime % 1 != 0 + ? Math.round(output.StatusStartTime * 1000) + : output.StatusStartTime + ); + } + return contents; +}; + +const deserializeAws_json1_1ScalingPlanResource = ( + output: any, + context: __SerdeContext +): ScalingPlanResource => { + let contents: any = { + __type: "ScalingPlanResource", + ResourceId: undefined, + ScalableDimension: undefined, + ScalingPlanName: undefined, + ScalingPlanVersion: undefined, + ScalingPolicies: undefined, + ScalingStatusCode: undefined, + ScalingStatusMessage: undefined, + ServiceNamespace: undefined + }; + if (output.ResourceId !== undefined) { + contents.ResourceId = output.ResourceId; + } + if (output.ScalableDimension !== undefined) { + contents.ScalableDimension = output.ScalableDimension; + } + if (output.ScalingPlanName !== undefined) { + contents.ScalingPlanName = output.ScalingPlanName; + } + if (output.ScalingPlanVersion !== undefined) { + contents.ScalingPlanVersion = output.ScalingPlanVersion; + } + if (output.ScalingPolicies !== undefined) { + contents.ScalingPolicies = deserializeAws_json1_1ScalingPolicies( + output.ScalingPolicies, + context + ); + } + if (output.ScalingStatusCode !== undefined) { + contents.ScalingStatusCode = output.ScalingStatusCode; + } + if (output.ScalingStatusMessage !== undefined) { + contents.ScalingStatusMessage = output.ScalingStatusMessage; + } + if (output.ServiceNamespace !== undefined) { + contents.ServiceNamespace = output.ServiceNamespace; + } + return contents; +}; + +const deserializeAws_json1_1ScalingPlanResources = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1ScalingPlanResource(entry, context) + ); +}; + +const deserializeAws_json1_1ScalingPlans = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1ScalingPlan(entry, context) + ); +}; + +const deserializeAws_json1_1ScalingPolicies = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1ScalingPolicy(entry, context) + ); +}; + +const deserializeAws_json1_1ScalingPolicy = ( + output: any, + context: __SerdeContext +): ScalingPolicy => { + let contents: any = { + __type: "ScalingPolicy", + PolicyName: undefined, + PolicyType: undefined, + TargetTrackingConfiguration: undefined + }; + if (output.PolicyName !== undefined) { + contents.PolicyName = output.PolicyName; + } + if (output.PolicyType !== undefined) { + contents.PolicyType = output.PolicyType; + } + if (output.TargetTrackingConfiguration !== undefined) { + contents.TargetTrackingConfiguration = deserializeAws_json1_1TargetTrackingConfiguration( + output.TargetTrackingConfiguration, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1TagFilter = ( + output: any, + context: __SerdeContext +): TagFilter => { + let contents: any = { + __type: "TagFilter", + Key: undefined, + Values: undefined + }; + if (output.Key !== undefined) { + contents.Key = output.Key; + } + if (output.Values !== undefined) { + contents.Values = deserializeAws_json1_1TagValues(output.Values, context); + } + return contents; +}; + +const deserializeAws_json1_1TagFilters = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1TagFilter(entry, context) + ); +}; + +const deserializeAws_json1_1TagValues = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => entry); +}; + +const deserializeAws_json1_1TargetTrackingConfiguration = ( + output: any, + context: __SerdeContext +): TargetTrackingConfiguration => { + let contents: any = { + __type: "TargetTrackingConfiguration", + CustomizedScalingMetricSpecification: undefined, + DisableScaleIn: undefined, + EstimatedInstanceWarmup: undefined, + PredefinedScalingMetricSpecification: undefined, + ScaleInCooldown: undefined, + ScaleOutCooldown: undefined, + TargetValue: undefined + }; + if (output.CustomizedScalingMetricSpecification !== undefined) { + contents.CustomizedScalingMetricSpecification = deserializeAws_json1_1CustomizedScalingMetricSpecification( + output.CustomizedScalingMetricSpecification, + context + ); + } + if (output.DisableScaleIn !== undefined) { + contents.DisableScaleIn = output.DisableScaleIn; + } + if (output.EstimatedInstanceWarmup !== undefined) { + contents.EstimatedInstanceWarmup = output.EstimatedInstanceWarmup; + } + if (output.PredefinedScalingMetricSpecification !== undefined) { + contents.PredefinedScalingMetricSpecification = deserializeAws_json1_1PredefinedScalingMetricSpecification( + output.PredefinedScalingMetricSpecification, + context + ); + } + if (output.ScaleInCooldown !== undefined) { + contents.ScaleInCooldown = output.ScaleInCooldown; + } + if (output.ScaleOutCooldown !== undefined) { + contents.ScaleOutCooldown = output.ScaleOutCooldown; + } + if (output.TargetValue !== undefined) { + contents.TargetValue = output.TargetValue; + } + return contents; +}; + +const deserializeAws_json1_1TargetTrackingConfigurations = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1TargetTrackingConfiguration(entry, context) + ); +}; + +const deserializeAws_json1_1UpdateScalingPlanResponse = ( + output: any, + context: __SerdeContext +): UpdateScalingPlanResponse => { + let contents: any = { + __type: "UpdateScalingPlanResponse" + }; + return contents; +}; + +const deserializeAws_json1_1ValidationException = ( + output: any, + context: __SerdeContext +): ValidationException => { + let contents: any = { + __type: "ValidationException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + httpHeaders: output.headers, + requestId: output.headers["x-amzn-requestid"] +}); + +const parseBody = (streamBody: any, context: __SerdeContext): any => { + return context.streamCollector(streamBody).then((body: any) => { + const encoded = context.utf8Encoder(body); + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); +}; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.browser.ts b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts new file mode 100644 index 000000000000..c63a3b2d9513 --- /dev/null +++ b/clients/client-auto-scaling-plans/runtimeConfig.browser.ts @@ -0,0 +1,30 @@ +import { invalidFunction } from "@aws-sdk/invalid-dependency"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler } from "@aws-sdk/fetch-http-handler"; +import { parseUrl } from "@aws-sdk/url-parser-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { streamCollector } from "@aws-sdk/stream-collector-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { name, version } from "./package.json"; +import { ClientDefaults } from "./AutoScalingPlansClient"; +import { ClientSharedValues } from "./runtimeConfig.shared"; + +export const ClientDefaultValues: Required = { + ...ClientSharedValues, + requestHandler: new FetchHttpHandler(), + sha256: Sha256, + urlParser: parseUrl, + bodyLengthChecker: calculateBodyLength, + streamCollector, + base64Decoder: fromBase64, + base64Encoder: toBase64, + utf8Decoder: fromUtf8, + utf8Encoder: toUtf8, + defaultUserAgent: defaultUserAgent(name, version), + runtime: "browser", + signingName: "autoscaling-plans", + credentialDefaultProvider: invalidFunction("Credential is missing") as any, + regionDefaultProvider: invalidFunction("Region is missing") as any +}; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.shared.ts b/clients/client-auto-scaling-plans/runtimeConfig.shared.ts new file mode 100644 index 000000000000..1ce46c797f91 --- /dev/null +++ b/clients/client-auto-scaling-plans/runtimeConfig.shared.ts @@ -0,0 +1,7 @@ +import { defaultRegionInfoProvider } from "./endpoints"; + +export const ClientSharedValues = { + apiVersion: "2018-01-06", + signingName: "autoscaling-plans", + regionInfoProvider: defaultRegionInfoProvider +}; diff --git a/clients/client-auto-scaling-plans/runtimeConfig.ts b/clients/client-auto-scaling-plans/runtimeConfig.ts new file mode 100644 index 000000000000..176ea996ce63 --- /dev/null +++ b/clients/client-auto-scaling-plans/runtimeConfig.ts @@ -0,0 +1,31 @@ +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { defaultProvider as regionDefaultProvider } from "@aws-sdk/region-provider"; +import { Hash } from "@aws-sdk/hash-node"; +import { NodeHttpHandler } from "@aws-sdk/node-http-handler"; +import { parseUrl } from "@aws-sdk/url-parser-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { streamCollector } from "@aws-sdk/stream-collector-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { name, version } from "./package.json"; +import { ClientDefaults } from "./AutoScalingPlansClient"; +import { ClientSharedValues } from "./runtimeConfig.shared"; + +export const ClientDefaultValues: Required = { + ...ClientSharedValues, + requestHandler: new NodeHttpHandler(), + sha256: Hash.bind(null, "sha256"), + urlParser: parseUrl, + bodyLengthChecker: calculateBodyLength, + streamCollector, + base64Decoder: fromBase64, + base64Encoder: toBase64, + utf8Decoder: fromUtf8, + utf8Encoder: toUtf8, + defaultUserAgent: defaultUserAgent(name, version), + runtime: "node", + signingName: "autoscaling-plans", + credentialDefaultProvider, + regionDefaultProvider +}; diff --git a/clients/client-auto-scaling-plans/tsconfig.es.json b/clients/client-auto-scaling-plans/tsconfig.es.json new file mode 100644 index 000000000000..9add6a7c2445 --- /dev/null +++ b/clients/client-auto-scaling-plans/tsconfig.es.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "es5", + "module": "esnext", + "moduleResolution": "node", + "declaration": false, + "declarationDir": null, + "lib": [ + "dom", + "es5", + "es2015.promise", + "es2015.collection", + "es2015.iterable", + "es2015.symbol.wellknown" + ], + "outDir": "dist/es" + } +} diff --git a/clients/client-auto-scaling-plans/tsconfig.json b/clients/client-auto-scaling-plans/tsconfig.json new file mode 100644 index 000000000000..ca2fadc08187 --- /dev/null +++ b/clients/client-auto-scaling-plans/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "alwaysStrict": true, + "target": "es2017", + "module": "commonjs", + "declaration": true, + "strict": true, + "sourceMap": true, + "downlevelIteration": true, + "importHelpers": true, + "noEmitHelpers": true, + "incremental": true, + "resolveJsonModule": true, + "declarationDir": "./types", + "outDir": "dist/cjs" + }, + "typedocOptions": { + "exclude": "**/node_modules/**", + "excludedNotExported": true, + "excludePrivate": true, + "hideGenerator": true, + "ignoreCompilerErrors": true, + "mode": "file", + "out": "./docs", + "plugin": "@aws-sdk/client-documentation-generator" + } +}